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 calendar blocks to the default theme.
function date_tools_wizard_create_blocks($type_name) { $current_theme = variable_get('theme_default', 'garland'); // Legend block. $block = new stdClass(); $block->theme = $current_theme; $block->status = 1; $block->weight = -1; $block->region = 'left'; $block->title = ''; $block->module = 'calendar'; $block->delta = 0; date_tools_wizard_add_block($block); // Mini calendar block. $block->module = 'views'; $block->delta = 'calendar_'. $type_name .'-calendar_block_1'; date_tools_wizard_add_block($block); // Upcoming events block. $block->module = 'views'; $block->delta = 'calendar_'. $type_name .'-block_1'; date_tools_wizard_add_block($block); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_block_core_calendar() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/calendar',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_calendar',\n\t\t)\n\t);\n}", "public function calendar()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'calendar');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Calendar')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/calendar');\n }", "function render_block_core_calendar( $attributes ) {\n\tglobal $monthnum, $year;\n\n\t// Calendar shouldn't be rendered\n\t// when there are no published posts on the site.\n\tif ( ! block_core_calendar_has_published_posts() ) {\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn '<div>' . __( 'The calendar block is hidden because there are no published posts.' ) . '</div>';\n\t\t}\n\t\treturn '';\n\t}\n\n\t$previous_monthnum = $monthnum;\n\t$previous_year = $year;\n\n\tif ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {\n\t\t$permalink_structure = get_option( 'permalink_structure' );\n\t\tif (\n\t\t\tstr_contains( $permalink_structure, '%monthnum%' ) &&\n\t\t\tstr_contains( $permalink_structure, '%year%' )\n\t\t) {\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$monthnum = $attributes['month'];\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$year = $attributes['year'];\n\t\t}\n\t}\n\n\t$color_block_styles = array();\n\n\t// Text color.\n\t$preset_text_color = array_key_exists( 'textColor', $attributes ) ? \"var:preset|color|{$attributes['textColor']}\" : null;\n\t$custom_text_color = _wp_array_get( $attributes, array( 'style', 'color', 'text' ), null );\n\t$color_block_styles['text'] = $preset_text_color ? $preset_text_color : $custom_text_color;\n\n\t// Background Color.\n\t$preset_background_color = array_key_exists( 'backgroundColor', $attributes ) ? \"var:preset|color|{$attributes['backgroundColor']}\" : null;\n\t$custom_background_color = _wp_array_get( $attributes, array( 'style', 'color', 'background' ), null );\n\t$color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color;\n\n\t// Generate color styles and classes.\n\t$styles = wp_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );\n\t$inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style=\"%s\"', esc_attr( $styles['css'] ) );\n\t$classnames = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] );\n\tif ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {\n\t\t$classnames .= ' has-link-color';\n\t}\n\t// Apply color classes and styles to the calendar.\n\t$calendar = str_replace( '<table', '<table' . $inline_styles, get_calendar( true, false ) );\n\t$calendar = str_replace( 'class=\"wp-calendar-table', 'class=\"wp-calendar-table' . $classnames, $calendar );\n\n\t$wrapper_attributes = get_block_wrapper_attributes();\n\t$output = sprintf(\n\t\t'<div %1$s>%2$s</div>',\n\t\t$wrapper_attributes,\n\t\t$calendar\n\t);\n\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$monthnum = $previous_monthnum;\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$year = $previous_year;\n\n\treturn $output;\n}", "function register_block_core_calendar()\n {\n }", "function render_block_core_calendar($attributes)\n {\n }", "function ca_design_system_custom_wp_block_pattern_agenda()\n{\n\n if (!function_exists('register_block_pattern')) {\n // Gutenberg is not active.\n return;\n }\n\n /**\n * Register Block Pattern\n */\n register_block_pattern(\n 'ca-design-system/agenda',\n array(\n 'title' => __('Agenda', 'ca-design-system'),\n 'description' => __('Agenda layout', 'Block pattern description', 'ca-design-system'),\n 'content' => '<!-- wp:columns -->\n <div class=\"wp-block-columns has-2-columns\">\n <!-- wp:column {\"width\":\"66.66%\"} -->\n <div id=\"main-content\" class=\"wp-block-column\" style=\"flex-basis:66.66%\">\n \n </div>\n <!-- /wp:column -->\n\n <!-- wp:column {\"width\":\"33.33%\"} -->\n <div class=\"wp-block-column\" style=\"flex-basis:33.33%\">\n\n </div>\n <!-- /wp:column --> \n </div><!-- /wp:columns -->',\n \"categories\" => array('ca-design-system'),\n )\n );\n}", "function gutenberg_frugalisme_custom_blocks() {\n\twp_register_style(\n\t\t'frugalisme-front-end-styles',\n\t\tSB_PLUGIN_URL . '/style.css',\n\t\tarray( 'wp-edit-blocks' ),\n\t\tfilemtime( SB_PLUGIN_DIR_PATH . 'style.css' )\n\t);\n\t// Block editor styles.\n\twp_register_style(\n\t\t'frugalisme-editor-styles',\n\t\tSB_PLUGIN_URL . '/editor.css',\n\t\tarray( 'wp-edit-blocks' ),\n\t\tfilemtime( SB_PLUGIN_DIR_PATH . 'editor.css' )\n\t);\n\n\t// Block Editor Script.\n\twp_register_script(\n\t\t'frugalisme-editor-js',\n\t\tSB_PLUGIN_URL . '/youtube-feed.js',\n\t\tarray( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components', 'wp-i18n' ),\n\t\tfilemtime( SB_PLUGIN_DIR_PATH . 'youtube-feed.js' ),\n\t\ttrue\n\t);\n\tregister_block_type(\n\t\t'youtube-feed/youtube-feed',\n\t\tarray(\n\t\t\t'style' => 'frugalisme-front-end-styles',\n\t\t\t'editor_style' => 'frugalisme-editor-styles',\n\t\t\t'editor_script' => 'frugalisme-editor-js',\n\t\t\t'render_callback' => 'frugalisme_render_feed'\n\t\t)\n\t);\n\n}", "public function simple_events_slider() {\r\n if ( ! function_exists( 'register_block_type' ) ) {\r\n return;\r\n }\r\n \r\n // Add block script.\r\n wp_register_script(\r\n 'simple-event-slider',\r\n Plugin::p_url( '/assets/blocks/event-slider/event-slider.js', __FILE__ ),\r\n [ 'wp-blocks', 'wp-element', 'wp-editor' ],\r\n filemtime( Plugin::p_url( '/assets/blocks/event-slider/event-slider.js', __FILE__ ))\r\n );\r\n \r\n // Add block style.\r\n wp_register_style(\r\n 'simple-event-slider',\r\n Plugin::p_url( '/assets/blocks/event-slider/event-slider.css', __FILE__ ),\r\n [],\r\n filemtime( Plugin::p_url( '/assets/blocks/event-slider/event-slider.css', __FILE__ ))\r\n );\r\n \r\n register_block_type( 'pt/simple-event-slider', array(\r\n 'api_version' => 2,\r\n 'editor_script' => 'simple-event-slider',\r\n 'render_callback' => [$this,'simple_events_slider_render_callback']\r\n ) );\r\n \r\n }", "public function getThemeBlocks();", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "protected function register_blocks() {\n\n\t\t\\register_block_type(\n\t\t\t'tcc/column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-1-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-2-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-3-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-4-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t}", "function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}", "function calslabs_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Top Right Hours',\n\t\t'id' => 'top_right_area',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function _register_theme_block_patterns()\n {\n }", "public function setSections() {\n\t\t\t$schedules\t=\tarray();\n \t$wp_get_schedules\t=\tfunction_exists( 'wp_get_schedules' ) ? wp_get_schedules() : null;\n \tif( is_array( $wp_get_schedules ) && !empty( $wp_get_schedules ) ){\n \t\tforeach ($wp_get_schedules as $key=>$value) {\n \t\t\t$schedules[ $key ]\t=\t$value['display'];\n \t\t}\n \t}\n\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('General','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'homepage',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Homepage', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Setup the Homepage.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_homepage_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'logo',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Logo', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Upload your logo.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_logo_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t=>\t'favicon',\n\t\t\t\t\t\t'type'\t=>\t'media',\n\t\t\t\t\t\t'url' => true,\n 'subtitle' => __('Upload any media using the WordPress native uploader', 'neat'),\t\t\t\t\n\t\t\t\t\t\t'title'\t=>\t__('Favicon','neat')\n\t\t\t\t\t),\n array(\n 'id' => 'custom_css',\n 'type' => 'ace_editor',\n 'title' => __('Custom CSS', 'neat'),\n 'subtitle' => __('Paste your CSS code here, no style tag.', 'neat'),\n 'mode' => 'css',\n 'theme' => 'monokai'\n ),\t\n array(\n 'id' => 'custom_js',\n 'type' => 'ace_editor',\n 'title' => __('Custom JS', 'neat'),\n 'subtitle' => __('Paste your JS code here, no script tag, eg: alert(\\'hello world\\');', 'neat'),\n 'mode' => 'javascript',\n 'theme' => 'chrome'\n )\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('Blog','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\t\t/**\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'blogpage',\n\t\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t\t'title' => __('Blog page', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Setup the blog page.', 'neat'),\n\t\t\t\t\t\t\t'callback' => 'neat_blogpage_callback'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t**/\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'bloglayout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t\t'title' => __('Blog Layout', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Blog page layout.','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'r_sidebar' => array('alt' => __('Right Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'),\n\t\t\t\t\t\t\t\t\t'l_sidebar' => array('alt' => __('Left Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'r_sidebar'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_page_search',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Page Search', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Do not display the Page in search result page.', 'neat'),\n\t\t\t\t\t\t\t'default' => '1'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'include_video_homepage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Including Video Format in Homepage', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('I only want to retrieve the Videos Post Format in Homepage.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_video_blogpage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Video Format in Blog Page', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Do not retrieve the the Videos Post Format in Blog page.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'appid',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('AppID', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => 'Facebook AppID',\n\t\t\t\t\t\t\t'description'\t=> sprintf( __('Get a key %s.', 'neat'), '<a target=\"_blank\" href=\"https://developers.facebook.com\">HERE</a>')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'comment',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title'\t=>\t__('Comment','neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Comment System.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('If you use the Comment plugin (Disqus, facebook ... etc), You have to choose \"Default\".','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'default'\t\t=>\t\t__('Default','neat'),\n\t\t\t\t\t\t\t\t'facebook'\t\t=>\t\t__('Facebook','neat'),\n\t\t\t\t\t\t\t\t'both'\t\t\t=>\t\t__('Both','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'default'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning-both',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => __('The total comment number = default + facebook numner.','neat'),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"=\", 'both'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => sprintf( __('If you use the Facebook Comment system, You have to setup the %s in one time, If you change the Permalink, All the exists comments will be lost.','neat') , '<a href=\"'.admin_url( 'options-permalink.php' ).'\">Permalink</a>' ),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\t\t\t\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-colorscheme',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title' => __('Comment Style', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The color scheme used by the plugin. Can be \"light\" or \"dark\".','neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'light'\t=>\t__('Light','neat'),\n\t\t\t\t\t\t\t\t'dark'\t=>\t__('Dark','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'light',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\t\t\t\t\t\t\t\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-numposts',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Number of Posts', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The number of comments to show by default. The minimum value is 1.','neat'),\n\t\t\t\t\t\t\t'default'\t=>\t10,\n\t\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-orderby',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Order by', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\tsprintf( __('The order to use when displaying comments. Can be \"social\", \"reverse_time\", or \"time\". The different order types are explained %s','neat') , '<a target=\"_blank\" href=\"https://developers.facebook.com/docs/plugins/comments#faqorder\">in the FAQ</a>' ),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'social'\t\t=>\t__('Social','neat'),\n\t\t\t\t\t\t\t\t'reverse_time'\t=>\t__('Reverse Time','neat'),\n\t\t\t\t\t\t\t\t'time'\t\t\t=>\t__('Time','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'social',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'facebooklang',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Language', 'neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'af_ZA'\t\t\t=>\t\t'Afrikaans',\n\t\t\t\t\t\t\t\t'ar_AR'\t\t\t=>\t\t'Arabic',\n\t\t\t\t\t\t\t\t'az_AZ'\t\t\t=>\t\t'Azerbaijani',\n\t\t\t\t\t\t\t\t'be_BY'\t\t\t=>\t\t'Belarusian',\n\t\t\t\t\t\t\t\t'bg_BG'\t\t\t=>\t\t'Bulgarian',\n\t\t\t\t\t\t\t\t'bn_IN'\t\t\t=>\t\t'Bengali',\n\t\t\t\t\t\t\t\t'bs_BA'\t\t\t=>\t\t'Bosnian',\n\t\t\t\t\t\t\t\t'ca_ES'\t\t\t=>\t\t'Catalan',\n\t\t\t\t\t\t\t\t'cs_CZ'\t\t\t=>\t\t'Czech',\n\t\t\t\t\t\t\t\t'cy_GB'\t\t\t=>\t\t'Welsh',\n\t\t\t\t\t\t\t\t'da_DK'\t\t\t=>\t\t'Danish',\n\t\t\t\t\t\t\t\t'de_DE'\t\t\t=>\t\t'German',\n\t\t\t\t\t\t\t\t'el_GR'\t\t\t=>\t\t'Greek',\n\t\t\t\t\t\t\t\t'en_GB'\t\t\t=>\t\t'English (UK)',\t\n\t\t\t\t\t\t\t\t'en_PI'\t\t\t=>\t\t'English (Pirate)',\n\t\t\t\t\t\t\t\t'en_UD'\t\t\t=>\t\t'English (Upside Down)',\n\t\t\t\t\t\t\t\t'en_US'\t\t\t=>\t\t'English (US)',\n\t\t\t\t\t\t\t\t'eo_EO'\t\t\t=>\t\t'Esperanto',\n\t\t\t\t\t\t\t\t'es_ES'\t\t\t=>\t\t'Spanish (Spain)',\n\t\t\t\t\t\t\t\t'es_LA'\t\t\t=>\t\t'Spanish',\n\t\t\t\t\t\t\t\t'et_EE'\t\t\t=>\t\t'Estonian',\n\t\t\t\t\t\t\t\t'eu_ES'\t\t\t=>\t\t'Basque',\n\t\t\t\t\t\t\t\t'fa_IR'\t\t\t=>\t\t'Persian',\n\t\t\t\t\t\t\t\t'fb_LT'\t\t\t=>\t\t'Leet Speak',\n\t\t\t\t\t\t\t\t'fi_FI'\t\t\t=>\t\t'Finnish',\n\t\t\t\t\t\t\t\t'fo_FO'\t\t\t=>\t\t'Faroese',\n\t\t\t\t\t\t\t\t'fr_CA'\t\t\t=>\t\t'French (Canada)',\n\t\t\t\t\t\t\t\t'fr_FR'\t\t\t=>\t\t'French (France)',\n\t\t\t\t\t\t\t\t'fy_NL'\t\t\t=>\t\t'Frisian',\n\t\t\t\t\t\t\t\t'ga_IE'\t\t\t=>\t\t'Irish',\n\t\t\t\t\t\t\t\t'gl_ES'\t\t\t=>\t\t'Galician',\n\t\t\t\t\t\t\t\t'he_IL'\t\t\t=>\t\t'Hebrew',\n\t\t\t\t\t\t\t\t'hi_IN'\t\t\t=>\t\t'Hindi',\n\t\t\t\t\t\t\t\t'hr_HR'\t\t\t=>\t\t'Croatian',\n\t\t\t\t\t\t\t\t'hu_HU'\t\t\t=>\t\t'Hungarian',\n\t\t\t\t\t\t\t\t'hy_AM'\t\t\t=>\t\t'Armenian',\n\t\t\t\t\t\t\t\t'id_ID'\t\t\t=>\t\t'Indonesian',\n\t\t\t\t\t\t\t\t'is_IS'\t\t\t=>\t\t'Icelandic',\n\t\t\t\t\t\t\t\t'it_IT'\t\t\t=>\t\t'Italian',\n\t\t\t\t\t\t\t\t'ja_JP'\t\t\t=>\t\t'Japanese',\n\t\t\t\t\t\t\t\t'ka_GE'\t\t\t=>\t\t'Georgian',\n\t\t\t\t\t\t\t\t'km_KH'\t\t\t=>\t\t'Khmer',\n\t\t\t\t\t\t\t\t'ko_KR'\t\t\t=>\t\t'Korean',\n\t\t\t\t\t\t\t\t'ku_TR'\t\t\t=>\t\t'Kurdish',\n\t\t\t\t\t\t\t\t'la_VA'\t\t\t=>\t\t'Latin',\n\t\t\t\t\t\t\t\t'lt_LT'\t\t\t=>\t\t'Lithuanian',\n\t\t\t\t\t\t\t\t'lv_LV'\t\t\t=>\t\t'Latvian',\n\t\t\t\t\t\t\t\t'mk_MK'\t\t\t=>\t\t'Macedonian',\n\t\t\t\t\t\t\t\t'ml_IN'\t\t\t=>\t\t'Malayalam',\n\t\t\t\t\t\t\t\t'ms_MY'\t\t\t=>\t\t'Malay',\n\t\t\t\t\t\t\t\t'nb_NO'\t\t\t=>\t\t'Norwegian (bokmal)',\n\t\t\t\t\t\t\t\t'ne_NP'\t\t\t=>\t\t'Nepali',\n\t\t\t\t\t\t\t\t'nl_NL'\t\t\t=>\t\t'Dutch',\n\t\t\t\t\t\t\t\t'nn_NO'\t\t\t=>\t\t'Norwegian (nynorsk)',\n\t\t\t\t\t\t\t\t'pa_IN'\t\t\t=>\t\t'Punjabi',\n\t\t\t\t\t\t\t\t'pl_PL'\t\t\t=>\t\t'Polish',\n\t\t\t\t\t\t\t\t'ps_AF'\t\t\t=>\t\t'Pashto',\n\t\t\t\t\t\t\t\t'pt_BR'\t\t\t=>\t\t'Portuguese (Brazil)',\n\t\t\t\t\t\t\t\t'pt_PT'\t\t\t=>\t\t'Portuguese (Portugal)',\n\t\t\t\t\t\t\t\t'ro_RO'\t\t\t=>\t\t'Romanian',\n\t\t\t\t\t\t\t\t'ru_RU'\t\t\t=>\t\t'Russian',\n\t\t\t\t\t\t\t\t'sk_SK'\t\t\t=>\t\t'Slovak',\n\t\t\t\t\t\t\t\t'sl_SI'\t\t\t=>\t\t'Slovenian',\n\t\t\t\t\t\t\t\t'sq_AL'\t\t\t=>\t\t'Albanian',\n\t\t\t\t\t\t\t\t'sr_RS'\t\t\t=>\t\t'Serbian',\n\t\t\t\t\t\t\t\t'sv_SE'\t\t\t=>\t\t'Swedish',\n\t\t\t\t\t\t\t\t'sw_KE'\t\t\t=>\t\t'Swahili',\n\t\t\t\t\t\t\t\t'ta_IN'\t\t\t=>\t\t'Tamil',\n\t\t\t\t\t\t\t\t'te_IN'\t\t\t=>\t\t'Telugu',\n\t\t\t\t\t\t\t\t'th_TH'\t\t\t=>\t\t'Thai',\n\t\t\t\t\t\t\t\t'tl_PH'\t\t\t=>\t\t'Filipino',\n\t\t\t\t\t\t\t\t'tr_TR'\t\t\t=>\t\t'Turkish',\n\t\t\t\t\t\t\t\t'uk_UA'\t\t\t=>\t\t'Ukrainian',\n\t\t\t\t\t\t\t\t'vi_VN'\t\t\t=>\t\t'Vietnamese',\n\t\t\t\t\t\t\t\t'zh_CN'\t\t\t=>\t\t'Simplified Chinese (China)',\n\t\t\t\t\t\t\t\t'zh_HK'\t\t\t=>\t\t'Traditional Chinese (Hong Kong)',\n\t\t\t\t\t\t\t\t'zh_TW'\t\t\t=>\t\t'Traditional Chinese (Taiwan)'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'en_US',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'counter_up_interval',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Scheduling Intervals', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Scheduling the updating Counter intervals.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('Leave blank for real time.','neat'),\n\t\t\t\t\t\t\t'options'\t\t=>\t$schedules,\n\t\t\t\t\t\t\t'default'\t=>\t'15m'\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);\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Submit','neat'),\n\t\t\t\t'icon' => 'el-icon-upload',\n\t\t\t\t'desc' => __('<p class=\"description\">Neat support the post submission at Fronend through Contact Form 7 Form.</p>', 'neat'),\n\t\t\t\t'fields'\t=>\tarray(\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'cf7id',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Contact Form 7 ID', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('Enter the form ID for Post Submission, %s','neat'), '<a href=\"'.admin_url( 'admin.php?page=wpcf7' ).'\">Where is it?</a>' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'post_status',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Post Status', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__('Set the post status for the post, which is submitted through the Contact Form 7 at Frontend.','neat'),\n\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t'pending'\t=>\t__('Pending','neat'),\n\t\t\t\t\t\t\t'publish'\t=>\t__('publish','neat')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default'\t=>\t'pending'\n\t\t\t\t\t),\n\t\t\t\t\t/**\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'user_roles',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Who can submit the post?', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Choose the User roles, all users of this roles can submit the post through Frontend, Leave blank for Guest (all posts is submitted by guest will be assigned to Admin).','neat'),\n\t\t\t\t\t\t'multi' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'limit_posts_amount',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Posts amount/day', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__( 'Limit the posts per day for the User (This function won\\'t work if Guest post is activated), 0 is un-limit.','neat' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t'default'\t=>\t5\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'role_not_limit',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Roles is not limited', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Don\\'t apply the limit post for this roles.','neat'),\n\t\t\t\t\t\t'multi' => true,\n\t\t\t\t\t),\n\t\t\t\t\t**/\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response',\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'title' => __('Auto Response', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Send the message through email to the User after submitted.', 'neat'),\n\t\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s name', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'name' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_email',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s email', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'admin_email' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_subject',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Response Subject', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The subject of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\t\t\t\t\t\t\t\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_content',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Response Content', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The Content of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)<br/><code>[post_link]</code>: The post link (working for the Publish post).','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1)\t\t\t\t\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Styling','neat'),\n\t\t\t\t'icon' => 'el-icon-website',\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'main-style',\n\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t'title' => __('Main Style', 'neat'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'main' => array('alt' => __('Default','neat') , 'img' => NEAT_THEME_URI . '/assets/img/default.png' ),\n\t\t\t\t\t\t\t'main-blue' => array('alt' => __('Blue style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/blue.png' ),\n\t\t\t\t\t\t\t'main-red' => array('alt' => __('Red style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/red.png' ),\n\t\t\t\t\t\t\t'main-dark' => array('alt' => __('Dark style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/dark.png' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => 'main'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'background',\n\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t'output' => array('body'),\n\t\t\t\t\t\t'title' => __('Body Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Body background with image, color, etc.', 'neat'),\n\t\t\t\t\t\t'default' => '#FFFFFF',\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'header-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Header Background Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Header (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu (default: #b3b3b3).', 'neat'),\n\t\t\t\t\t\t'default' => '#b3b3b3',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-hover-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Hover Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu Hover (default: #2ecc71).', 'neat'),\n\t\t\t\t\t\t'default' => '#2ecc71',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Footer (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Footer Text (default: #bfbfbf).', 'neat'),\n\t\t\t\t\t\t'default' => '#bfbfbf',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t//footer\n\t\t\t$footer_field = array();\n\t\t\t$footer_field[] = array(\n\t\t\t\t'id'\t=>\t'footer_text',\n\t\t\t\t'title'\t=>\t__('Copyright Text','neat'),\n\t\t\t\t'type'\t=>\t'textarea',\n\t\t\t\t'default'\t=>\tsprintf( __('Copyright © 2014 <a href=\"%s\">Neat</a> - All Rights Reserved.','neat'), home_url() ),\n\t\t\t\t'desc'\t=>\t__('HTML is allowed in here.','neat')\n\t\t\t);\n\t\t\t$socials = neat_option_socials();\n\t\t\tif( is_array( $socials ) ){\n\t\t\t\tforeach ( $socials as $key=>$value) {\n\t\t\t\t\t$footer_field[] = array(\n\t\t\t\t\t\t'id'\t=>\t'footer_social_' . $key,\n\t\t\t\t\t\t'title'\t=>\t$value['name'],\n\t\t\t\t\t\t'type'\t=>\t'text',\n\t\t\t\t\t\t'placeholder'\t=>\t'http://',\n\t\t\t\t\t\t'desc'\t=>\tsprintf( __('Put the %s profile/page link here.','neat') , $value['name'] )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Footer','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'fields'\t=>\t$footer_field\n\t\t\t);\n\t\t\t\t\t\t\t\n }", "function ws_blocks_register() {\n wp_register_script(\n 'ws-blocks-editor-script', \n plugins_url('dist/editor.js', __FILE__),\n //Array of dependencies\n array(\n 'wp-blocks',\n 'wp-i18n',\n 'wp-element', \n 'wp-editor', \n 'wp-components', \n 'wp-block-editor', \n 'wp-blob',\n 'wp-data'\n )\n );\n\n wp_register_style(\n 'ws-blocks-editor-style',\n plugins_url('dist/editor.css', __FILE__),\n //Array of dependencies - our stylesheet is loaded after this one\n array('wp-edit-blocks')\n );\n\n //Scripts and Styles for Front End\n wp_register_script(\n 'ws-blocks-script', \n plugins_url('dist/script.js', __FILE__),\n //load after jquery\n array('jquery')\n );\n\n wp_register_style(\n 'ws-blocks-style', \n plugins_url('dist/style.css', __FILE__)\n );\n\n ws_block_register_block_type('hero-banner');\n ws_block_register_block_type('story-block');\n ws_block_register_block_type('text-banner');\n}", "function cs_calender_enqueue_scripts() {\n wp_enqueue_script('calender_js', get_template_directory_uri() . '/scripts/frontend/fullcalendar.min.js', '', '', TRUE);\n\t wp_enqueue_style('fullcalendar_css', get_template_directory_uri() . '/css/fullcalendar.css');\n}", "public function register_blocks() {\n\t\tif ( function_exists( 'register_block_type' ) ) {\n\t\t\tregister_block_type(\n\t\t\t\t\"civil/{$this->slug}\",\n\t\t\t\t[\n\t\t\t\t\t'editor_script' => 'block-js-' . $this->slug,\n\t\t\t\t\t'render_callback' => function( array $attributes ) {\n\t\t\t\t\t\treturn $this->render_block_data( $attributes );\n\t\t\t\t\t},\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'title' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Title', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Description', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_button_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Button', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter' => [\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter_list' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}", "function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }", "function register_block_core_widget_group()\n {\n }", "function achtvier_beitraege_block_init() {\n\t// Skip block registration if Gutenberg is not enabled/merged.\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\treturn;\n\t}\n\t$dir = dirname( __FILE__ );\n\n\t$index_js = 'achtvier-beitraege/index.js';\n\twp_register_script(\n\t\t'achtvier-beitraege-block-editor',\n\t\tplugins_url( $index_js, __FILE__ ),\n\t\tarray(\n\t\t\t'wp-blocks',\n\t\t\t'wp-i18n',\n\t\t\t'wp-element',\n\t\t\t'wp-components',\n\t\t\t'wp-editor'\n\t\t),\n\t\tfilemtime( \"$dir/$index_js\" )\n\t);\n\n\t$editor_css = 'achtvier-beitraege/editor.css';\n\twp_register_style(\n\t\t'achtvier-beitraege-block-editor',\n\t\tplugins_url( $editor_css, __FILE__ ),\n\t\tarray(),\n\t\tfilemtime( \"$dir/$editor_css\" )\n\t);\n\n\t$style_css = 'achtvier-beitraege/style.css';\n\twp_register_style(\n\t\t'achtvier-beitraege-block',\n\t\tplugins_url( $style_css, __FILE__ ),\n\t\tarray(),\n\t\tfilemtime( \"$dir/$style_css\" )\n\t);\n\n\tregister_block_type( 'achtvier-blocks/achtvier-beitraege', array(\n\t\t'editor_script' => 'achtvier-beitraege-block-editor',\n\t\t'editor_style' => 'achtvier-beitraege-block-editor',\n\t\t'style' => 'achtvier-beitraege-block',\n\t\t'attributes' => array(\n\t'categories' => array(\n\t\t'type' => 'string',\n\t),\n\t'className' => array(\n\t\t'type' => 'string',\n\t),\n\t'postsToShow' => array(\n\t\t'type' => 'number',\n\t\t'default' => 5,\n\t),\n\t'displayPostDate' => array(\n\t\t'type' => 'boolean',\n\t\t'default' => false,\n\t),\n 'teaserLength' => array(\n\t\t'type' => 'number',\n\t\t'default' => 70,\n\t),\t\n\t'order' => array(\n\t\t'type' => 'string',\n\t\t'default' => 'desc',\n\t),\n\t'orderBy' => array(\n\t\t'type' => 'string',\n\t\t'default' => 'date',\n\t),\n),\n'render_callback' => 'render_achtvier_beitraege',\n\t) );\n}", "function portal_dashboard_calendar_widget() {\n\n\techo portal_output_project_calendar();\n\n}", "function action_init()\n\t{\n\n\t\t$this->allblocks = array(\n\t\t\t'recent_comments' => _t( 'Recent Comments' ),\n\t\t\t'recent_posts' => _t( 'Recent Posts' ),\n\t\t\t'monthly_archives' => _t( 'Monthly Archives' ),\n\t\t\t'tag_archives' => _t( 'Tag Archives' ),\n\t\t\t'meta_links' => _t( 'Meta Links' ),\n\t\t\t'search_form' => _t( 'Search Form' ),\n\t\t\t'text' => _t( 'Text' ),\n\t\t);\n\n\t\tforeach ( array_keys( $this->allblocks ) as $blockname ) {\n\t\t\t$this->add_template( \"block.$blockname\", dirname( __FILE__ ) . \"/block.$blockname.php\" );\n\t\t}\n\t\t$this->add_template( \"block.dropdown.tag_archives\", dirname( __FILE__ ) . \"/block.dropdown.tag_archives.php\" );\n\t\t$this->add_template( \"block.dropdown.monthly_archives\", dirname( __FILE__ ) . \"/block.dropdown.monthly_archives.php\" );\n\t}", "function enqueue_fullcalendar() {\n wp_enqueue_style ( 'fullcalendar-main-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.css' );\n wp_enqueue_style ( 'fullcalendar-daygrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-timegrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-list-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.css' );\n\n wp_enqueue_script ( 'fullcalendar-main-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.js' );\n wp_enqueue_script ( 'fullcalendar-interaction-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/interaction/main.js' );\n wp_enqueue_script ( 'fullcalendar-daygrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-timegrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-list-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.js' );\n}", "function render_block_core_post_date($attributes, $content, $block)\n {\n }", "function output_calendar() // Generating calendar HTML content\r\n\t{\r\n\t\t# Apparently, it's not possible to dereference $this->callback()\r\n\t\t$cb = $this->callback;\r\n\r\n\t\t# Preliminary calculations\r\n\t\t$t = getdate(strtotime($this->date));\r\n\t\t$today = $t[\"mday\"];\r\n\t\t$year = $t[\"year\"];\r\n\t\t$month = $t[\"mon\"];\r\n\t\t# Get first day of the month (monday = 0)\r\n\t\t$first_wday = ((int) date(\"w\", mktime(0, 0, 0, $month, 1, $year))+6)%7;\r\n\t\t# Last day of the month\r\n\t\t$last_mday = (int) date(\"d\", mktime(0, 0, 0, $month+1, 0, $year));\r\n\r\n\t\t# Anchor\r\n\t\t//$this->content[].=\"<a name=\\\"calendar\\\">\";\r\n\r\n\t\t# Table\r\n\t\t$this->content[].=\"<table width=\\\"100%\\\" align=\\\"center\\\" cellpadding=\\\"0\\\" cellspacing=\\\"2\\\" class=\\\"calendar\\\">\\n\";\r\n\r\n\t\t# Table head\r\n\t\t$this->content[].=\"<tr><td colspan=\\\"7\\\" class=\\\"calendar_header\\\">{$this->month_name[$month - 1]}&nbsp;&nbsp;&nbsp;{$t['year']}</td></tr>\\n<tr>\\n\";\r\n\t\tfor ($j = 0;$j <= 6;$j++) {\r\n\t\t\t$this->content[].=\"<th class=\\\"calendar_title\\\">\";\r\n\t\t\t$this->content[].=\"{$this->day_name[$j]}\";\r\n\t\t\t$this->content[].=\"</th>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</tr>\\n\";\r\n\r\n\t\t// Day row\r\n\t\t// A month is displayed on 6 rows\r\n\t\t// except for a 28 days month starting on Monday\r\n\t\tif (($last_mday == 28) and ($first_wday == 0))\r\n\t\t$jmax = 27;\r\n\t\telse\r\n\t\t$jmax = 41;\r\n\r\n\t\tfor ($j = 0;$j <= $jmax;$j++) {\r\n\t\t\t# Start new row on Monday\r\n\t\t\tif ($j % 7 == 0)\r\n\t\t\t$this->content[].=\"<tr>\\n\";\r\n\r\n\t\t\t// Title colour for current day and checking week end days\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 == 6)) // if today and weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title_we\\\">\";\r\n\r\n\t\t\tif (($j % 7 == 6) and ($j != $today+$first_wday-1)) // if weekend day and not today\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day_we\\\">\";\r\n\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 != 6)) // if today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title\\\">\";\r\n\r\n\t\t\tif (($j % 7 != 6) and ($j != $today+$first_wday-1)) // if not today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day\\\">\";\r\n\r\n\t\t\tif (($j<$first_wday) or ($j>=$last_mday + $first_wday)) {\r\n\r\n\t\t\t\t# Empty boxes\r\n\t\t\t\t$this->content[].=\"&nbsp;\";\r\n\t\t\t} else {\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\techo $cb(mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\t$this->content[].=date($this->date_format, mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\t$this->content[].=\"</a>\\n\";\r\n\t\t\t}\r\n\t\t\t$this->content[].=\"</td>\\n\";\r\n\r\n\t\t\t# End of row on Sunday\r\n\t\t\tif ($j % 7 == 6)\r\n\t\t\t$this->content[].=\"</tr>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</table>\\n\";\r\n\t}", "function academic_calendar(){\n $data['content_page']='admin/academic_calendar';\n $this->load->view('common/base_template',$data);\n }", "public function action_init_theme()\n\t{\n\t\t$this->add_template('block.photoset_randomphotos', dirname(__FILE__) . '/block.photoset_randomphotos.php');\n\t\t$this->add_template('block.singlepage_content', dirname(__FILE__) . '/block.singlepage_content.php');\n\t\t\n\t\tFormat::apply('autop', 'comment_content_out');\n\t\tFormat::apply('autop', 'post_content_excerpt');\n\t\t\n\t\t$this->assign( 'multipleview', false);\n\t\t$action = Controller::get_action();\n\t\tif ($action == 'display_home' || $action == 'display_entries' || $action == 'search' || $action == 'display_tag' || $action == 'display_date') {\n\t\t\t$this->assign('multipleview', true);\n\t\t}\n\t}", "function _wp_block_theme_register_classic_sidebars()\n {\n }", "function anipics_add_widget_area(){\n register_sidebar(array(\n 'id' => 'projet',\n 'name' => 'Photo gallery',\n 'description' => ' Apparait au centre',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer',\n 'name' => 'footer',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s4\" style=\"margin: 0 18em 0 3em \" >',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer2',\n 'name' => 'footer2',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s6\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "public function index()\n {\n $this->view('calendar');\n }", "public function register_cpt_blocks() {\n /* Include CPT creation file */\n //include_once( ILIO_BLOCKS_INCLUDES_DIR . '/blockss.post-type.php' );\n }", "function blocks_scripts() {\n\n\twp_enqueue_script(\n\t\t'blocks',\n\t\tTENUP_SCAFFOLD_TEMPLATE_URL . '/dist/js/blocks.js',\n\t\t[],\n\t\tTENUP_SCAFFOLD_VERSION,\n\t\ttrue\n\t);\n}", "function portal_return_calendar_template() {\n\treturn portal_template_hierarchy( 'dashboard/components/calendar/index.php' );\n}", "public function setSections() {\n // Background Patterns Reader\n $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';\n $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';\n $sample_patterns = array();\n\n if ( is_dir( $sample_patterns_path ) ) :\n\n if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :\n $sample_patterns = array();\n\n while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {\n\n if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {\n $name = explode( '.', $sample_patterns_file );\n $name = str_replace( '.' . end( $name ), '', $sample_patterns_file );\n $sample_patterns[] = array(\n 'alt' => $name,\n 'img' => $sample_patterns_url . $sample_patterns_file\n );\n }\n }\n endif;\n endif;\n\n ob_start();\n\n $ct = wp_get_theme();\n $this->theme = $ct;\n $item_name = $this->theme->get( 'Name' );\n $tags = $this->theme->Tags;\n $screenshot = $this->theme->get_screenshot();\n $class = $screenshot ? 'has-screenshot' : '';\n\n $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;', 'slova' ), $this->theme->display( 'Name' ) );\n\n ?>\n <div id=\"current-theme\" class=\"<?php echo esc_attr( $class ); ?>\">\n <?php if ( $screenshot ) : ?>\n <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>\n <a href=\"<?php echo wp_customize_url(); ?>\" class=\"load-customize hide-if-no-customize\"\n title=\"<?php echo esc_attr( $customize_title ); ?>\">\n <img src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'slova' ); ?>\"/>\n </a>\n <?php endif; ?>\n <img class=\"hide-if-customize\" src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'slova' ); ?>\"/>\n <?php endif; ?>\n\n <h4><?php echo esc_html( $this->theme->display( 'Name' ) ); ?></h4>\n\n <div>\n <ul class=\"theme-info\">\n <li><?php printf( __( 'By %s', 'slova' ), $this->theme->display( 'Author' ) ); ?></li>\n <li><?php printf( __( 'Version %s', 'slova' ), $this->theme->display( 'Version' ) ); ?></li>\n <li><?php echo '<strong>' . __( 'Tags', 'slova' ) . ':</strong> '; ?><?php printf( $this->theme->display( 'Tags' ) ); ?></li>\n </ul>\n <p class=\"theme-description\"><?php echo esc_html( $this->theme->display( 'Description' ) ); ?></p>\n <?php\n if ( $this->theme->parent() ) {\n printf( ' <p class=\"howto\">' . __( 'This <a href=\"%1$s\">child theme</a> requires its parent theme, %2$s.', 'slova' ) . '</p>', __( 'http://codex.wordpress.org/Child_Themes', 'slova' ), $this->theme->parent()->display( 'Name' ) );\n }\n ?>\n\n </div>\n </div>\n\n <?php\n $item_info = ob_get_contents();\n\n ob_end_clean();\n\n $sampleHTML = '';\n if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {\n Redux_Functions::initWpFilesystem();\n\n global $wp_filesystem;\n\n $sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );\n }\n\t\t\t\t\n\t\t\t\t$of_options_fontsize = array(\"8px\" => \"8px\", \"9px\" => \"9px\", \"10px\" => \"10px\", \"11px\" => \"11px\", \"12px\" => \"12px\", \"13px\" => \"13px\", \"14px\" => \"14px\", \"15px\" => \"15px\", \"16px\" => \"16px\", \"17px\" => \"17px\", \"18px\" => \"18px\", \"19px\" => \"19px\", \"20px\" => \"20px\", \"21px\" => \"21px\", \"22px\" => \"22px\", \"23px\" => \"23px\", \"24px\" => \"24px\", \"25px\" => \"25px\", \"26px\" => \"26px\", \"27px\" => \"27px\", \"28px\" => \"28px\", \"29px\" => \"29px\", \"30px\" => \"30px\", \"31px\" => \"31px\", \"32px\" => \"32px\", \"33px\" => \"33px\", \"34px\" => \"34px\", \"35px\" => \"35px\", \"36px\" => \"36px\", \"37px\" => \"37px\", \"38px\" => \"38px\", \"39px\" => \"39px\", \"40px\" => \"40px\");\n\t\t\t\t$of_options_font = array(\"1\" => \"Google Font\", \"2\" => \"Standard Font\", \"3\" => \"Custom Font\");\n\t\t\t\t\n\t\t\t\t//Google font API\n\t\t\t\t$of_options_google_font = array();\n\t\t\t\tif (is_admin()) {\n\t\t\t\t\t$results = '';\n\t\t\t\t\t$whitelist = array('127.0.0.1','::1');\n\t\t\t\t\tif(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){\n\t\t\t\t\t\t$results = wp_remote_get('https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyDnf-ujK_DUCihfvzqdlBokan6zbnrJbi0');\n\t\t\t\t\t\tif (!is_wp_error($results)) {\n\t\t\t\t\t\t\t\t$results = json_decode($results['body']);\n\t\t\t\t\t\t\t\tif(isset($results->items)){\n\t\t\t\t\t\t\t\t\tforeach ($results->items as $font) {\n\t\t\t\t\t\t\t\t\t\t$of_options_google_font[$font->family] = $font->family;\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}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Standard Fonts\n\t\t\t\t$of_options_standard_fonts = array(\n\t\t\t\t\t'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',\n\t\t\t\t\t\"'Arial Black', Gadget, sans-serif\" => \"'Arial Black', Gadget, sans-serif\",\n\t\t\t\t\t\"'Bookman Old Style', serif\" => \"'Bookman Old Style', serif\",\n\t\t\t\t\t\"'Comic Sans MS', cursive\" => \"'Comic Sans MS', cursive\",\n\t\t\t\t\t\"Courier, monospace\" => \"Courier, monospace\",\n\t\t\t\t\t\"Garamond, serif\" => \"Garamond, serif\",\n\t\t\t\t\t\"Georgia, serif\" => \"Georgia, serif\",\n\t\t\t\t\t\"Impact, Charcoal, sans-serif\" => \"Impact, Charcoal, sans-serif\",\n\t\t\t\t\t\"'Lucida Console', Monaco, monospace\" => \"'Lucida Console', Monaco, monospace\",\n\t\t\t\t\t\"'Lucida Sans Unicode', 'Lucida Grande', sans-serif\" => \"'Lucida Sans Unicode', 'Lucida Grande', sans-serif\",\n\t\t\t\t\t\"'MS Sans Serif', Geneva, sans-serif\" => \"'MS Sans Serif', Geneva, sans-serif\",\n\t\t\t\t\t\"'MS Serif', 'New York', sans-serif\" => \"'MS Serif', 'New York', sans-serif\",\n\t\t\t\t\t\"'Palatino Linotype', 'Book Antiqua', Palatino, serif\" => \"'Palatino Linotype', 'Book Antiqua', Palatino, serif\",\n\t\t\t\t\t\"Tahoma, Geneva, sans-serif\" => \"Tahoma, Geneva, sans-serif\",\n\t\t\t\t\t\"'Times New Roman', Times, serif\" => \"'Times New Roman', Times, serif\",\n\t\t\t\t\t\"'Trebuchet MS', Helvetica, sans-serif\" => \"'Trebuchet MS', Helvetica, sans-serif\",\n\t\t\t\t\t\"Verdana, Geneva, sans-serif\" => \"Verdana, Geneva, sans-serif\"\n\t\t\t\t);\n\t\t\t\t// Custom Font\n\t\t\t\t$fonts = array();\n\t\t\t\t$of_options_custom_fonts = array();\n\t\t\t\t$font_path = get_template_directory() . \"/fonts\";\n\t\t\t\tif (!$handle = opendir($font_path)) {\n\t\t\t\t\t$fonts = array();\n\t\t\t\t} else {\n\t\t\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\t\t\tif (strpos($file, \".ttf\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".eot\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".svg\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".woff\") !== false\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$fonts[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($handle);\n\n\t\t\t\tforeach ($fonts as $font) {\n\t\t\t\t\t$font_name = str_replace(array('.ttf', '.eot', '.svg', '.woff'), '', $font);\n\t\t\t\t\t$of_options_custom_fonts[$font_name] = $font_name;\n\t\t\t\t}\n\t\t\t\t/* remove dup item */\n\t\t\t\t$of_options_custom_fonts = array_unique($of_options_custom_fonts);\n\t\t\t\t\n\t\t\t\t/*Sidebar option*/\n\t\t\t\t$of_options_sidebar = array(\"Main Sidebar\" => \"Main Sidebar\", \"Blog Left Sidebar\" => \"Blog Left Sidebar\", \"Blog Right Sidebar\" => \"Blog Right Sidebar\", \"Custom Sidebar 1\" => \"Custom Sidebar 1\", \"Custom Sidebar 2\" => \"Custom Sidebar 2\", \"Custom Sidebar 3\" => \"Custom Sidebar 3\", \"Custom Sidebar 4\" => \"Custom Sidebar 4\");\n\t\t\t\t\n\t\t\t\t/*General Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'General Setting', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-cogs',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n 'id' => 'tb_less',\n 'type' => 'switch',\n 'title' => __( 'Less Design', 'slova' ),\n 'subtitle' => __( 'Use the less design features.', 'slova' ),\n\t\t\t\t\t\t\t'default' => false,\n ),\n array(\n 'id' => 'tb_smoothscroll',\n 'type' => 'switch',\n 'title' => __( 'Smoothscroll', 'slova' ),\n 'subtitle' => __( 'Use the smoothscroll in your site.', 'slova' ),\n 'default' => true,\n ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_background',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Body Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Body background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#ffffff',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Logo*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Logo', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-viadeo',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_favicon_image',\n\t\t\t\t\t\t\t'type' => 'media',\n\t\t\t\t\t\t\t'url' => true,\n\t\t\t\t\t\t\t'title' => __('Favicon Image', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select an image file for your favicon.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'url'\t=> URI_PATH.'/favicon.ico'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_logo_image',\n\t\t\t\t\t\t\t'type' => 'media',\n\t\t\t\t\t\t\t'url' => true,\n\t\t\t\t\t\t\t'title' => __('Logo Image', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select an image file for your logo.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'url'\t=> URI_PATH.'/assets/images/logo.png'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Header*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Header', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-file-edit',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_manage_location',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Manage Location', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select manage location of menu in this header.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'' => 'Auto Navigation',\n\t\t\t\t\t\t\t\t'main_navigation' => 'Main Navigation',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_stick_header',\n 'type' => 'switch',\n 'title' => __( 'Stick Header', 'slova' ),\n 'subtitle' => __( 'Enable a fixed header when scrolling.', 'slova' ),\n\t\t\t\t\t\t\t'default' => false,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Main Menu*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Main Menu', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-list',\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'First Level', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_first_level_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'letter-spacing' => true,\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#fff', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Roboto', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '16px', \n\t\t\t\t\t\t\t\t'line-height' => '90px',\n\t\t\t\t\t\t\t\t'letter-spacing' => '0.2px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_first_level_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '0px', \n\t\t\t\t\t\t\t\t'padding-right' => '15px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '0px', \n\t\t\t\t\t\t\t\t'padding-left' => '15px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Sub Level', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_sub_level_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'letter-spacing' => true,\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#fff', \n\t\t\t\t\t\t\t\t'font-style' => '400', \n\t\t\t\t\t\t\t\t'font-family' => 'Roboto', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '26.4px',\n\t\t\t\t\t\t\t\t'letter-spacing' => '0.2px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_sub_level_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '10px', \n\t\t\t\t\t\t\t\t'padding-right' => '10px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '10px', \n\t\t\t\t\t\t\t\t'padding-left' => '20px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Footer*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-file-edit',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer'),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer Top', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_margin',\n\t\t\t\t\t\t\t'title' => __('Margin', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '60px', \n\t\t\t\t\t\t\t\t'margin-right' => '0px', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0px', \n\t\t\t\t\t\t\t\t'margin-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '90px', \n\t\t\t\t\t\t\t\t'padding-right' => '0px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '60px', \n\t\t\t\t\t\t\t\t'padding-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_text_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Text Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the text color. (default: #EEEEEE).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#EEEEEE',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_heading_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Heading Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the headings color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#FFFFFF',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top h1,.ro-footer .ro-footer-top h2,.ro-footer .ro-footer-top h3,.ro-footer .ro-footer-top h4,.ro-footer .ro-footer-top h5,.ro-footer .ro-footer-top h6'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_link_color',\n\t\t\t\t\t\t\t'type' => 'link_color',\n\t\t\t\t\t\t\t'title' => __('Links Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the link color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'regular' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'hover' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'active' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'visited' => '#FFFFFF',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top a'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_column',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Footer Top Columns', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select column of footer top.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1' => '1 Column',\n\t\t\t\t\t\t\t\t'2' => '2 Columns',\n\t\t\t\t\t\t\t\t'3' => '3 Columns',\n\t\t\t\t\t\t\t\t'4' => '4 Columns'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '4',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col1',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 1', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','1')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col2',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 2', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','2')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col3',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 3', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','3')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col4',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 4', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','4')\n\t\t\t\t\t\t),\n\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer Bottom', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_margin',\n\t\t\t\t\t\t\t'title' => __('Margin', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '0px', \n\t\t\t\t\t\t\t\t'margin-right' => '0px', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0px', \n\t\t\t\t\t\t\t\t'margin-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '30px', \n\t\t\t\t\t\t\t\t'padding-right' => '0px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '30px', \n\t\t\t\t\t\t\t\t'padding-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_text_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Text Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the text color. (default: #EEEEEE).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#EEEEEE',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_heading_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Heading Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the headings color. (default: #CCCCCC).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#CCCCCC',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom h1,.ro-footer .ro-footer-bottom h2,.ro-footer .ro-footer-bottom h3,.ro-footer .ro-footer-bottom h4,.ro-footer .ro-footer-bottom h5,.ro-footer .ro-footer-bottom h6'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_link_color',\n\t\t\t\t\t\t\t'type' => 'link_color',\n\t\t\t\t\t\t\t'title' => __('Links Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the link color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'regular' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'hover' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'active' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'visited' => '#FFFFFF',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom a'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_column',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Columns', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select column of footer bottom.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1' => '1 Column',\n\t\t\t\t\t\t\t\t'2' => '2 Columns'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_col1',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Column 1', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-6 col-lg-6 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-6 col-lg-6',\n\t\t\t\t\t\t\t'required' => array('tb_footer_bottom_column','>=','1')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_col2',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Column 2', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-6 col-lg-6 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-6 col-lg-6',\n\t\t\t\t\t\t\t'required' => array('tb_footer_bottom_column','>=','2')\n\t\t\t\t\t\t),\n\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Styling Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Styling Options', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-tint',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_primary_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Primary Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls several items, ex: link hovers, highlights, and more. (default: #a360ff).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#a360ff',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_secondary_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Secondary Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls several items, ex: link hovers, highlights, and more. (default: #0084ff).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#0084ff',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Typography Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Typography', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-font',\n 'fields' => array(\n\t\t\t\t\t\t/*Body font*/\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_body_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Body Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '400',\n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '23px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h1_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H1 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h1, .ro-font-size-1'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '42px', \n\t\t\t\t\t\t\t\t'line-height' => '46.2px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h2_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H2 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h2, .ro-font-size-2'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '36px', \n\t\t\t\t\t\t\t\t'line-height' => '39.6px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h3_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H3 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h3, .ro-font-size-3'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '24px', \n\t\t\t\t\t\t\t\t'line-height' => '26.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h4_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H4 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h4, .ro-font-size-4'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '18px', \n\t\t\t\t\t\t\t\t'line-height' => '19.8px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h5_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H5 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h5, .ro-font-size-5'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '16px', \n\t\t\t\t\t\t\t\t'line-height' => '17.6px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h6_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H6 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h6, .ro-font-size-6'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '15.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_special_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Special Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('.ro-special-font'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#333', \n\t\t\t\t\t\t\t\t'font-style' => '400', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '13px', \n\t\t\t\t\t\t\t\t'line-height' => '15.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Title Bar Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Title Bar', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-livejournal',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Page Title Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#aaaaaa',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bar_margin',\n\t\t\t\t\t\t\t'title' => 'Page Title Margin',\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin of page title bar.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '0', \n\t\t\t\t\t\t\t\t'margin-right' => '0', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0', \n\t\t\t\t\t\t\t\t'margin-left' => '0',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bar_padding',\n\t\t\t\t\t\t\t'title' => 'Page Title Padding',\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding of page title bar.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '160px', \n\t\t\t\t\t\t\t\t'padding-right' => '0', \n\t\t\t\t\t\t\t\t'padding-bottom' => '20px', \n\t\t\t\t\t\t\t\t'padding-left' => '0',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Post Setting*/\n\t\t\t\t$this->sections[] = array(\n\t\t\t\t\t'title' => __( 'Post Setting', 'slova' ),\n\t\t\t\t\t'desc' => __( '', 'slova' ),\n\t\t\t\t\t'icon' => 'el-icon-file-edit',\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Title Bar', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_title_bar_background',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'output' => array('.single .ro-section-title-bar, .archive .ro-section-title-bar, .search .ro-section-title-bar, .error404 .ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#ffffff',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_page_title',\n 'type' => 'switch',\n 'title' => __( 'Show Page Title', 'slova' ),\n 'subtitle' => __( 'Show page title in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_page_breadcrumb',\n 'type' => 'switch',\n 'title' => __( 'Show Page Breadcrumb', 'slova' ),\n 'subtitle' => __( 'Show page breadcrumb in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Blog Post', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t'id' => 'tb_blog_layout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'title' => __('Select Layout', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select layout of blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1col'\t=> array(\n\t\t\t\t\t\t\t\t\t\t'alt' => '1col',\n\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/1col.png'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cl'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cl',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cl.png'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cr'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cr',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cr.png'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2cr'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_left_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar left in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_left_sidebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_content_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Content Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-8 col-md-8 col-lg-8'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_right_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar right in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_right_siedebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_image',\n 'type' => 'switch',\n 'title' => __( 'Show Featured Image', 'slova' ),\n 'subtitle' => __( 'Show or not featured image of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_title',\n 'type' => 'switch',\n 'title' => __( 'Show Title', 'slova' ),\n 'subtitle' => __( 'Show or not title of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_meta',\n 'type' => 'switch',\n 'title' => __( 'Show Meta', 'slova' ),\n 'subtitle' => __( 'Show or not meta of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_excerpt',\n 'type' => 'switch',\n 'title' => __( 'Show Excerpt', 'slova' ),\n 'subtitle' => __( 'Show or not excerpt of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ), \n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_post_readmore_text',\n 'type' => 'text',\n 'title' => __( 'Read More Text', 'slova' ),\n 'subtitle' => __( 'Enter text of label button read more in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => 'Read more',\n ),\n\t\t\t\t\t) \n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Single Post', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t'id' => 'tb_post_layout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'title' => __('Select Layout', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select layout of single blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1col'\t=> array(\n\t\t\t\t\t\t\t\t\t\t'alt' => '1col',\n\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/1col.png'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cl'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cl',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cl.png'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cr'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cr',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cr.png'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2cr'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_left_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar left in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_post_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_left_sidebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Left Sidebar Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_post_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_content_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Content Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-8 col-md-8 col-lg-8',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_right_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar right in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_right_siedebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Right Sidebar Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_image',\n 'type' => 'switch',\n 'title' => __( 'Show Featured Image', 'slova' ),\n 'subtitle' => __( 'Show or not featured image of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_title',\n 'type' => 'switch',\n 'title' => __( 'Show Title', 'slova' ),\n 'subtitle' => __( 'Show or not title of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_meta',\n 'type' => 'switch',\n 'title' => __( 'Show Meta', 'slova' ),\n 'subtitle' => __( 'Show or not meta of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_desc',\n 'type' => 'switch',\n 'title' => __( 'Show Description', 'slova' ),\n 'subtitle' => __( 'Show or not description of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray( \n 'id' => 'tb_post_show_post_nav',\n 'type' => 'switch',\n 'title' => __( 'Show Navigation', 'slova' ),\n 'subtitle' => __( 'Show or not post navigation on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_tags',\n 'type' => 'switch',\n 'title' => __( 'Show Tags', 'slova' ),\n 'subtitle' => __( 'Show or not post tags on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_author',\n 'type' => 'switch',\n 'title' => __( 'Show Author', 'slova' ),\n 'subtitle' => __( 'Show or not post author on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_comment',\n 'type' => 'switch',\n 'title' => __( 'Show Comment', 'slova' ),\n 'subtitle' => __( 'Show or not post comment on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Page Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Page Setting', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-list-alt',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_title',\n 'type' => 'switch',\n 'title' => __( 'Show Page Title', 'slova' ),\n 'subtitle' => __( 'Show page title in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_breadcrumb',\n 'type' => 'switch',\n 'title' => __( 'Show Page Breadcrumb', 'slova' ),\n 'subtitle' => __( 'Show page breadcrumb in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_comment',\n 'type' => 'switch',\n 'title' => __( 'Show Page Comment', 'slova' ),\n 'subtitle' => __( 'Show or not page comment on your page.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n )\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Custom CSS*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Custom CSS', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-css',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'custom_css_code',\n\t\t\t\t\t\t\t'type' => 'ace_editor',\n\t\t\t\t\t\t\t'title' => __('Custom CSS Code', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Quickly add some CSS to your theme by adding it to this block..', 'slova'),\n\t\t\t\t\t\t\t'mode' => 'css',\n\t\t\t\t\t\t\t'theme' => 'monokai',\n\t\t\t\t\t\t\t'default' => '@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,500,700); @import url(https://fonts.googleapis.com/css?family=Raleway:400,300,600,700,500);'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Import / Export*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Import / Export', 'slova' ),\n 'desc' => __( 'Import and Export your Redux Framework settings from file, text or URL.', 'slova' ),\n 'icon' => 'el-icon-refresh',\n 'fields' => array(\n array(\n 'id' => 'tb_import_export',\n 'type' => 'import_export',\n 'title' => 'Import Export',\n 'subtitle' => 'Save and restore your Redux options',\n 'full_width' => false,\n ),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'id' => 'tb_import',\n\t\t\t\t\t\t\t'type' => 'js_button',\n\t\t\t\t\t\t\t'title' => 'Auto Setup.',\n\t\t\t\t\t\t\t'subtitle' => __('Tools > Content Demo Install.', 'slova'),\n\t\t\t\t\t\t),\n ),\n );\n\t\t\t\t\n }", "function register_blocks() {\t\n\n // Fail if block editor is not supported\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\treturn;\n\t}\n\n // List all of the blocks for your plugin\n $blocks = [\n \"antaresplugin/gallery\",\n ];\n\n // Register each block with same CSS and JS\n foreach( $blocks as $block ) {\n if( \"antaresplugin/gallery\" === $block ) { \n register_block_type( $block, [\n 'editor_script' => 'antares-plugin-editor-js',\n 'editor_style' => 'antares-plugin-editor-css',\n 'style' => 'antares-plugin-css',\n 'attributes' => [ \n 'images' => [\n 'type' => \"array\",\n 'default' => []\n ],\n 'direction' => [\n 'type'=> \"string\",\n 'default' => \"row\"\n ],\n 'isLightboxEnabled' => [\n 'type' => \"boolean\",\n 'default' => true\n ]\n ]\n ] );\t \n }\n else { \n register_block_type( $block, [\n 'editor_script' => 'antares-plugin-editor-js',\n 'editor_style' => 'antares-plugin-editor-css',\n 'style' => 'antares-plugin-css'\n ] );\t \n }\n }\n\n}", "function calendar_files()\n\t{\t\t\n\t\techo '\n\t\t\t\t<link type=\"text/css\" href=\"'.SITEPATH.'/administrator/calendar/themes/base/jquery.ui.all.css\" rel=\"stylesheet\" />\n\t\t\t\t<script type=\"text/javascript\" src=\"'.SITEPATH.'/administrator/calendar/jquery-1.4.2.js\"></script>\n\t\t\t\t<script type=\"text/javascript\" src=\"'.SITEPATH.'/administrator/calendar/ui/jquery.ui.core.js\"></script>\n\t\t\t\t<script type=\"text/javascript\" src=\"'.SITEPATH.'/administrator/calendar/ui/jquery.ui.widget.js\"></script>\n\t\t\t\t<script type=\"text/javascript\" src=\"'.SITEPATH.'/administrator/calendar/ui/jquery.ui.datepicker.js\"></script>\n\t\t\t\t<link type=\"text/css\" href=\"'.SITEPATH.'/administrator/calendar/demos.css\" rel=\"stylesheet\" />\n\t\t';\n\t}", "public function calendar()\n {\n return view('pages.calendar');\n }", "function emc_widgets_init() {\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Sidebar', 'emc' ),\r\n\t\t'id' => 'sidebar',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Header', 'emc' ),\r\n\t\t'id' => 'header',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Single View', 'emc' ),\r\n\t\t'id' => 'single',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Footer – Left', 'emc' ),\r\n\t\t'id' => 'footer-left',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Footer – Center', 'emc' ),\r\n\t\t'id' => 'footer-center',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Footer – Right', 'emc' ),\r\n\t\t'id' => 'footer-right',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n\tregister_sidebar( array(\r\n\t\t'name' => __( 'Ideas Page Sidebar', 'emc' ),\r\n\t\t'id' => 'ideas-page-sidebar',\r\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t'after_widget' => \"</aside>\",\r\n\t\t'before_title' => '<h1 class=\"widget-title\">',\r\n\t\t'after_title' => '</h1>',\r\n\t) );\r\n}", "protected function loadThemeBlocks()\n {\n $this->blocks = [];\n $blocksDirectory = new DirectoryIterator($this->getFolder() . '/blocks');\n foreach ($blocksDirectory as $entry) {\n if ($entry->isDir() && ! $entry->isDot()) {\n $blockSlug = $entry->getFilename();\n $block = new ThemeBlock($this, $blockSlug);\n $this->blocks[$blockSlug] = $block;\n }\n }\n }", "function theme_customisations_main() {\n\tnew Theme_Customisations();\n}", "function yellow_widgets_init() {\n\n\tregister_sidebar( array(\n\t 'name' => 'Sidebar',\n\t 'id' => 'sidebar',\n\t 'before_widget' => '<div class=\"media-body\">',\n\t 'after_widget' => '</div>',\n\t 'before_title' => '<div class=\"card-header\">',\n\t 'after_title' => '</div>',\n\t));\n\tregister_sidebar( array(\n\t\t'name' => 'Footer',\n\t\t'id' => 'footer',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t ));\n\t\n \n }", "function tribe_events_agenda_init () {\n\t\t\trequire_once( 'template-tags.php' );\n\t\t\trequire_once( 'tribe-events-agenda-template-class.php' );\n\n\t\t\t/* Add Hooks */\n\n\t\t\t// hook in to add the rewrite rules\n\t\t\tadd_action( 'generate_rewrite_rules', array ( $this, 'tribe_events_agenda_add_routes' ) );\n\n\t\t\t// specify the template class\n\t\t\tadd_filter( 'tribe_events_current_template_class', array ( $this, 'tribe_events_agenda_setup_template_class' ) );\n\n\t\t\t// load the proper template for agenda view\n\t\t\tadd_filter( 'tribe_events_current_view_template', array ( $this, 'tribe_events_agenda_setup_view_template' ) );\n\n\t\t\t// inject agenda view into events bar & (display) settings\n\t\t\tadd_filter( 'tribe-events-bar-views', array ( $this, 'tribe_events_agenda_setup_in_bar' ), 40, 1 );\n\n\t\t}", "function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}", "function darksnow_widgets_init() {\n\n\t\n\t\n\t\n}", "function gbteddybear_widgets_init() {\n\n\t/********************** Sidebars ***********************/\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Default Sidebar', 'gbteddybear' ),\n\t\t'id' => 'default',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Footer', 'gbteddybear' ),\n\t\t'id' => 'footer',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget span two equal-height %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h5 class=\"widget-title\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n\t/********************** Content ***********************/\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Homepage Content', 'gbteddybear' ),\n\t\t'id' => 'homepage_content',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget span one-third %2$s\">',\n\t\t'after_widget' => '</div></aside>',\n\t\t'before_title' => '<h5 class=\"widget-title text-center light-brown uppercase\">',\n\t\t'after_title' => '</h5><div class=\"inner equal-height\">',\n\t) );\n\n\n}", "function wprt_blog_entry_layout_blocks() {\n\n\t// Get layout blocks\n\t$blocks = wprt_get_mod( 'blog_entry_composer' );\n\n\t// If blocks are 100% empty return defaults\n\t$blocks = $blocks ? $blocks : 'title,meta,excerpt_content,readmore';\n\n\t// Convert blocks to array so we can loop through them\n\tif ( ! is_array( $blocks ) ) {\n\t\t$blocks = explode( ',', $blocks );\n\t}\n\n\t// Set block keys equal to vals\n\t$blocks = array_combine( $blocks, $blocks );\n\n\t// Return blocks\n\treturn $blocks;\n}", "function metabox_styles() {\n\n\t\tif ( isset( get_current_screen()->base ) && 'post' !== get_current_screen()->base ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( get_current_screen()->post_type ) && 'recurring_event' != get_current_screen()->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load styles\n\t\twp_register_style( 'be-events-calendar', BE_EVENTS_CALENDAR_URL . 'css/events-admin.css', array(), BE_EVENTS_CALENDAR_VERSION );\n\t\twp_enqueue_style( 'be-events-calendar' );\n\t}", "function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }", "public static function register_blocks()\n {\n if (function_exists('acf_register_block_type')):\n\n acf_register_block_type(array(\n 'name' => 'hero',\n 'title' => __('Hero'),\n 'render_template' => 'template-parts/blocks/hero/hero.php',\n 'category' => 'custom-blocks',\n 'icon' => 'admin-site',\n 'keywords' => array('hero', 'carousel'),\n 'supports' => array(\n 'align' => false,\n ),\n ));\n\n endif;\n }", "static function add_events_metaboxes() {\n \tadd_meta_box(\n \t\t'mindevents_calendar',\n \t\t'Calendar',\n \t\tarray('mindeventsAdmin', 'display_calendar_metabox' ),\n \t\t'events',\n \t\t'normal',\n \t\t'default'\n \t);\n\n add_meta_box(\n \t\t'mindevents_event_options',\n \t\t'Calendar Options',\n \t\tarray('mindeventsAdmin', 'display_event_options_metabox' ),\n \t\t'events',\n \t\t'side',\n \t\t'default'\n \t);\n\n }", "function MakeCalendarGrid(){\n //get our days\n $intMonthDays = cal_days_in_month(CAL_GREGORIAN, $this->intMonth, $this->intYear);\n $intDayCounter = 0;\n $arrMonthAttributes = array('colspan'=>'7');\n //make our parent calendar table\n $objCalendarParent = $this->objCalendar->AddChildNode($this->objCalendar->objHTML,'', 'table');\n //let's make our header\n $objHeaderRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n //establish our base attributes\n for($intWeekDay=0;$intWeekDay<7;$intWeekDay++){\n $strDay = date('l', strtotime(\"Sunday +{$intWeekDay} days\"));\n $this->objCalendar->AddChildNode($objHeaderRow,$strDay, 'th',array('class'=>'weekday'));\n }\n //get the starting date\n $intMonthStart = date('N', strtotime($this->intYear.'-'.$this->intMonth.'-1'));\n $intMonthStart++;\n //avoid empty rows\n if($intMonthStart == 8)\n $intMonthStart = 1;\n //make our days now\n for($intDay=1;$intDay<($intMonthDays + $intMonthStart);$intDay++){\n $arrDateAttributes = array('onclick'=>'SelectDay(this);');\n if($intDayCounter === 0){\n //make our new week\n $objWeekRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n $arrDateAttributes['class'] = 'calendarday weekend';\n }\n else if($intDayCounter === 6)\n $arrDateAttributes['class'] = 'calendarday weekend';\n else if($intDay == date('j'))\n $arrDateAttributes['class'] = 'calendarday today';\n else\n $arrDateAttributes['class'] = 'calendarday weekday';\n $intDayCounter++;\n //reset our week now\n if($intDayCounter == 7)\n $intDayCounter = 0;\n if($intDay < $intMonthStart){\n unset($arrDateAttributes['onclick']);\n $this->objCalendar->AddChildNode($objWeekRow,'&nbsp;', 'td',$arrDateAttributes);\n continue 1;\n }\n $arrDateAttributes['id'] = ($intDay - ($intMonthStart - 1)).'-'.$this->arrCalendarProperties['calendarid'];\n //make our day now\n $this->objCalendar->AddChildNode($objWeekRow,($intDay - ($intMonthStart - 1)), 'td',$arrDateAttributes);\n }\n return TRUE;\n }", "public function calendar()\n {\n return view('calendar');\n }", "function calendar_enqueue_styles() {\n\tif ( is_page(4519) || is_page(4738) ) {\t \n\t\twp_enqueue_style( 'vmg-calendar-style', get_stylesheet_directory_uri() . '/style-calendar.css');\n wp_enqueue_script( 'vmg-calendar-script', get_stylesheet_directory_uri() . '/calendar-js.js', false, true );\n\t}\n}", "function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Widget oben rechts',\n 'id' => 'widget_top_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget mitte rechts',\n 'id' => 'widget_center_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget unten rechts',\n 'id' => 'widget_bottom_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Newsletter Widget',\n 'id' => 'newsletter_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Custom Footer Widget',\n 'id' => 'footer_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n\n}", "function rst_manage_seats_moncalender()\n{\n require_once('inc/inc.fullcalendar.php');\n}", "function generate_category_content()\n {\n global $conf, $page;\n\n $view_type = $page['chronology_view'];\n if ($view_type==CAL_VIEW_CALENDAR)\n {\n global $template;\n $tpl_var = array();\n if ( count($page['chronology_date'])==0 )\n {//case A: no year given - display all years+months\n if ($this->build_global_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==1 )\n {//case B: year given - display all days in given year\n if ($this->build_year_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n $this->build_nav_bar(CYEAR); // years\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==2 )\n {//case C: year+month given - display a nice month calendar\n if ( $this->build_month_calendar($tpl_var) )\n {\n $template->assign('chronology_calendar', $tpl_var);\n }\n $this->build_next_prev();\n return true;\n }\n }\n\n if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)\n {\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1)\n {\n $this->build_nav_bar(CMONTH); // month\n }\n if ( count($page['chronology_date'])==2 )\n {\n $day_labels = range( 1, $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR] ,$page['chronology_date'][CMONTH] ) );\n array_unshift($day_labels, 0);\n unset( $day_labels[0] );\n $this->build_nav_bar( CDAY, $day_labels ); // days\n }\n $this->build_next_prev();\n }\n return false;\n }", "public function initContent()\n {\n Hook::exec('displayFooter');\n parent::initContent();\n $this->addJS(_THEME_JS_DIR_.'index.js');\n $this->addJS(_THEME_JS_DIR_.'ckplayer/ckplayer.min.js');\n if($this->context->shop->theme_name=='uniwigs2016-m'){\n $this->removeJS(array(\n '/js/jquery/plugins/fancybox/jquery.fancybox.js',\n '/js/jquery/plugins/jquery.scrollTo.js',\n '/themes/uniwigs2016-m/js/autoload/15-jquery.uniform-modified.js',\n '/themes/uniwigs2016-m/js/modules/blockwishlist/js/ajax-wishlist.js',\n '/themes/uniwigs2016-m/js/modules/blockcart/ajax-cart.js',\n ));\n $this->addCSS(_THEME_MOBILE_CSS_DIR_.'qietu.css');\n $this->addCSS(_THEME_MOBILE_CSS_DIR_.'style.css');\n }\n if($this->context->shop->theme_name=='uniwigs2016'){\n $this->removeJS(array(\n '/js/jquery/plugins/fancybox/jquery.fancybox.js',\n '/js/jquery/plugins/jquery.scrollTo.js',\n '/themes/uniwigs2016/js/autoload/15-jquery.uniform-modified.js',\n '/themes/uniwigs2016/js/modules/blockwishlist/js/ajax-wishlist.js'\n ));\n $this->removeCSS(array(\n '/js/jquery/plugins/fancybox/jquery.fancybox.css',\n '/themes/uniwigs2016/css/autoload/uniform.default.css',\n '/themes/uniwigs2016/css/modules/blockwishlist/blockwishlist.css',\n ));\n $this->addCSS(_THEME_CSS_DIR_.'index.css');\n }\n $this->context->smarty->assign(array(\n 'HOOK_HOME' => Hook::exec('displayHome'),\n 'HOOK_HOME_TAB' => Hook::exec('displayTopColumn'),\n 'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayTop'),\n ));\n $this->setTemplate(_PS_THEME_DIR_.'index.tpl');\n }", "public static function createCalendarScript() {\r\n\t\t?>\r\n\t\t<script>\r\n\t\tjQuery(document).ready(function($) {\r\n\t\t\t\"use strict\";\r\n\r\n\t\t\tvar datepickerSettings = {\r\n\t\t\t\t\tdateFormat: 'yy-mm-dd',\r\n\r\n\t\t\t\t\tbeforeShow: function(input, inst) {\r\n\t\t\t\t\t\t$('#ui-datepicker-div').addClass('tf-date-datepicker');\r\n\r\n\t\t\t\t\t\t// Fix the button styles\r\n\t\t\t\t\t\tsetTimeout( function() {\r\n\t\t\t\t\t\t\tjQuery('#ui-datepicker-div')\r\n\t\t\t\t\t\t\t.find('[type=button]').addClass('button').end()\r\n\t\t\t\t\t\t\t.find('.ui-datepicker-close[type=button]').addClass('button-primary');\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t},\r\n\r\n\t\t\t\t\t// Fix the button styles\r\n\t\t\t\t\tonChangeMonthYear: function() {\r\n\t\t\t\t\t\tsetTimeout( function() {\r\n\t\t\t\t\t\t\tjQuery('#ui-datepicker-div')\r\n\t\t\t\t\t\t\t.find('[type=button]').addClass('button').end()\r\n\t\t\t\t\t\t\t.find('.ui-datepicker-close[type=button]').addClass('button-primary');\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t$('.tf-date input[type=text]').each(function() {\r\n\t\t\t\tvar $this = $(this);\r\n\t\t\t\tif ( $this.hasClass('date') && ! $this.hasClass('time') ) {\r\n\t\t\t\t\t$this.datepicker( datepickerSettings );\r\n\t\t\t\t} else if ( ! $this.hasClass('date') && $this.hasClass('time') ) {\r\n\t\t\t\t\t$this.timepicker( datepickerSettings );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this.datetimepicker( datepickerSettings );\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\n\t}", "public function register_blocks() {\n\t\t}", "public function calendarIndex()\n {\n return view('calendar');\n }", "function ticketmaster_register_block() {\n\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\t// Gutenberg is not active.\n\t\treturn;\n\t}\n\n\twp_register_script(\n\t\t'ticketmaster',\n\t\tplugins_url( 'build/index.js', __FILE__ ),\n\t\tarray( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components'),\n\t\tfilemtime( plugin_dir_path( __FILE__ ) . 'block.js' )\n\t);\n\n register_block_type('ticketmaster/event-listing', [\n 'editor_script' => 'ticketmaster',\n 'attributes' => [\n 'term' => [\n 'type' => 'string',\n 'default' => 'Concert'\n ],\n 'size' => [\n 'type' => 'number',\n 'default' => 8\n ],\n ],\n 'render_callback' => render_nova_directive('EventListing'),\n ]);\n}", "function metabox_scripts() {\n\n\t\tif ( isset( get_current_screen()->base ) && 'post' !== get_current_screen()->base ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( get_current_screen()->post_type ) && 'recurring_event' != get_current_screen()->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load scripts.\n\t\twp_register_script( 'be-events-calendar', BE_EVENTS_CALENDAR_URL . 'js/events-admin.js', array(\n\t\t\t'jquery',\n\t\t\t'jquery-ui-core',\n\t\t\t'jquery-ui-datepicker',\n\t\t), BE_EVENTS_CALENDAR_VERSION, true );\n\t\twp_enqueue_script( 'be-events-calendar' );\n\n\t\t$l18n_data['dateFormat'] = apply_filters( 'be_event_set_dmy_format', false ) ? 'dd/mm/yy' : 'mm/dd/yy';\n\n\t\twp_localize_script( 'be-events-calendar', 'beEventsCalendar', $l18n_data );\n\t}", "function calendar($url,$class='') {\n\n\tglobal $width;\n\tglobal $cell_width;\n\tglobal $legend_height;\n\tglobal $entry_color;\n\tglobal $entry_background_color;\n\tglobal $today_color;\n\tglobal $today_background_color;\n\tglobal $l_calendar;\n\tglobal $blog_script;\n\tglobal $lang;\n\tglobal $mysql_table;\n\t\n\tif ($_GET['date'] != '') {\n\t\t$MyDate = intval($_GET['date']);\n\t\t$year = substr($MyDate,0,4);\n\t\t$month = substr($MyDate,4,-2);\n\t} else {\n\t\t$month = date(\"n\");\n\t\t$year = date(\"Y\");\n\t}\n\t\n\t$prev = $month - 1;\n\t$next = $month + 1;\n\t$yearP = $year;\n\t$yearN = $year;\n\tif ($prev == \"0\") { $yearP--; $prev = \"12\"; }\n\tif ($prev < 10) $prev = '0'.$prev;\n\tif ($next == \"13\") { $yearN++; $next = \"1\"; }\n\tif ($next < 10) $next = '0'.$next;\n\n\t$transform_month = array(\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\");\n\t$into_month = array('Janvier','F&eacute;vrier','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','D&eacute;cembre');\n\t\n\tfor ($l = 0; $l < 12; $l++) {\n\t\tif ($month == $transform_month[$l]) {\n\t\t\t$month_word = $into_month[$l];\n\t\t}\n\t}\n\n\t$output .= '<table style=\"width: '.$width.'; height: '.$legend_height.'\" class=\"'.$class.'\">\n\t<tr>\n\t\t<!--<td style=\"width: 10%; text-align: left;\"><a href=\"'.$url.'&date='.$yearP.$prev.'00\">&laquo;</a></td>-->\n\t\t<td colspan=\"7\"><b>'.strtoupper($month_word).' '.$year.'</b></td>\n\t\t<!--<td style=\"width: 10%; text-align: right;\"><a href=\"'.$url.'&date='.$yearN.$next.'00\">&raquo;</a></td>-->\n\t</tr>\n\t<tr align=\"center\">\n\t\t<td><b>L</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>J</b></td>\n\t\t<td><b>V</b></td>\n\t\t<td><b>S</b></td>\n\t\t<td><b>D</b></td>\n\t</tr>\n\t<tr align=\"center\">';\n\t\n\t$no_days = date(\"t\", mktime(0, 0, 0, $month, 1, $year));\n\t$first_day = date(\"w\", mktime(0, 0, 0, $month, 1, $year));\n\t$today_day = date(\"j\");\n\t$today_month = date(\"n\");\n\t$today_year = date(\"Y\");\n\t\n\tif ($first_day == \"0\") $first_day = \"7\";\n\t\n\tfor ($i = 0; $i < $first_day-1; $i++) $output .= '<td style=\"width:'.$cell_width.';\">&nbsp;</td>';\n\n\tfor ($i = 1; $i <= $no_days; $i++) {\n\t\t//$result = mysql_query(\"SELECT id FROM blog WHERE DAYOFMONTH(timestamp)='$i' AND MONTH(timestamp) = '$month' AND YEAR(timestamp) = '$year' ORDER BY id DESC;\");\n\t\t$selectDate = $year.$month.($i<10?'0'.$i:$i);\n\t\t$result = mysql_query(\"SELECT id FROM blog WHERE datepubli='$selectDate' LIMIT 1 \");\n\t\t$num = mysql_num_rows($result);\n\t\t//$res = mysql_fetch_array($result);\n\t\n\t\tif ($first_day == \"8\") { $first_day = \"1\"; $output .= '<tr style=\"width: '.$width.';\" align=\"center\">'; }\n\t\tif ($i < 10) $space = ' '; else $space = '';\n\t\n\t\tif ($i == $today_day && $month == $today_month && $year == $today_year) \n\t\t\t$style = 'background-color: '.$today_background_color.'; color: '.$today_color.'; font-weight: bold;';\n\t\telse $style = '';\n\t\tif (intval($_GET['date']) == $selectDate) $style .= 'border:1px solid #000000;';\n\t\t\n\t\tif ($num < 1) $output .= '<td style=\"'.$style.' width: '.$cell_width.';\">'.$i.'</td>';\n\t\telse $output .= '<td style=\"background-color:'.$entry_background_color.';'.$style.'width: '.$cell_width.';color: '.$entry_color.';\"><a href=\"'.$url.'&date='.$selectDate.'\" style=\"color: '.$today_color.'\" title=\"Voir le sujet posté à cette date\">'.$i.'</a></td>';\n\t\t\n\t\tif ($first_day == \"7\") $output .= '</tr>';\n\t\t$first_day++;\n\t}\n\t\n\t$output .= '</table>';\n\t\n\treturn $output;\n\n}", "function ccac_2020_new_widgets_init() {\n /* Pinegrow generated Register Sidebars Begin */\n\n /* Pinegrow generated Register Sidebars End */\n}", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}", "public function create_widgets () {\n wp_enqueue_style( 'wedevs-latest-post-style' );\n\n add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widgets' ] );\n }", "public function setDefaultDesignTheme();", "function register_understrap_gutenberg_blocks() {\n\n // Register our block script with WordPress\n wp_enqueue_script(\n 'understrap-blocks',\n plugins_url('/blocks/dist/blocks.build.js', __FILE__),\n array('wp-blocks', 'wp-edit-post')\n );\n \n // Register our block's editor-specific CSS\n wp_enqueue_style(\n 'gutenberg-card-block-edit-style',\n plugins_url('/blocks/dist/blocks.editor.build.css', __FILE__),\n array( 'wp-edit-blocks' )\n );\n\n // Register our block's webfonts\n/* wp_enqueue_style(\n 'gutenberg-card-block-font-style',\n 'https://fonts.googleapis.com/css?family=Karla:400,700',\n array( 'wp-edit-blocks' )\n );\n*/\n\n}", "public function eventRmcommonDashboardRightWidgets(){\n global $xtAssembler, $xtFunctions;\n\n if (!isset($GLOBALS['xtAssembler']))\n $xtAssembler = new XtAssembler();\n\n if ( !$xtAssembler->isSupported() )\n return;\n\n $theme = $xtAssembler->theme();\n\n RMTemplate::get()->add_style('rmc-dashboard.css', 'xthemes');\n\n ?>\n <div class=\"cu-box\">\n <div class=\"box-header\">\n <span class=\"fa fa-caret-up box-handler\"></span>\n <h3><?php _e('Appearance','rmcommon'); ?></h3>\n </div>\n <div class=\"box-content collapsable\" id=\"xthemes-options\">\n <img src=\"<?php echo XOOPS_THEME_URL; ?>/<?php echo $theme->getInfo('dir'); ?>/<?php echo $theme->getInfo('screenshot'); ?>\" class=\"img-thumbnail\">\n <ul class=\"nav nav-pills nav-justified nav-options\">\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/themes.php\" title=\"<?php _e('Manage Themes', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-th-large\"></span>\n </a>\n </li>\n <?php if(method_exists($theme, 'controlPanel')): ?>\n <li>\n <a rel=\"tooltip\" href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/theme.php\" title=\"<?php echo sprintf(__('%s Control Panel', 'xthemes'), $theme->getInfo('name')); ?>\">\n <span class=\"fa fa-dashboard\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($xtAssembler->rootMenus()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/navigation.php\" title=\"<?php _e('Menu Maker', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-bars\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($theme->options()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/settings.php\" title=\"<?php _E('Theme Settings', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-wrench\"></span>\n </a>\n </li>\n <?php endif; ?>\n </ul>\n <small><?php echo $theme->getInfo('description'); ?></small>\n <?php if( $theme->getInfo('social') ): ?>\n <hr>\n <ul class=\"nav nav-pills xthemes-social\">\n <?php foreach( $theme->getInfo('social') as $type => $link ): ?>\n <li>\n <a href=\"<?php echo $link; ?>\" target=\"_blank\">\n <?php echo $xtFunctions->social_icon( $type ); ?>\n </a>\n </li>\n <?php endforeach; ?>\n </ul>\n <?php endif; ?>\n </div>\n </div>\n <?php\n }", "function register_widget_areas()\n {\n register_sidebar(array(\n 'name' => 'Latest Tweets',\n 'id' => 'latest_tweets',\n 'description' => 'latest tweets',\n 'before_widget' => '<section class=\"widget-area latest-tweets\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ));\n }", "public function thm_add_reusable_blocks_menu() {\n\t\tadd_menu_page(\n\t\t\t__( 'Reusable Blocks', 'evt' ),\n\t\t\t'Reusable Blocks',\n\t\t\t'edit_posts',\n\t\t\t'edit.php?post_type=wp_block',\n\t\t\t'',\n\t\t\t'data:image/svg+xml;base64,'.base64_encode('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path fill=\"black\" d=\"M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z\"></path></svg>'),\n\t\t\t59\n\t\t);\n\t}", "private function init_calendarArea()\n {\n\n // Init area\n $this->pObj->objCal->area_init();\n\n // Reinit class vars $conf and $conf_view\n $this->conf = $this->pObj->conf;\n $this->conf_view = $this->conf[ 'views.' ][ $this->view . '.' ][ $this->mode . '.' ];\n // Reinit class vars $conf and $conf_view\n\n return;\n }", "function wp_add_global_styles_for_blocks()\n {\n }", "function event_details_cpt_single_blocks( $blocks ) {\n // Add new blocks with custom function output\n // Below is an example with an anonymous function but you can use custom functions as well ;)\n $blocks['custom_block'] = function() {\n\n echo '';\n\n };\n\n // Remove these content blocks\n unset( $blocks['comments'] );\n\t unset( $blocks['meta'] );\n\t unset( $blocks['title'] );\n\t unset( $blocks['media'] );\n\t\n // Return blocks\n return $blocks;\n\n}", "function wds_acf_blocks_acf_init() {\n\n\t$supports = array(\n\t\t'align' => array( 'wide', 'full' ),\n\t\t'anchor' => true,\n\t);\n\n\t// Register our Accordion block.\n\tacf_register_block_type(\n\t\tarray(\n\t\t\t'name' => 'wds-accordion',\n\t\t\t'title' => esc_html__( 'Accordion', 'wds-acf-blocks' ),\n\t\t\t'description' => esc_html__( 'A custom set of collapsable accordion items.', 'wds-acf-blocks' ),\n\t\t\t'render_callback' => 'wds_acf_blocks_acf_block_registration_callback',\n\t\t\t'category' => 'wds-blocks',\n\t\t\t'icon' => 'sort',\n\t\t\t'keywords' => array( 'accordion', 'wds' ),\n\t\t\t'mode' => 'auto',\n\t\t\t'enqueue_assets' => 'wds_acf_blocks_acf_enqueue_backend_block_styles',\n\t\t\t'align' => 'wide',\n\t\t\t'supports' => $supports,\n\t\t\t'example' => array(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t'title' => esc_html__( 'Accordion Block Title', 'wds-acf-blocks' ),\n\t\t\t\t\t\t'text' => esc_html__( 'Accordion Block Content', 'wds-acf-blocks' ),\n\t\t\t\t\t\t'accordion_items' => array(\n\t\t\t\t\t\t\t'0' => array(\n\t\t\t\t\t\t\t\t'accordion_title' => esc_html__( 'Accordion Item Title', 'wds-acf-blocks' ),\n\t\t\t\t\t\t\t\t'accordion_text' => esc_html__( 'Accordion Item Content', 'wds-acf-blocks' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\n\tacf_register_block_type(\n\t\tarray(\n\t\t\t'name' => 'wds-carousel',\n\t\t\t'title' => esc_html__( 'Carousel', 'wds-acf-blocks' ),\n\t\t\t'description' => esc_html__( 'A carousel with a call to action for each slide.', 'wds-acf-blocks' ),\n\t\t\t'render_callback' => 'wds_acf_blocks_acf_block_registration_callback',\n\t\t\t'category' => 'wds-blocks',\n\t\t\t'icon' => 'slides',\n\t\t\t'keywords' => array( 'carousel', 'slider', 'wds' ),\n\t\t\t'mode' => 'auto',\n\t\t\t'enqueue_assets' => 'wds_acf_blocks_acf_enqueue_carousel_scripts',\n\t\t\t'align' => 'wide',\n\t\t\t'supports' => $supports,\n\t\t\t'example' => array(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'data' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t);\n\n}", "public function theme()\n {\n }", "function gutenberg_enqueue_registered_block_scripts_and_styles() {\n\t$is_editor = ( 'enqueue_block_editor_assets' === current_action() );\n\n\t$block_registry = WP_Block_Type_Registry::get_instance();\n\tforeach ( $block_registry->get_all_registered() as $block_name => $block_type ) {\n\t\t// Front-end styles.\n\t\tif ( ! empty( $block_type->style ) ) {\n\t\t\twp_enqueue_style( $block_type->style );\n\t\t}\n\n\t\t// Front-end script.\n\t\tif ( ! empty( $block_type->script ) ) {\n\t\t\twp_enqueue_script( $block_type->script );\n\t\t}\n\n\t\t// Editor styles.\n\t\tif ( $is_editor && ! empty( $block_type->editor_style ) ) {\n\t\t\twp_enqueue_style( $block_type->editor_style );\n\t\t}\n\n\t\t// Editor script.\n\t\tif ( $is_editor && ! empty( $block_type->editor_script ) ) {\n\t\t\twp_enqueue_script( $block_type->editor_script );\n\t\t}\n\t}\n}", "function tribe_events_agenda_setup_in_bar( $views ) {\n\n\t\t\terror_log(\">>> tribe_events_agenda_setup_in_bar\");\n\t\t\t$views[] = array(\n\t\t\t\t'displaying' => 'agenda',\n\t\t\t\t'anchor' => 'Agenda',\n\t\t\t\t'url' => tribe_get_agenda_permalink()\n\t\t\t);\n\t\t\treturn $views;\n\t\t}", "function our_widget_inits(){\n\tregister_sidebar(array(\n\t\t'name' => 'Sidebar',\n\t\t'id' => 'sidebar1',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s widget_area\">',\n\t\t'after_widget' => \"</div>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 1',\n\t\t'id' => 'footer1',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 2',\n\t\t'id' => 'footer2',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 3',\n\t\t'id' => 'footer3',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n}", "function wp_setup_widgets_block_editor()\n {\n }", "function ourWidgetsInit(){\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Sidebar',\n\t\t\t'id' => 'sidebar1',\n\t\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"my-special-class\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 1',\n\t\t\t'id' => 'footer1'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 2',\n\t\t\t'id' => 'footer2'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 3',\n\t\t\t'id' => 'footer3'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 4',\n\t\t\t'id' => 'footer4'\n\t\t));\n\t}", "function render_block_core_widget_group($attributes, $content, $block)\n {\n }", "function ldc_theme_init() {\n global $ldc_theme;\n $ldc_theme = wp_get_theme();\n\n\n\n // allow editor style\n add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\n\n //// Init CMB2.\n // require_once 'library/cmb2/init.php';\n\n\n //// Load custom post types.\n require_once 'library/cpt/cpt-ldc_chatter.php';\n require_once 'library/cpt/cpt-ldc_creation.php';\n require_once 'library/cpt/cpt-ldc_event.php';\n\n\n //// Load shortcodes.\n require_once 'library/sc/sc-ldc_list.php';\n\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}", "function swank_homepage_widgets() {\r\n\r\n\tgenesis_widget_area( 'home-slider', array(\r\n\t\t'before' => '<div class=\"home-slider widget-area\"><div class=\"wrap\">',\r\n\t\t'after' => '</div></div>',\r\n\t) );\r\n\r\n\tgenesis_widget_area( 'under-home-slider', array(\r\n\t\t'before' => '<div class=\"under-home-slider widget-area\"><div class=\"wrap\">',\r\n\t\t'after' => '</div></div>',\r\n\t) );\r\n\r\n\tgenesis_widget_area( 'featured-circles', array(\r\n\t\t'before' => '<div class=\"featured-circles widget-area\"><div class=\"wrap\">',\r\n\t\t'after' => '</div></div>',\r\n\t) );\r\n\r\n\tgenesis_widget_area( 'home-featured-area', array(\r\n\t\t'before' => '<div class=\"home-featured-area widget-area\"><div class=\"wrap\">',\r\n\t\t'after' => '</div></div>',\r\n\t) );\r\n\r\n}", "function msdlab_add_homepage_hero_flex_sidebars(){\n genesis_register_sidebar(array(\n 'name' => 'Homepage Hero',\n 'description' => 'Homepage hero space',\n 'id' => 'homepage-top'\n ));\n genesis_register_sidebar(array(\n 'name' => 'Homepage Widget Area',\n 'description' => 'Homepage central widget areas',\n 'id' => 'homepage-widgets',\n 'before_widget' => genesis_markup( array(\n 'html5' => '<section id=\"%1$s\" class=\"widget %2$s\"><div class=\"widget-wrap\">',\n 'xhtml' => '<div id=\"%1$s\" class=\"widget %2$s\"><div class=\"widget-wrap\">',\n 'echo' => false,\n ) ),\n \n 'after_widget' => genesis_markup( array(\n 'html5' => '</div><div class=\"clear\"></div></section>' . \"\\n\",\n 'xhtml' => '</div><div class=\"clear\"></div></div>' . \"\\n\",\n 'echo' => false\n ) ),\n )); \n}", "function blank_widgets_init(){\n\n/*===================================\n\n Widget Areas header.php\n\n=====================================*/\n\n // // Widget Area: Header Contact\n // register_sidebar(array(\n // 'name' => ('Header Contact'),\n // 'id' => 'header-contact',\n // 'description' => 'Contact Info in Header',\n // 'before_widget' => '<div class=\"widget-header-contact\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h5 class=\"header-contact-widget-title\">',\n // 'after_title' => '</h5>'\n // ));\n\n // Widget Area: Header Social\n register_sidebar(array(\n 'name' => ('Header Social'),\n 'id' => 'header-social',\n 'description' => 'Social Meida Info in Header',\n 'before_widget' => '<div class=\"widget-header-social\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h5 class=\"header-social-widget-title\">',\n 'after_title' => '</h5>'\n ));\n\n/*===================================\n\n Widget Areas footer.php\n\n=====================================*/\n\n // Widget Area: Left Footer\n register_sidebar(array(\n 'name' => ('Left Footer'),\n 'id' => 'left-footer',\n 'description' => 'Left Widget Area in Footer',\n 'before_widget' => '<div class=\"widget-left-footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h5 class=\"left-footer-widget-title\">',\n 'after_title' => '</h5>'\n ));\n\n // Widget Area: Middle Footer\n register_sidebar(array(\n 'name' => ('Middle Footer'),\n 'id' => 'middle-footer',\n 'description' => 'Middle Widget Area in Footer',\n 'before_widget' => '<div class=\"widget-middle-footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h5 class=\"middle-footer-widget-title\">',\n 'after_title' => '</h5>'\n ));\n\n // Widget Area: Right Footer\n register_sidebar(array(\n 'name' => ('Right Footer'),\n 'id' => 'right-footer',\n 'description' => 'Right Widget Area in Footer',\n 'before_widget' => '<div class=\"widget-right-footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h5 class=\"right-footer-widget-title\">',\n 'after_title' => '</h5>'\n ));\n\n/*===================================\n\n Widget Areas page-home.php\n\n=====================================*/\n\n // Widget Area: Homepage Hero Image\n register_sidebar(array(\n 'name' => ('Homepage Hero Image'),\n 'id' => 'homepage-hero-image',\n 'description' => 'Hero Image on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-hero-image\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-hero-image-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Truck Types\n register_sidebar(array(\n 'name' => ('Homepage Truck Types'),\n 'id' => 'homepage-truck-types',\n 'description' => 'Truck Types Section on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-truck-types\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-truck-types-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Middle Image\n register_sidebar(array(\n 'name' => ('Homepage Middle Image'),\n 'id' => 'homepage-middle-image',\n 'description' => 'Middle Image on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-middle-image\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-middle-image-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services Header\n register_sidebar(array(\n 'name' => ('Homepage Services Title'),\n 'id' => 'homepage-services-title',\n 'description' => 'Services Title on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-title\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-title-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services One\n register_sidebar(array(\n 'name' => ('Homepage Services One'),\n 'id' => 'homepage-services-one',\n 'description' => 'Services One on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-one\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-one-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services Two\n register_sidebar(array(\n 'name' => ('Homepage Services Two'),\n 'id' => 'homepage-services-two',\n 'description' => 'Services Two on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-two\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-two-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services Three\n register_sidebar(array(\n 'name' => ('Homepage Services Three'),\n 'id' => 'homepage-services-three',\n 'description' => 'Services Three on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-three\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-three-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services Four\n register_sidebar(array(\n 'name' => ('Homepage Services Four'),\n 'id' => 'homepage-services-four',\n 'description' => 'Services Four on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-four\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-four-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Services Five\n register_sidebar(array(\n 'name' => ('Homepage Services Five'),\n 'id' => 'homepage-services-five',\n 'description' => 'Services Five on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-services-five\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-services-five-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Locations Header\n register_sidebar(array(\n 'name' => ('Homepage Locations Title'),\n 'id' => 'homepage-locations-title',\n 'description' => 'Locations Title on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-locations-title\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-locations-title-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Locations One\n register_sidebar(array(\n 'name' => ('Homepage Locations One'),\n 'id' => 'homepage-locations-one',\n 'description' => 'Locations One on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-locations-one\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-locations-one-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n // Widget Area: Homepage Locations Two\n register_sidebar(array(\n 'name' => ('Homepage Locations Two'),\n 'id' => 'homepage-locations-two',\n 'description' => 'Locations Two on Homepage',\n 'before_widget' => '<div class=\"widget-homepage-locations-two\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"homepage-locations-two-widget-title\">',\n 'after_title' => '</h3>'\n ));\n\n }", "public function registerBlocks(): void\n\t{\n\t\tforeach (Components::getBlocks() as $block) {\n\t\t\t$this->registerBlock($block);\n\t\t}\n\t}", "function initiate_widgets() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer twitter',\n\t\t'id' => 'footer_twitter',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer facebook',\n\t\t'id' => 'footer_facebook',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n}", "protected function _register_controls() {\n\t\t$this->query_controls();\n\t\t$this->layout_controls();\n\n $this->start_controls_section(\n 'eael_section_post_block_style',\n [\n 'label' => __( 'Post Block Style', 'essential-addons-elementor' ),\n 'tab' => Controls_Manager::TAB_STYLE\n ]\n );\n\n\n $this->add_control(\n\t\t\t'eael_post_block_bg_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Post Background Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#fff',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'background-color: {{VALUE}}',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\n $this->add_control(\n\t\t\t'eael_thumbnail_overlay_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Thumbnail Overlay Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => 'rgba(0,0,0, .5)',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-overlay, {{WRAPPER}} .eael-post-block.post-block-style-overlay .eael-entry-wrapper' => 'background-color: {{VALUE}}',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_post_block_spacing',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Spacing Between Items', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', '%', 'em' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_border',\n\t\t\t\t'label' => esc_html__( 'Border', 'essential-addons-elementor' ),\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-post-block-item',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_border_radius',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-post-block-item' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Box_Shadow::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_box_shadow',\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-post-block-item',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n $this->start_controls_section(\n 'eael_section_typography',\n [\n 'label' => __( 'Color & Typography', 'essential-addons-elementor' ),\n 'tab' => Controls_Manager::TAB_STYLE\n ]\n );\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_title_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_title_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '#303133',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title, {{WRAPPER}} .eael-entry-title a' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_title_hover_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Hover Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '#23527c',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title:hover, {{WRAPPER}} .eael-entry-title a:hover' => 'color: {{VALUE}};',\n\t\t\t\t]\n\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'eael_post_block_title_alignment',\n\t\t\t[\n\t\t\t\t'label' => __( 'Title Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-title' => 'text-align: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_title_typography',\n\t\t\t\t'label' => __( 'Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-entry-title',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_excerpt_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_excerpt_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-grid-post-excerpt p' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_excerpt_alignment',\n\t\t\t[\n\t\t\t\t'label' => __( 'Excerpt Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'justify' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-grid-post-excerpt p' => 'text-align: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_excerpt_typography',\n\t\t\t\t'label' => __( 'Excerpt Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_3,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-grid-post-excerpt p',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'eael_post_block_meta_style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Style', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::HEADING,\n\t\t\t\t'separator' => 'before',\n\t\t\t]\n\t\t);\n\n $this->add_control(\n\t\t\t'eael_post_block_meta_color',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default'=> '',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-meta, .eael-entry-meta a' => 'color: {{VALUE}};',\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_meta_alignment_footer',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'flex-start' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'flex-end' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'stretch' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-footer' => 'justify-content: {{VALUE}};',\n\t\t\t\t],\n 'condition' => [\n 'meta_position' => 'meta-entry-footer',\n ]\n\t\t\t]\n\t\t);\n\n $this->add_responsive_control(\n\t\t\t'eael_post_block_meta_alignment_header',\n\t\t\t[\n\t\t\t\t'label' => __( 'Meta Alignment', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::CHOOSE,\n\t\t\t\t'options' => [\n\t\t\t\t\t'left' => [\n\t\t\t\t\t\t'title' => __( 'Left', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-left',\n\t\t\t\t\t],\n\t\t\t\t\t'center' => [\n\t\t\t\t\t\t'title' => __( 'Center', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-center',\n\t\t\t\t\t],\n\t\t\t\t\t'right' => [\n\t\t\t\t\t\t'title' => __( 'Right', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-right',\n\t\t\t\t\t],\n\t\t\t\t\t'justify' => [\n\t\t\t\t\t\t'title' => __( 'Justified', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'icon' => 'fa fa-align-justify',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .eael-entry-meta' => 'text-align: {{VALUE}};',\n\t\t\t\t],\n 'condition' => [\n 'meta_position' => 'meta-entry-header',\n ]\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'eael_post_block_meta_typography',\n\t\t\t\t'label' => __( 'Meta Typography', 'essential-addons-elementor' ),\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_3,\n\t\t\t\t'selector' => '{{WRAPPER}} .eael-entry-meta > div, {{WRAPPER}} .eael-entry-meta > span',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->end_controls_section();\n\n\t\t/**\n\t\t * Load More Button Style Controls!\n\t\t */\n\t\t$this->load_more_button_style();\n\n\t}", "function athemes_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'lepays' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Header', 'lepays' ),\n\t\t'id' => 'sidebar-2',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sub Footer 1', 'lepays' ),\n\t\t'id' => 'sidebar-3',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sub Footer 2', 'lepays' ),\n\t\t'id' => 'sidebar-4',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sub Footer 3', 'lepays' ),\n\t\t'id' => 'sidebar-5',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sub Footer 4', 'lepays' ),\n\t\t'id' => 'sidebar-6',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\n\tregister_widget( 'aThemes_Preview_Post' );\n\tregister_widget( 'aThemes_Tabs' );\n\tregister_widget( 'aThemes_Flickr_Stream' );\n\tregister_widget( 'aThemes_Media_Embed' );\n\tregister_widget( 'aThemes_Social_Icons' );\n}", "public function register_blocks() {\n\n\t\t// Return early if this function does not exist.\n\t\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Shortcut for the slug.\n\t\t$slug = $this->_slug;\n\n\t\tregister_block_type(\n\t\t\t$slug . '/accordion',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/alert',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/author',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/click-to-tweet',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/dynamic-separator',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gif',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gist',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/highlight',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-carousel',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-masonry',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-stacked',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t}", "function gutenberg_cardContent_block_admin()\n{\n wp_enqueue_script(\n 'gutenberg-block-card-content',\n CH_THEME_URI . '/blocks/card-content/block.js',\n array('wp-blocks', 'wp-element'),\n CH_VERSION\n\n );\n\n wp_enqueue_style(\n 'gutenberg-notice-block-editor',\n CH_THEME_URI . '/blocks/card-content/block.css',\n array(),\n CH_VERSION\n );\n}", "function _register_core_block_patterns_and_categories()\n {\n }", "function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}", "function wp_enqueue_registered_block_scripts_and_styles()\n {\n }", "function flexible_widgets_init() {\n\tif ( !is_blog_installed() )\n\t\treturn;\n\n\tregister_widget('Flexible_Widget_Pages');\n\n\tregister_widget('Flexible_Widget_Calendar');\n\n\tregister_widget('Flexible_Widget_Archives');\n\n\tregister_widget('Flexible_Widget_Links');\n\n\tregister_widget('Flexible_Widget_Meta');\n\n\tregister_widget('Flexible_Widget_Search');\n\n\tregister_widget('Flexible_Widget_Text');\n\n\tregister_widget('Flexible_Widget_Categories');\n\n\tregister_widget('Flexible_Widget_Recent_Posts');\n\n\tregister_widget('Flexible_Widget_Recent_Comments');\n\n\tregister_widget('Flexible_Widget_RSS');\n\n\tregister_widget('Flexible_Widget_Tag_Cloud');\n\n\tregister_widget('Flexible_Nav_Menu_Widget');\n\n\tdo_action('widgets_init');\n}", "function kcsite_theme_setup() {\n\tglobal $staticVars;\n\t$siteurl = get_bloginfo('siteurl');\n\n\t$calendarOptions = get_option('tribe_events_calendar_options');\n\t$calendarSlug = $calendarOptions['eventsSlug'];\n\n\n\tif(pll_current_language('slug') == 'en'){\n\t\t$staticVars = array(\n\t\t\t'siteUrl' => $siteurl,\n\t\t\t'sitetreeUrl' => get_permalink(804),\n\t\t\t// 'eventsUrl' => get_permalink(397),\n\t\t\t'eventsUrl' => $siteurl.'/en/'.$calendarSlug,\n\t\t\t'educationResourceUrl' => get_permalink(kcsite_getPageByTempate('education_list.php')),\n\t\t\t'newsUrl' => get_permalink(177),\n\t\t\t'industryNewsUrl' => get_permalink(4109),\n\t\t\t'keysListUrl' => get_permalink(599),\n\t\t\t'newsArchiveUrl' => get_permalink(181),\t\t//used in news blog page for news arhive btn\n\t\t\t'industryNewsArchiveUrl' => get_permalink(4108),\t\n\t\t\t// 'newsCategoryID' => 33,\n\t\t\t// 'industryNewsCategoryID' => 34,\n\t\t\t'ordinaryNewTypeID' => 37,\n\t\t\t'industryNewTypeID' => 39,\n 'filmRegisterSearchPageId' => 4393,\n 'lithuanianFilmsSearchPageId' => 7717, // not set yet\n\t\t\t'lithuanianFilmsSearchProducablePageId' => 7719, // not set yet\n\t\t);\n\n\t} else {\n\t\t$staticVars = array(\n\t\t\t'siteUrl' => $siteurl,\n\t\t\t'sitetreeUrl' => get_permalink(458),\n\t\t\t// 'eventsUrl' => get_permalink(595),\n\t\t\t'eventsUrl' => $siteurl.'/'.$calendarSlug,\n\t\t\t'educationResourceUrl' => get_permalink(kcsite_getPageByTempate('education_list.php')),\n\t\t\t'newsUrl' => get_permalink(2),\n\t\t\t'industryNewsUrl' => get_permalink(4106),\n\t\t\t'keysListUrl' => get_permalink(597),\n\t\t\t'newsArchiveUrl' => get_permalink(86),\n\t\t\t'industryNewsArchiveUrl' => get_permalink(4107),\t\n\t\t\t// 'newsCategoryID' => 31,\n\t\t\t// 'industryNewsCategoryID' => 32,\t\t\n\t\t\t'ordinaryNewTypeID' => 36,\n\t\t\t'industryNewTypeID' => 38,\t\t\t\t\n 'filmRegisterSearchPageId' => 4393,\n 'lithuanianFilmsSearchPageId' => 7713,\n\t\t\t'lithuanianFilmsSearchProducablePageId' => 7715,\n\t\t);\n\t}\n\n\tload_theme_textdomain('kcsite', TEMPLATEPATH . '/languages');\n\t$locale = get_locale();\n\t$locale_file = TEMPLATEPATH . \"/languages/$locale.php\";\n\tif (is_readable($locale_file))\trequire_once( $locale_file );\n\n\tadd_editor_style();\n\n\t// Add default posts and comments RSS feed links to <head>.\n\t//add_theme_support( 'automatic-feed-links' );\n\n\tregister_nav_menu('primary', __('Primary Menu', 'kcsite'));\n register_nav_menu('secondary', __('Secondary Menu', 'kcsite'));\n\tregister_nav_menu('left_col_films_menu', __('Filmų meniu', 'kcsite'));\n\n\tfunction fallback_nav_menu(){}\n\n\t//add_theme_support('post-formats'/*, array( 'aside', 'link', 'gallery', 'status', 'quote', 'image')*/);\n\tadd_theme_support('post-thumbnails');\t\n\tadd_image_size('home-slideshow', 627, 338, true); \t\n\tadd_image_size('medium-cropped', 505, 175, true); /* for single post view, cropped to be narrower */\t\n\tadd_image_size('feat-thumbnail', 243, 160, true); /* for two featured news in news list */\t\n\t//set_post_thumbnail_size() To set a custom post thumbnail size.\n\n\t// register sidebars\n\tfunction kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}\n\tadd_action( 'widgets_init', 'kcsite_widgets_init' );\n\n}" ]
[ "0.755544", "0.72267795", "0.71796167", "0.71749926", "0.67539847", "0.67328703", "0.6021429", "0.5930355", "0.58980906", "0.589505", "0.5863667", "0.58232015", "0.5784089", "0.5768862", "0.57667905", "0.57651794", "0.57638687", "0.57479525", "0.5719109", "0.56599295", "0.56513864", "0.56375444", "0.56367195", "0.5634337", "0.56304204", "0.56304115", "0.5608079", "0.5603098", "0.5558011", "0.5550249", "0.5548825", "0.55275106", "0.5516988", "0.5502002", "0.5500478", "0.54930925", "0.5491734", "0.54898226", "0.5473921", "0.5466764", "0.5462456", "0.5455635", "0.5454592", "0.5447171", "0.54462504", "0.54372585", "0.54262686", "0.54205704", "0.5418712", "0.54150194", "0.5414582", "0.5410449", "0.5398577", "0.5395581", "0.5393861", "0.53923196", "0.5391483", "0.5390545", "0.538982", "0.53896934", "0.53774625", "0.5367737", "0.5357733", "0.53304505", "0.5329093", "0.53269035", "0.5317022", "0.5311812", "0.53089356", "0.53065985", "0.53062075", "0.5301106", "0.5297366", "0.52966446", "0.5294905", "0.5290306", "0.5285783", "0.5284303", "0.5280951", "0.5280242", "0.52767986", "0.5275804", "0.52612144", "0.52573806", "0.5250046", "0.5249041", "0.52440137", "0.52437574", "0.52427006", "0.52314824", "0.5229577", "0.5228201", "0.5224547", "0.52228767", "0.5221358", "0.52209574", "0.5219749", "0.5216621", "0.5216615", "0.5210663" ]
0.64538854
6
Instantiate object instance and initialize it payment.paypal. part from config.ini must be passed as the first parameter
public function __construct(Array $options) { $this->_options = $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($config = array())\r\n {\r\n $config = Arr::merge((array) Kohana::config('paypal'), $config);\r\n\r\n // Save the config in the object\r\n $this->config = $config;\r\n\r\n $this->paypal_url = isset($config['url']) ? $config['url'] : 'https://www.paypal.com/cgi-bin/webscr';\r\n }", "function photo_shop_paypal_class () {\r\n\r\n // initialization constructor. Called when class is created.\r\n\t global $CONFIG;\r\n $this->last_error = '';\r\n $this->ipn_log = $CONFIG['photo_shop_paypal_ipn_log'];\r\n $this->ipn_log_file = $CONFIG['photo_shop_paypal_ipn_logfile'];\r\n $this->ipn_response = '';\r\n }", "public function __construct()\n {\n if(config('paypal.settings.mode') == 'live'){\n $this->client_id = config('paypal.live_client_id');\n $this->secret = config('paypal.live_secret');\n //$this->plan_id = env('PAYPAL_LIVE_PLAN_ID', '');\n } else {\n $this->client_id = config('paypal.sandbox_client_id');\n $this->secret = config('paypal.sandbox_secret');\n //$this->plan_id = env('PAYPAL_SANDBOX_PLAN_ID', '');\n }\n \n // Set the Paypal API Context/Credentials\n $this->apiContext = new ApiContext(new OAuthTokenCredential($this->client_id, $this->secret));\n $this->apiContext->setConfig(config('paypal.settings'));\n }", "public function __construct()\n {\n // initialization constructor. Called when class is created.\n\n\t\tif (basket_plus::getBasketVar(PAYPAL_TEST_MODE)){\n\t\t\t// sandbox paypal\n\t\t\t$this->paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t\t$this->secure_url = \"ssl://www.sandbox.paypal.com\";\n\t\t}\n\t\telse{\n // normal paypal\n\t\t\t$this->paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t\t$this->secure_url = \"ssl://www.paypal.com\";\n\t\t}\n\n $this->last_error = '';\n\n //$this->ipn_log_file = Kohana::log_directory().Kohana::config('paypal.ipn_logfile');\n //$this->ipn_log = true;\n $this->ipn_response = '';\n\n // populate $fields array with a few default values. See the paypal\n // documentation for a list of fields and their data types. These default\n // values can be overwritten by the calling script.\n\n }", "public function __construct(){\n\t\t$paypal_conf = config('paypal');\n\t\t$this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n\t\t$this->_api_context->setConfig($paypal_conf['settings']);\n\t}", "public function __construct()\n {\n if ( config('services.paypal.settings.mode') === 'live' ) {\n $this->paypalClientId = config('services.paypal.live_client_id');\n $this->paypalSecret = config('services.paypal.live_secret');\n } else {\n $this->paypalClientId = config('services.paypal.sandbox_client_id');\n $this->paypalSecret = config('services.paypal.sandbox_secret');\n }\n \n // Set the Paypal API Context/Credentials\n $this->paypalApiContext = new \\PayPal\\Rest\\ApiContext(new \\PayPal\\Auth\\OAuthTokenCredential($this->paypalClientId, $this->paypalSecret));\n $this->paypalApiContext->setConfig(config('services.paypal.settings'));\n }", "public function __construct()\n {\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 $paypal_conf = config('paypal');\n \n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n \n }", "public function __construct() {\n $paypal_conf = Config::get('paypal_payment');\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($config=\"\"){\r\n\r\n\t//default settings\r\n\t$settings = array(\r\n\t\t'business' => '[email protected]', //paypal email address\r\n\t\t'currency' => 'GBP', //paypal currency\r\n\t\t'cursymbol'=> '&pound;', //currency symbol\r\n\t\t'location' => 'GB', //location code (ex GB)\r\n\t\t'returnurl'=> 'http://mysite/myreturnpage',//where to go back when the transaction is done.\r\n\t\t'returntxt'=> 'Return to My Site', //What is written on the return button in paypal\r\n\t\t'cancelurl'=> 'http://mysite/mycancelpage',//Where to go if the user cancels.\r\n\t\t'shipping' => 0, //Shipping Cost\r\n\t\t'custom' => '' //Custom attribute\r\n\t);\r\n\r\n\t//overrride default settings\r\n\tif(!empty($config)){foreach($config as $key=>$val){\r\n\t\tif(!empty($val)){ $settings[$key] = $val; }\r\n\t}}\r\n\t\r\n\t//Set the class attributes\r\n\t$this->business = $settings['business'];\r\n\t$this->currency = $settings['currency'];\r\n\t$this->cursymbol = $settings['cursymbol'];\r\n\t$this->location = $settings['location'];\r\n\t$this->returnurl = $settings['returnurl'];\r\n\t$this->returntxt = $settings['returntxt'];\r\n\t$this->cancelurl = $settings['cancelurl'];\r\n\t$this->shipping = $settings['shipping'];\r\n\t$this->custom = $settings['custom'];\r\n\t$this->items = array();\r\n\r\n}", "public function __construct()\n {\n /*if(config('paypal.settings.mode') == 'live'){\n $this->client_id = config('paypal.live_client_id');\n $this->secret = config('paypal.live_secret');\n } else {\n $this->client_id = config('paypal.sandbox_client_id');\n $this->secret = config('paypal.sandbox_secret');\n }\n\n // Set the Paypal API Context/Credentials\n $this->apiContext = new ApiContext(new OAuthTokenCredential($this->client_id, $this->secret));\n $this->apiContext->setConfig(config('paypal.settings'));\n */\n //parent::__construct();\n\n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->apiContext = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->apiContext->setConfig($paypal_conf['settings']);\n }", "function __construct() {\n $this->config = array(\n $this::CHECKOUT => 'https://ws.pagseguro.uol.com.br/v2/checkout/',\n $this::PAYMENT => 'https://pagseguro.uol.com.br/v2/checkout/payment.html',\n $this::NOTIFICATION => 'https://ws.pagseguro.uol.com.br/v2/transactions/notifications/'\n );\n }", "public function __construct()\r\n {\r\n $paypal_conf = Config::get('paypal');\r\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\r\n $this->_api_context->setConfig($paypal_conf['settings']);\r\n }", "public function __construct()\n {\n // parent::__construct();\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n\t\t//print_r($paypal_conf);exit;\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 $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 /** 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 }", "function paypal_class() {\n \n // initialization constructor. Called when class is created.\n \n $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n //$this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';\n \n $this->last_error = '';\n \n $this->ipn_log_file = '.ipn_results.log';\n $this->ipn_log = true; \n $this->ipn_response = '';\n \n // populate $fields array with a few default values. See the paypal\n // documentation for a list of fields and their data types. These defaul\n // values can be overwritten by the calling script.\n\n $this->add_field('rm','2'); // Return method = POST\n $this->add_field('cmd','_xclick'); \n \n }", "public function __construct()\n {\n\n /** PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential(\n $paypal_conf['client_id'],\n $paypal_conf['secret'])\n );\n $this->_api_context->setConfig($paypal_conf['settings']);\n\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()\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 }", "function __construct($settings=array()){\n\t\t\n\t\tOpenPayU_Configuration::setEnvironment('sandbox');\n\t\t//PayU::$apiKey \t\t= $settings['apiKey'];\n\t\t/*PayU::$apiLogin \t= $settings['apiLogin'];\n\t\tPayU::$merchantId = $settings['merchantId'];\n\t\tPayU::$language \t= $settings['language'];\n\t\tPayU::$isTest \t\t= $settings['test'];*/\n\t}", "public function __construct()\n {\n $this->id = 'paypal_payment';\n $this->method_title = 'Paypal Payment';\n $this->title = 'Paypal Payment';\n $this->has_fields = false;\n $this->invoiceUrl = \"https://api.sandbox.paypal.com/v1/invoicing/invoices/\";\n\n $this->init_form_fields();\n $this->init_settings();\n\n add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\n }", "public function __construct()\n {\n $this->name = 'pigmbhpaymill';\n $this->tab = 'payments_gateways';\n $this->version = '1.0.4';\n $this->author = 'PayIntelligent GmbH';\n $this->need_instance = 0;\n $this->currencies = true;\n\t$this->currencies_mode = 'checkbox';\n\n parent::__construct();\n $this->loadConfiguration();\n $this->displayName = $this->l('PigmbhPaymill');\n $this->description = $this->l('Payment via Paymill.');\n }", "public function __construct()\n {\n $this->middleware('referer');\n if (App::getLocale() == \"it\") {\n Moment::setLocale('it_IT');\n }\n\n\n $this->_apiContext = PayPal::ApiContext(\n config('services.paypal.client_id'),\n config('services.paypal.secret'));\n\n\n $this->_apiContext->setConfig(array(\n 'mode' => (getenv('APP_ENV') == \"local\") ? 'sandbox' : 'live',\n 'service.EndPoint' => (getenv('APP_ENV') == \"local\") ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com',\n 'http.ConnectionTimeOut' => 30,\n 'log.LogEnabled' => false,\n 'log.FileName' => storage_path('logs/paypal.log'),\n 'log.LogLevel' => 'FINE'\n ));\n\n\n }", "protected function _get_configuration(){\n\n return new Payment_Configuration();\n\n }", "public function __construct()\n {\n $sModuleId = 'payppaypalplus';\n\n $this->setModuleData(\n array(\n 'id' => $sModuleId,\n 'title' => 'PayPal Plus',\n 'description' => 'PayPal Plus payments module for OXID eShop',\n )\n );\n\n $this->load($sModuleId);\n }", "protected function _construct()\n {\n $this->_init('hipay/paymentProfile');\n }", "public function __construct($payment)\n {\n //\n $this->payment = $payment;\n }", "function __construct()\n\t{\n\t\t//$this->PaypalAdaptivePayments = Paypaladaptive::initialize();\n\t\t$this->paypal_transaction = Paypaladaptive::initializePaypalTransaction();\n\t\t$this->shop_order_obj = Webshoporder::initialize();\n\t\t$this->invoice_obj = Webshoporder::initializeInvoice();\n\t\t$this->product_obj = Products::initialize();\n\t\t$this->common_invoice_obj = Products::initializeCommonInvoice();\n\t\t$this->manage_credits_obj = Products::initializeManageCredits();\n\t}", "public function __construct($payment)\n {\n $this->payment = $payment;\n }", "public function __construct($payment)\n {\n $this->payment = $payment;\n }", "abstract public function getPaymentInstance($payment, $order = array(), $config = array());", "function __construct() {\n // $config = parse_ini_file((dirname(__DIR__) . '../config.ini')); \n $config=parse_ini_file((dirname(dirname(__DIR__))). '/resources/config.ini'); \n $this-> APPKEY= $config['urbanairship.appkey'];\n $this-> PUSHSECRET= $config['urbanairship.pushsecret'];\n $this->push_url =$config['urbanairship.push.api'];\n }", "public function __construct($params, $config = array())\n {\n parent::__construct($params, $config);\n $this->mode = $params->get('paypal_mode');\n if ($this->mode)\n {\n $this->url = 'https://www.paypal.com/cgi-bin/webscr';\n }\n else\n {\n $this->url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n }\n $this->setParameter('business', $params->get('paypal_id'));\n $this->setParameter('rm', 2);\n $this->setParameter('cmd', '_xclick');\n $this->setParameter('no_shipping', 1);\n $this->setParameter('no_note', 1);\n $locale = $params->get('paypal_locale','');\n\n if ($locale == '')\n {\n if (JLanguageMultilang::isEnabled())\n {\n $locale = JFactory::getLanguage()->getTag();\n $locale = str_replace(\"-\",\"_\",$locale);\n }\n else\n {\n $locale = 'en_US';\n }\n }\n\n $this->setParameter('lc', $locale);\n $this->setParameter('charset', 'utf-8');\n }", "public function __construct()\n {\n $this->url = Config::get('wazaar.API_URL');\n $this->payment = app()->make('Cocorium\\Payment\\PaymentInterface');\n }", "public function setUp()\n {\n $this->_paypal = new Paypal();\n\n $this->_payment = new Payment($this->_paypal);\n }", "public function __construct($config)\n {\n $this->authnet_values['x_login'] = $config['auth_net_login_id'];\n $this->authnet_values['x_tran_key'] = $config['auth_net_tran_key'];\n \n $this->required_fields['x_login'] = !empty($config['auth_net_login_id']);\n $this->required_fields['x_tran_key']= !empty($config['auth_net_tran_key']);\n\n $this->curl_config = $config['curl_config'];\n $this->test_mode = $config['test_mode'];\n\n Kohana::log('debug', 'Authorize.net Payment Driver Initialized');\n }", "public function __construct()\n {\n $this->sale_account = config('global.sale');\n $this->cash_sale = config('global.cash_sale');\n $this->sale_advance = config('global.sale_advance');\n $this->discount_allowed = config('global.discount_allowed');\n $this->credit_collection = config('global.credit_collection');\n // sub account for purcahse\n $this->purchase_account = config('global.purchase');\n $this->cash_purchase = config('global.cash_purchase');\n $this->purchase_advance = config('global.purchase_advance');\n $this->discount_received = config('global.discount_received');\n $this->credit_payment = config('global.credit_payment');\n $this->opening_balance=null;\n }", "public function __construct() {\n trace('[METHOD] '.__METHOD__);\n $this->classConfigArr = $GLOBALS['TSFE']->tmpl->setup['config.']['tx_ptgsaaccounting.'];\n $this->shopConfigArr = $GLOBALS['TSFE']->tmpl->setup['config.']['tx_ptgsashop.']; \n \n if($this->shopConfigArr['usePricesWithMoreThanTwoDecimals'] == 1) {\n $this->precision = 4;\n } else {\n $this->precision = 2;\n } \n trace($this->classConfigArr,0,'classConfigArr');\n trace($this->shopConfigArr,0,'shopConfigArr');\n }", "private function _init() {\n\n global $admin_settings;\n global $payment_list;\n\n new KP_Korapay_Shortcode;\n\n $admin_settings = KP_Korapay_Admin_Settings::get_instance();\n $payment_list = KP_Korapay_Payment_List::get_instance();\n\n if ( is_admin() ) {\n KP_Tinymce_Plugin::get_instance();\n }\n\n if ($admin_settings->get_option_value( 'go_live' ) === 'yes' ) {\n $this->api_base_url = 'https://api.korapay.com/merchant';\n }\n\n }", "public function _construct()\n {\n parent::_construct();\n\n $app = Mage::app();\n $locale = $app->getLocale();\n\n $this->_coreHelper = $this->helper('core');\n $this->_paymentHelper = Mage::helper('payment');\n $this->_helper = Mage::helper('radial_paypal');\n $this->_config = $this->_helper->getConfigModel();\n $this->_localeCode = $locale->getLocaleCode();\n $url = $this->_config->shortcutExpressCheckoutButton ?: self::DEFAULT_IMAGE_URL;\n $this->_payPalImageUrl = str_replace(array('{locale_code}'), array($this->_localeCode), $url);\n $this->_htmlId = $this->_coreHelper->uniqHash(self::HTML_ID_PREFIX);\n }", "public function __construct()\n {\n\n // Load components required by this gateway\n Loader::loadComponents($this, array(\"Input\"));\n\n // Load the language required by this gateway\n Language::loadLang(\"tpay_payments\", null, dirname(__FILE__) . DS . \"language\" . DS);\n\n $this->loadConfig(dirname(__FILE__) . DS . \"config.json\");\n\n include_once 'lib/src/_class_tpay/validate.php';\n include_once 'lib/src/_class_tpay/util.php';\n include_once 'lib/src/_class_tpay/exception.php';\n include_once 'lib/src/_class_tpay/paymentBasic.php';\n include_once 'lib/src/_class_tpay/curl.php';\n include_once 'lib/src/_class_tpay/lang.php';\n }", "function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}", "public function __construct(array $config)\n {\n $this->parasut = new ParasutClient([\n 'client_id' => array_get($config, 'parasut_client_id'),\n 'client_secret' => array_get($config, 'parasut_client_secret'),\n 'username' => array_get($config, 'parasut_username'),\n 'password' => array_get($config, 'parasut_password'),\n 'company_id' => array_get($config, 'parasut_company_id'),\n 'grant_type' => 'password',\n 'redirect_uri' => 'urn:ietf:wg:oauth:2.0:oob',\n ]);\n\n $this->parasut->authorize();\n\n $this->localStorage = new LocalStorage();\n\n $paymentPlatforms = [\n \"HB\" => \"Hepsiburada\",\n \"GG\" => \"Gittigidiyor\",\n \"N11\" => \"N11\"\n ];\n\n $this->paymentPlatforms = $paymentPlatforms;\n\n $this->eInvoiceDefaults = [\n 'internet_sale' =>[\n \"payment_type\" => config(\"pazaryeri-parasut.einvoice_payment_type\"),\n ],\n 'vat_withholding_code' =>config(\"pazaryeri-parasut.einvoice_vat_withholding_code\")\n ];\n\n }", "public function __construct()\n {\n parent::__construct();\n\n /** verifico se produção ou sandbox * */\n switch (Config::PS_AMBIENTE) {\n\n // ambiente de testes\n case 'sandbox':\n $this->psWS = 'https://ws.sandbox.pagseguro.uol.com.br/v2/checkout';\n $this->psWSTransparente = 'https://ws.sandbox.pagseguro.uol.com.br/v2/sessions';\n $this->psURL = 'https://sandbox.pagseguro.uol.com.br/v2/checkout/payment.html';\n $this->psURL_Script = 'https://stc.sandbox.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js';\n $this->ScriptTransparente = 'https://stc.sandbox.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js';\n $this->psURL_Notificacao = 'https://ws.sandbox.pagseguro.uol.com.br/v2/transactions/';\n $this->token = Config::PS_TOKEN_SB;\n break;\n // ambiente de produção real\n case 'production':\n $this->psWS = 'https://ws.pagseguro.uol.com.br/v2/checkout';\n $this->psWSTransparente = 'https://ws.pagseguro.uol.com.br/v2/sessions';\n $this->psURL = 'https://pagseguro.uol.com.br/v2/checkout/payment.html';\n $this->psURL_Script = 'https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js';\n $this->ScriptTransparente = 'https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js';\n $this->psURL_Notificacao = 'https://ws.pagseguro.uol.com.br/v2/transactions/';\n $this->token = Config::PS_TOKEN;\n break;\n }\n\n }", "protected function _construct() {\n $showIcons = Mage::getStoreConfig('pay_payment/general/show_icons', Mage::app()->getStore());\n $iconSize = Mage::getStoreConfig('pay_payment/general/icon_size', Mage::app()->getStore());\n\n $enablePersonal = Mage::getStoreConfig('payment/pay_payment_billink/ask_data_personal', Mage::app()->getStore());\n $enableBusiness = Mage::getStoreConfig('payment/pay_payment_billink/ask_data_business', Mage::app()->getStore());\n\n if(strpos($iconSize, 'x') === false){\n $iconSize = $iconSize.'x'.$iconSize;\n }\n\n $mark = Mage::getConfig()->getBlockClassName('core/template');\n $mark = new $mark;\n $mark->setTemplate('pay/payment/mark.phtml')\n ->setPaymentMethodImageSrc('https://www.pay.nl/images/payment_profiles/'.$iconSize.'/'.$this->paymentMethodId.'.png')\n ->setPaymentMethodName('Billink');\n\n if($enablePersonal == 1 || $enableBusiness == 1){\n $template = $this->setTemplate('pay/payment/form/billink.phtml');\n } else {\n $template = $this->setTemplate('pay/payment/form/default.phtml');\n }\n\n if($showIcons){\n $template->setMethodLabelAfterHtml($mark->toHtml());\n }\n return parent::_construct();\n }", "public function __construct()\n {\n $this->alipay = new Alipay();\n }", "public function __construct(Payment $payment)\n {\n $this->payment = $payment;\n }", "public function __construct(Payment $payment)\n {\n $this->payment = $payment;\n }", "function __construct() {\r\n $this->config->token = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"token\", '');\r\n $this->config->api = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"api\", '');\r\n $this->config->sender = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"sender\", '');\r\n\t}", "public function __construct()\n {\n $this->merchant = [\n 'key' => getenv('MERCHANT_KEY'),\n 'secret' => getenv('MERCHANT_SECRET')\n ];\n }", "function __construct()\n\t{\n\t\t$this->_ci =& get_instance();\n\n\t\t//load config\n\t\t$this->_ci->load->config('twilio', TRUE);\n\n\t\t$this->account_sid = $this->_ci->config->item('account_sid', 'twilio');\n\t\t$this->auth_token = $this->_ci->config->item('auth_token', 'twilio');\t\t\n\t}", "public function __construct(array $config = array())\n\t{\n\t\t//$this->curl_config = $config['googlecheckout']['curl_config'];\n\n\t\tparent::__construct($config);\n\n\t\tif($this->test_mode === true)\n\t\t{\n\t\t\t$this->set_fields(array(\n\t\t\t\t'MERCHANT_ID' => $config['googlecheckout']['SANDBOX_MERCHANT_ID'],\n\t\t\t\t'ENDPOINT' => $config['googlecheckout']['SANDBOX_ENDPOINT'],\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->set_fields(array(\n\t\t\t\t'MERCHANT_ID' => $config['googlecheckout']['MERCHANT_ID'],\n\t\t\t\t'ENDPOINT' => $config['googlecheckout']['ENDPOINT'],\n\t\t\t));\n\t\t}\n\n\t\t$this->set_fields(array(\n\t\t\t'VERSION' => $config['googlecheckout']['VERSION'],\n\t\t\t'CURRENCYCODE' => $config['googlecheckout']['CURRENCYCODE'],\n\t\t\t'IPADDRESS' => $_SERVER['REMOTE_ADDR'],\n\t\t));\n\t}", "function init_payment_settings() {\n\t\t\t//\n\t\t\t// Initialize the section\n\t\t\t//\n\t\t\tadd_settings_section(\n\t\t\t\tself::PAYMENT_SECTION_ID,\n\t\t\t\t__( 'Payment Settings', 'link-linkid' ),\n\t\t\t\tarray( $this, 'render_payment_settings_info' ),\n\t\t\t\tself::LINKID_SETTINGS_PAGE_ID );\n\n\t\t}", "static function init()\n\t\t{\n\t\t\t//make sure PayPal Express is a gateway option\n\t\t\tadd_filter('pmpro_gateways', array('PMProGateway_paypalexpress', 'pmpro_gateways'));\n\n\t\t\t//add fields to payment settings\n\t\t\tadd_filter('pmpro_payment_options', array('PMProGateway_paypalexpress', 'pmpro_payment_options'));\n\n\t\t\t/*\n\t\t\t\tFilter pmpro_next_payment to get actual value\n\t\t\t\tvia the PayPal API. This is disabled by default\n\t\t\t\tfor performance reasons, but you can enable it\n\t\t\t\tby copying this line into a custom plugin or\n\t\t\t\tyour active theme's functions.php and uncommenting\n\t\t\t\tit there.\n\t\t\t*/\n\t\t\t//add_filter('pmpro_next_payment', array('PMProGateway_paypalexpress', 'pmpro_next_payment'), 10, 3);\n\n\t\t\t/*\n\t\t\t\tThis code is the same for PayPal Website Payments Pro, PayPal Express, and PayPal Standard\n\t\t\t\tSo we only load it if we haven't already.\n\t\t\t*/\n\t\t\tglobal $pmpro_payment_option_fields_for_paypal;\n\t\t\tif(empty($pmpro_payment_option_fields_for_paypal))\n\t\t\t{\n\t\t\t\tadd_filter('pmpro_payment_option_fields', array('PMProGateway_paypalexpress', 'pmpro_payment_option_fields'), 10, 2);\n\t\t\t\t$pmpro_payment_option_fields_for_paypal = true;\n\t\t\t}\n\n\t\t\t//code to add at checkout\n\t\t\t$gateway = pmpro_getGateway();\n\t\t\tif($gateway == \"paypalexpress\")\n\t\t\t{\n\t\t\t\tadd_filter('pmpro_include_billing_address_fields', '__return_false');\n\t\t\t\tadd_filter('pmpro_include_payment_information_fields', '__return_false');\n\t\t\t\tadd_filter('pmpro_required_billing_fields', array('PMProGateway_paypalexpress', 'pmpro_required_billing_fields'));\n\t\t\t\tadd_filter('pmpro_checkout_new_user_array', array('PMProGateway_paypalexpress', 'pmpro_checkout_new_user_array'));\n\t\t\t\tadd_filter('pmpro_checkout_confirmed', array('PMProGateway_paypalexpress', 'pmpro_checkout_confirmed'));\n\t\t\t\tadd_action('pmpro_checkout_before_processing', array('PMProGateway_paypalexpress', 'pmpro_checkout_before_processing'));\n\t\t\t\tadd_filter('pmpro_checkout_default_submit_button', array('PMProGateway_paypalexpress', 'pmpro_checkout_default_submit_button'));\n\t\t\t\tadd_action('pmpro_checkout_after_form', array('PMProGateway_paypalexpress', 'pmpro_checkout_after_form'));\n\t\t\t\tadd_action('http_api_curl', array('PMProGateway_paypalexpress', 'http_api_curl'), 10, 3);\n\t\t\t}\n\t\t}", "function __construct($properties = null) {\n\t\t$this->info = parent::getGateway();\n\n\t\t/**\n\t\t# API user: The user that is identified as making the call. you can\n\t\t# also use your own API username that you created on PayPal�s sandbox\n\t\t# or the PayPal live site\n\t\t*/\n\t\t$this->API_UserName=$this->info['merchant']['api_username'];\n\n\n\t\t/**\n\t\t# API_password: The password associated with the API user\n\t\t# If you are using your own API username, enter the API password that\n\t\t# was generated by PayPal below\n\t\t# IMPORTANT - HAVING YOUR API PASSWORD INCLUDED IN THE MANNER IS NOT\n\t\t# SECURE, AND ITS ONLY BEING SHOWN THIS WAY FOR TESTING PURPOSES\n\t\t*/\n\t\t$this->API_Password=$this->info['merchant']['api_password'];\n\n\t\t/**\n\t\t# API_Signature:The Signature associated with the API user. which is generated by paypal.\n\t\t*/\n\t\t$this->API_Signature=$this->info['merchant']['api_signature'];\n\n\t\t/**\n\t\t# Version: this is the API version in the request.\n\t\t# It is a mandatory parameter for each API request.\n\t\t# The only supported value at this time is 2.3\n\t\t*/\n\t\t$this->version=2.3;\n\n\t\t$this->subject = '';\n\n\t\t// below three are needed if used permissioning\n\t\t$this->AUTH_token='';\n\n\t\t$this->AUTH_signature='';\n\n\t\t$this->AUTH_timestamp='';\n\n\t\t$this->USE_PROXY = FALSE;\n\n\t\t/**\n\t\t# PROXY_HOST and PROXY_PORT will be read only if USE_PROXY is set to TRUE\n\n\t\t$this->PROXY_HOST = 127.0.0.1;\n\t\t$this->PROXY_PORT = 808;\n\t\t*/\n\n\t\t/* Define the PayPal URL. This is the URL that the buyer is\n\t\t first sent to to authorize payment with their paypal account\n\t\t change the URL depending if you are testing on the sandbox\n\t\t or going to the live PayPal site\n\t\t For the sandbox, the URL is\n\t\t https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=\n\t\t For the live site, the URL is\n\t\t https://www.paypal.com/webscr&cmd=_express-checkout&token=\n\t\t */\n\t\tif ($this->info['merchant']['type'] == 0) {\n\t\t\t$this->PAYPAL_URL = 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=';\n\n\t\t\t/**\n\t\t\t# Endpoint: this is the server URL which you have to connect for submitting your API request.\n\t\t\t*/\n\t\t\t$this->API_Endpoint ='https://api-3t.sandbox.paypal.com/nvp';\n\t\t} else {\n\t\t\t$this->PAYPAL_URL = 'https://www.paypal.com/webscr&cmd=_express-checkout&token=';\n\n\t\t\t/**\n\t\t\t# Endpoint: this is the server URL which you have to connect for submitting your API request.\n\t\t\t*/\n\t\t\t$this->API_Endpoint ='https://api-3t.paypal.com/nvp';\n\t\t}\n\n\t\t// Ack related constants\n\t\t$this->ACK_SUCCESS = 'SUCCESS';\n\t\t$this->ACK_SUCCESS_WITH_WARNING = 'SUCCESSWITHWARNING';\n\n\t\tparent::__construct($properties);\n\t}", "public function __construct()\n {\n include(DOC_ROOT.'/plugins/wikipal/_plugin_config.inc.php');\n\n // load config into the object\n $this->config = $pluginConfig;\n }", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_SepaMandate();\n $this->_modelName = 'Billing_Model_SepaMandate';\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }", "function __construct()\n {\n // Some default values of the class\n $this->gatewayUrl = 'https://test.ipgonline.com/connect/gateway/processing';\n $this->ipnLogFile = PAID_SUBS_DIR.'/ipn/logs/firstdata.ipn_results.log';\n \n global $paidSub;\n \n if($paidSub->configs['test_mode']=='enabled')\n $this->enableTestMode();\n }", "public function __construct()\n {\n // create object to manage MangoPay API\n $this->connexionApi = new MangoPay\\MangoPayApi();\n // login : password : temp directory\n $this->connexionApi->Config->ClientId = 'aurelgouilhers';\n $this->connexionApi->Config->ClientPassword = 'wr42AYOg5LU5OE3dn10qNrbfsDC7iYeRHu3N4Gjw3KtGDuSC1V';\n $this->connexionApi->Config->TemporaryFolder = __DIR__.\"/../../../TEMP_MANGOPAY\";\n //declaration reoute retour pour recuperation card_Id object\n $this->urlServer = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'];\n $this->urlServer .= substr($_SERVER['REQUEST_URI'], 0, strripos($_SERVER['REQUEST_URI'], ' ') + 1);\n\n }", "public function __construct(array $config = array())\n\t{\n\t\t// Example config:\n\t\t// $config = array('login' => [login], 'tran_key' => [tran_key], 'test_mode' => TRUE/FALSE, 'duplicate_window' => 30);\n\t\t$config = array_merge(Kohana::config('authorizenet')->default, $config);\n\n\t\t// Make sure we have enough to get started.\n\t\tif (!$config['login'] || !$config['tran_key'])\n\t\t\tthrow new Kohana_Exception('Payment gateway credentials not found');\n\t\t\n\t\t$this->_login = $config['login'];\n\t\t$this->_tran_key = $config['tran_key'];\n\t\t\n\t\t// Determine POST target.\n\t\t$this->_url = $config['test_mode'] ? self::TEST : self::LIVE;\n\n\t\t// User provided dupe window.\n\t\t$this->duplicate_window = Arr::get($config, 'duplicate_window', NULL);\n\t}", "public function __construct() {\n $username = Cart66Setting::getValue('paypalpro_api_username');\n $password = Cart66Setting::getValue('paypalpro_api_password');\n $signature = Cart66Setting::getValue('paypalpro_api_signature');\n if(!($username && $password && $signature)) {\n throw new Cart66Exception('Invalid PayPal Pro Configuration', 66502);\n }\n parent::__construct();\n }", "function __construct()\n {\n //include_once(__DIR__ . '/Assets/nusoap.php');\n\n\n $this->merchant_id = config('saderat.merchant_id');\n $this->terminal_id = config('saderat.terminal_id');\n // set default invoice number\n $this->setInvoiceNumber(static::uniqueID());\n\n /**\n * get key resource to start based on public key\n */\n if (!$public_key = @file_get_contents(__DIR__ . '/Assets/merchant_public_key.txt'))\n throw new \\Exception('خطای دریافت کلید عمومی');\n\n if (!config()->has('saderat.private_key'))\n throw new \\Exception('تنظیمات مربوط به کلید خصوصی یافت نشد.');\n\n $this->private_key =\n '-----BEGIN PRIVATE KEY-----' . PHP_EOL .\n trim(config('saderat.private_key')) . PHP_EOL .\n '-----END PRIVATE KEY-----';\n\n $this->key_resource = openssl_get_publickey($public_key);\n }", "public function makeConfiguration($paymentMethod,$order,$transaction){\n\n\t\t$conf['merchantId'] = $paymentMethod->options->merchantId ?? null;\n\t \t$conf['publicKey'] = $paymentMethod->options->publicKey ?? null;\n\t \t\n\t \t$conf['sandboxMode'] = true;\n\t \tif($paymentMethod->options->mode!='sandbox')\n\t \t\t$conf['sandboxMode'] = false;\n\t \t\n\t \t$conf['reedirectAfterPayment'] = $order->url;\n\t \t\n\t \t$conf['order'] = $order;\n\n\t \treturn json_decode(json_encode($conf));\n \n\t}", "public function inicializa(){\n $this->pasarela=new Braintree_Gateway([\n 'environment' => 'sandbox',\n 'merchantId' => '5rhrmyjvb8grrg3p',\n 'publicKey' => 'fxckz62h6j8gfmq3',\n 'privateKey' => '35700099a2f8e6b64d3386ef86609b70'\n ]);\n }", "public function __construct() {\r\n \r\n $this->id = 'plaid_payment'; // payment gateway plugin ID\r\n $this->icon = ''; // URL of the icon that will be displayed on checkout page near your gateway name\r\n $this->has_fields = true; // in case you need a custom credit card form\r\n $this->method_title = 'Plaid Payment Gateway';\r\n $this->method_description = 'Description of Plaid payment gateway'; // will be displayed on the options page\r\n \r\n // gateways can support subscriptions, refunds, saved payment methods,\r\n // but in this tutorial we begin with simple payments\r\n $this->supports = array(\r\n 'products'\r\n );\r\n \r\n // Method with all the options fields\r\n $this->init_form_fields();\r\n \r\n // Load the settings.\r\n $this->init_settings();\r\n $this->title = $this->get_option( 'title' );\r\n $this->description = $this->get_option( 'description' );\r\n $this->enabled = $this->get_option( 'enabled' );\r\n //$this->testmode = 'yes' === $this->get_option( 'testmode' );\r\n //$this->private_key = $this->testmode ? $this->get_option( 'test_private_key' ) : $this->get_option( 'private_key' );\r\n //$this->publishable_key = $this->testmode ? $this->get_option( 'test_publishable_key' ) : $this->get_option( 'publishable_key' );\r\n \r\n // This action hook saves the settings\r\n add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\r\n \r\n // We need custom JavaScript to obtain a token\r\n add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) );\r\n \r\n // You can also register a webhook here\r\n // add_action( 'woocommerce_api_{webhook name}', array( $this, 'webhook' ) );\r\n \r\n \t\t}", "public static function factory($adapter, $config = array())\n {\n if ($config instanceof Zend_Config) {\n $config = $config->toArray();\n }\n\n /*\n * Convert Zend_Config argument to plain string\n * adapter name and separate config object.\n */\n if ($adapter instanceof Zend_Config) {\n if (isset($adapter->params)) {\n $config = $adapter->params->toArray();\n }\n if (isset($adapter->adapter)) {\n $adapter = (string) $adapter->adapter;\n } else {\n $adapter = null;\n }\n }\n\n /*\n * Verify that adapter parameters are in an array.\n */\n if (!is_array($config)) {\n /**\n * @see Galahad_Payment_Exception\n */\n require_once 'Galahad/Payment/Exception.php';\n throw new Galahad_Payment_Exception('Adapter parameters must be in an array or a Zend_Config object');\n }\n\n /*\n * Verify that an adapter name has been specified.\n */\n if (!is_string($adapter) || empty($adapter)) {\n /**\n * @see Galahad_Payment_Exception\n */\n require_once 'Galahad/Payment/Exception.php';\n throw new Galahad_Payment_Exception('Adapter name must be specified in a string');\n }\n\n /*\n * Form full adapter class name\n */\n $adapterNamespace = 'Galahad_Payment_Adapter';\n if (isset($config['adapterNamespace'])) {\n if ($config['adapterNamespace'] != '') {\n $adapterNamespace = $config['adapterNamespace'];\n }\n unset($config['adapterNamespace']);\n }\n\n // TODO: Use a filter here\n $adapterName = $adapterNamespace . '_';\n $adapterName .= str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($adapter))));\n\n /*\n * Load the adapter class. This throws an exception\n * if the specified class cannot be loaded.\n */\n if (!class_exists($adapterName)) {\n require_once 'Zend/Loader.php';\n Zend_Loader::loadClass($adapterName);\n }\n\n /*\n * Create an instance of the adapter class.\n * Pass the config to the adapter class constructor.\n */\n $paymentAdapter = new $adapterName($config);\n\n /*\n * Verify that the object created is a descendent of the abstract adapter type.\n */\n if (!$paymentAdapter instanceof Galahad_Payment_Adapter_Abstract) {\n /**\n * @see Galahad_Payment_Exception\n */\n require_once 'Galahad/Payment/Exception.php';\n throw new Galahad_Payment_Exception(\"Adapter class '$adapterName' does not extend Galahad_Payment_Adapter_Abstract\");\n }\n\n return $paymentAdapter;\n }", "private function __construct()\n {\n require __DIR__ . \"/../config.php\";\n $this->setting = $confSettings;\n $this->adminLinks = $admin_link_array;\n $this->memberLinks = $member_link_array;\n }", "public function __construct()\n {\n // General\n $this->id = 'btcpay';\n $this->icon = plugin_dir_url(__FILE__).'assets/img/icon.png';\n $this->has_fields = false;\n $this->order_button_text = __('Proceed to BTCPay', 'btcpay-for-woocommerce');\n $this->method_title = 'BTCPay';\n $this->method_description = 'BTCPay allows you to accept bitcoin payments on your WooCommerce store.';\n\n // Load the settings.\n $this->init_form_fields();\n $this->init_settings();\n\n // Define user set variables\n $this->title = $this->get_option('title');\n $this->description = $this->get_option('description');\n $this->order_states = $this->get_option('order_states');\n $this->debug = 'yes' === $this->get_option('debug', 'no');\n\n // Define BitPay settings\n $this->api_key = get_option('woocommerce_btcpay_key');\n $this->api_pub = get_option('woocommerce_btcpay_pub');\n $this->api_sin = get_option('woocommerce_btcpay_sin');\n $this->api_token = get_option('woocommerce_btcpay_token');\n $this->api_token_label = get_option('woocommerce_btcpay_label');\n $this->api_url = get_option('woocommerce_btcpay_url');\n\n // Define debugging & informational settings\n $this->debug_php_version = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;\n $this->debug_plugin_version = constant(\"BTCPAY_VERSION\");\n\n $this->log('BTCPay Woocommerce payment plugin object constructor called. Plugin is v' . $this->debug_plugin_version . ' and server is PHP v' . $this->debug_php_version);\n $this->log(' [Info] $this->api_key = ' . $this->api_key);\n $this->log(' [Info] $this->api_pub = ' . $this->api_pub);\n $this->log(' [Info] $this->api_sin = ' . $this->api_sin);\n $this->log(' [Info] $this->api_token = ' . $this->api_token);\n $this->log(' [Info] $this->api_token_label = ' . $this->api_token_label);\n $this->log(' [Info] $this->api_url = ' . $this->api_url);\n\n // Process Credentials\n if (false === empty($this->api_key)) {\n try {\n $this->api_key = $this->btcpay_decrypt($this->api_key);\n\n if (false === empty($this->api_key)) {\n $this->log(' [Info] Private Key decrypted successfully.');\n } else {\n $this->log(' [Error] Private Key decrypted successfully BUT the value itself is null or empty!');\n }\n } catch (\\Exception $e) {\n $this->log(' [Error] Private Key corrupt. Message is: ' . $e->getMessage());\n }\n } else {\n\n }\n\n if (false === empty($this->api_pub)) {\n try {\n $this->api_pub = $this->btcpay_decrypt($this->api_pub);\n\n if (false === empty($this->api_pub)) {\n $this->log(' [Info] Public Key decrypted successfully.');\n } else {\n $this->log(' [Error] Public Key decrypted successfully BUT the value itself is null or empty!');\n }\n } catch (\\Exception $e) {\n $this->log(' [Error] Public Key corrupt. Message is: ' . $e->getMessage());\n }\n }\n\n if (false === empty($this->api_token)) {\n try {\n $this->api_token = $this->btcpay_decrypt($this->api_token);\n\n if (true === isset($this->api_token) && false === empty($this->api_token)) {\n $this->log(' [Info] API Token decrypted successfully.');\n } else {\n $this->log(' [Error] API Token decrypted successfully BUT the value itself is null or empty!');\n }\n } catch (\\Exception $e) {\n $this->log(' [Error] API Token corrupt. Message is: ' . $e->getMessage());\n }\n }\n\n // Check API Credentials\n if (!($this->api_key instanceof \\Bitpay\\PrivateKey)) {\n $this->api_key = null;\n $this->log(' [Error] The API Key was NOT an instance of PrivateKey! Instead, it appears to be a ' . gettype($this->api_key) . ' value.');\n }\n\n if (!($this->api_pub instanceof \\Bitpay\\PublicKey)) {\n $this->api_pub = null;\n $this->log(' [Error] The Public Key was NOT an instance of PublicKey! Instead, it appears to be a ' . gettype($this->api_pub) . ' value.');\n }\n\n if (!($this->api_token instanceof \\Bitpay\\Token)) {\n $this->api_token = null;\n $this->log(' [Error] The API Token was NOT an instance of Token! Instead, it appears to be a ' . gettype($this->api_token) . ' value.');\n }\n\n $this->transaction_speed = $this->get_option('transaction_speed');\n $this->log(' [Info] Transaction speed is now set to: ' . $this->transaction_speed);\n\n // Actions\n add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));\n add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'save_order_states'));\n\n // Valid for use and IPN Callback\n if (false === $this->is_valid_for_use()) {\n $this->enabled = 'no';\n $this->log(' [Info] The plugin is NOT valid for use!');\n } else {\n $this->enabled = 'yes';\n $this->log(' [Info] The plugin is ok to use.');\n add_action('woocommerce_api_wc_gateway_btcpay', array($this, 'ipn_callback'));\n }\n\n // Additional token initialization.\n if (btcpay_get_additional_tokens()) {\n $this->initialize_additional_tokens();\n }\n $this->is_initialized = true;\n }", "function wc_paypal_pro() {\n\t\tstatic $plugin;\n\n\t\tif ( ! isset( $plugin ) ) {\n\t\t\t$plugin = new WC_PayPal_Pro();\n\t\t}\n\n\t\treturn $plugin;\n\t}", "public function __construct($sandbox = true)\n {\n $this->setLibAutoloader();\n\n $this->headModel = new RatePAY\\ModelBuilder('Head');\n $this->contentModel = new RatePAY\\ModelBuilder('Content');\n $this->onlineRequest = new RatePAY\\RequestBuilder((bool) $sandbox);\n $this->offlineRequest = new RatePAY\\Service\\OfflineInstallmentCalculation();\n\n // Switch back to mage autoloader\n $this->removeLibAutoloader();\n }", "public function initialize($paymentAction, $stateObject)\n {\n switch ($paymentAction) {\n case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH:\n case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE:\n $payment = $this->getInfoInstance();\n $order = $payment->getOrder();\n $order->setCanSendNewEmailFlag(false);\n $payment->setAmountAuthorized($order->getTotalDue());\n $payment->setBaseAmountAuthorized($order->getBaseTotalDue());\n\n $this->_setPaymentFormUrl($payment);\n\n $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);\n $stateObject->setStatus('pending_payment');\n $stateObject->setIsNotified(false);\n break;\n default:\n break;\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 static function init() {\n\n\t\t// Add PayPal API fields to PayPal form fields as required\n\t\tadd_action( 'woocommerce_settings_start', __CLASS__ . '::add_form_fields', 100 );\n\t\tadd_action( 'woocommerce_api_wc_gateway_paypal', __CLASS__ . '::add_form_fields', 100 );\n\n\t\t// Handle requests to check whether a PayPal account has Reference Transactions enabled\n\t\tadd_action( 'admin_init', __CLASS__ . '::maybe_check_account' );\n\n\t\t// Maybe show notice to enter PayPal API credentials\n\t\tadd_action( 'admin_notices', __CLASS__ . '::maybe_show_admin_notices' );\n\n\t\t// Add the PayPal subscription information to the billing information\n\t\tadd_action( 'woocommerce_admin_order_data_after_billing_address', __CLASS__ . '::profile_link' );\n\n\t\t// Before WC updates the PayPal settings remove credentials error flag\n\t\tadd_action( 'load-woocommerce_page_wc-settings', __CLASS__ . '::maybe_update_credentials_error_flag', 9 );\n\t}", "public function __construct()\n {\n if (file_exists('bm-config.php')) {\n require_once('bm-config.php');\n } else if (file_exists('../bm-config.php')) {\n require_once('../bm-config.php');\n } else {\n $settings = array();\n }\n\n $defaults = array(\n 'cookie_name' => 'bm',\n 'debug' => false,\n 'use_wp_login' => false,\n 'session_duration' => 43200,// 12 hours\n 'log_directory' => '.',\n 'log_level' => 4,\n );\n $this->settings = array_merge($defaults, $settings);\n }", "protected function init()\n { \n // get remote config\n $this->_remoteConfig = Mage::helper('shoptimally_core/remoteConfig');\n \n // calculate enabled status\n $this->_isEnabled = ($this->getGeneralSetting('ShoptimallyEnabled')) &&\n (strlen($this->getApiKey()) > 0) &&\n $this->_remoteConfig->get(\"enabled\");\n \n // init shoptimally domain\n $this->_shoptimallyDomain = $this->_remoteConfig->get('shoptimally_domain');\n if (is_null($this->_shoptimallyDomain) || \n strlen($this->_shoptimallyDomain) == 0)\n {\n $this->_shoptimallyDomain = \"api1.shoptimally.com\"; \n }\n }", "public function __construct()\n\t{\n\t\t// Do never forget to call the parent __construct\n\t\tparent::__construct();\n\n\t\t// Config\n\t\tglobal $db;\n\t\t$config = $db->select('payment_sips_config, *');\n\t\t$this->config = $config[0];\n\n\t\t// Debug\n\t\tstatic $debug_once = false;\n\t\tif ((!$debug_once) && ($this->debug))\n\t\t{\n\t\t\t$table = new tableManager($this->config);\n\t\t\techo '<div><span style=\"font-weight:bold;color:grey;\">SIPS DEBUG : Config</span><br />'.$table->html(1).'</div>';\n\t\t\t$debug_once = true;\n\t\t}\n\t}", "public function __construct() {\n $this->secretKey = $GLOBALS['config']['secret_key'];\n $this->accessKey = $GLOBALS['config']['access_key'];\n $this->sellerId = $GLOBALS['config']['seller_id'];\n $this->signatureMethod = $GLOBALS['config']['signature_method'];\n $this->signatureVersion = $GLOBALS['config']['signature_version'];\n $this->marketplaceId = $GLOBALS['config']['marketplace_id'];\n $this->version = $GLOBALS['config']['version'];\n }", "function initialize() {\n $this->_configure = $this->config->item('biz_listing_configure');\n $this->_pagination = $this->config->item('pagination');\n $this->_validation = $this->config->item('biz_listing_validation');\n }", "public function __construct($config) {\n // Store some private vars based on the user's config\n $this->apiKey = $config['api_key'];\n $this->languageFrom = $config['language_from'];\n $this->languageTo = $config['language_to'];\n $this->maxCycles = $config['cycles'];\n }", "public function init($config);", "function __construct($settings = array()){\n\t\t$config = Configure::read('Bitly');\n\t\tif (empty($config)) {\n\t\t\t$config = array();\n\t\t}\n\n\t\t$this->_set($config);\n\t\t$this->_set($settings);\n\t}", "public function __construct()\r\n {\r\n $this->PROXY_HOST = '127.0.0.1';\r\n $this->PROXY_PORT = '808';\r\n $this->Env = \"sandbox\";\r\n $this->API_UserName = \"music2_1298365294_biz_api1.yahoo.com\";\r\n $this->API_Password = \"1298365304\";\r\n $this->API_Signature = \"AGvofgFr5KfTPLmgHXGvSxdUjiipALiplxLdQuq.GsgTLEvE0yswKLFb\";\r\n $this->API_AppID = \"APP-80W284485P519543T\";\r\n $this->API_Endpoint = \"\";\r\n $this->USE_PROXY = false;\r\n $this->preapprovalKey = \"\";\r\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 }", "static public function config($conf=array()){\n\t\tself::$account_id = (!empty($conf['account_id'])) ? $conf['account_id'] : OHT_API_ACCOUNT_ID;\n\t\tself::$secret_key = (!empty($conf['secret_key'])) ? $conf['secret_key'] : OHT_API_SECRET_KEY;\n\t\tself::$sandbox = (isset($conf['sandbox'])) ? (bool)$conf['sandbox'] : OHT_API_SANDBOX;\n\t\t\n\t}", "private function __construct() {\r\n\t\t// proc will grab a different column of settings values.\r\n\t\t$testing = (int) $this->config()->testing;\r\n\t\t\r\n\t\t$sql = \"CALL settings_get($testing)\";\r\n $rs = $this->query($sql);\r\n \r\n if ($this->hasError()) {\r\n error_log($this->getError());\r\n $this->error = \"Unable to load settings\";\r\n }\r\n \r\n if ($rs->hasRecords()) {\r\n\t\t\twhile ($row = $rs->fetchArray()) {\r\n\t\t\t\t$this->{$row['label']} = $row['value'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Handle secure cookies\r\n\t\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {\r\n\t\t\t\t$this->cookiesecure = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function __construct()\n {\n\t\t$this->ini_array = parse_ini_file(\"config.ini\", true);\n }", "public function __construct($requester, $returnUrl, $cancelUrl, $options = array(), $useSandbox = false) {\n $this->requester = $requester;\n $this->requireUrl($returnUrl);\n $this->requireUrl($cancelUrl);\n $this->requireOptions($options, array(\"USER\", \"PWD\", \"SIGNATURE\"));\n \n //Handle sandbox/not sandbox\n $this->apiUrl = \"https://api-3t.paypal.com/nvp\";\n $this->expressCheckoutUrl = \"https://www.paypal.com/cgi-bin/webscr\";\n if($useSandbox) {\n $this->apiUrl = \"https://api-3t.sandbox.paypal.com/nvp\";\n $this->expressCheckoutUrl = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n }\n $this->sandbox = $useSandbox;\n \n $this->returnUrl = $returnUrl;\n $this->cancelUrl = $cancelUrl;\n \n //Get options/reasonable defaults\n $this->options = array(\n \"VERSION\" => \"109.0\",\n \"SOLUTIONTYPE\" => \"Sole\",\n \"LANDINGPAGE\" => \"Billing\",\n \"PAYMENTREQUEST_0_PAYMENTACTION\" => \"Sale\",\n \"LOCALECODE\" => \"en_US\",\n \"PAYMENTREQUEST_0_CURRENCYCODE\" => \"USD\"\n );\n foreach($options as $key => $value) {\n $key = strtoupper($key);\n \n if($key == \"VERSION\" && $value != $this->options[\"VERSION\"]) {\n trigger_error(\"The PayPalAdapter is configured with a custom version '$value', but the library is only guaranteed to work with '{$this->options[\"VERSION\"]}'.\", E_USER_WARNING);\n }\n if($key == \"RETURNURL\" || $key == \"CANCELURL\") {\n throw new InvalidArgumentException(\"Cannot set $key in PayPalAdapter. It must be set as an argument in the constructor.\");\n }\n \n $this->options[$key] = $value;\n }\n }", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_StockFlow();\n $this->_modelName = 'Billing_Model_StockFlow';\n $this->_articleSupplyController = Billing_Controller_ArticleSupply::getInstance();\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\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}", "function __construct()\n\t{\n\t\t// Tai cac file thanh phan\n\t\t$this->load->language('payment_card/' . $this->code);\n\t\t\n\t\t// Them cac bien setting default vao setting\n\t\t$this->setting_data = array_merge($this->setting_default, $this->setting);\n\t\t\n\t\t// Cap nhat setting neu payment_card da duoc cai dat\n\t\tif (model('payment_card')->installed($this->code))\n\t\t{\n\t\t\t// Lay setting trong data\n\t\t\t$setting_data = model('payment_card')->get_setting($this->code);\n\t\t\t$this->setting_data = $setting_data;\n\t\t\t// Cap nhat gia tri tu setting trong data\n\t\t\tforeach ($setting_data as $key => $val)\n\t\t\t{\n\t\t\t if(!is_array($val))\n\t\t\t {\n\t\t\t $this->setting_data = array($this->setting_data);\n\t\t\t }\n\t\t\t break;\n\t\t\t}\n\t\t\t//lay tai khoan ket noi\t\n\t\t\t$this->_get_setting_cur();\n\t\t}\n\t}", "function show_configuration() {\n\n global $VM_LANG, $sess;\n\t\t$db = new ps_DB;\n\t\t$payment_method_id = vmGet( $_REQUEST, 'payment_method_id', null );\n\n\t\t$VM_LANG->load('arsenalpay');\n\t\t\t\n\t\t// Read current Configuration\n\t\tinclude_once(CLASSPATH .\"payment/ps_arsenalpay.cfg.php\");\n\t\t\t\t\n\t\t?>\n<p style=\"text-align: center;font-weight: bold;\"><?php echo $VM_LANG->_('ARSENALPAY_TITLE') ?></p>\n<p><?php echo $VM_LANG->_('ARSENALPAY_DESC') ?></p><br>\n<table>\t\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_UNIQUE_ID') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_UNIQUE_ID\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_UNIQUE_ID') ? AP_UNIQUE_ID : ''?>\"/></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_UNIQUE_ID_DESC')) ?></td>\n\t</tr>\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_SIGN_KEY') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_SIGN_KEY\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_SIGN_KEY') ? AP_SIGN_KEY : ''?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_SIGN_KEY_DESC'))?></td>\n\t</tr>\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_FRAME_URL') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_FRAME_URL\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_FRAME_URL') ? AP_FRAME_URL : 'https://arsenalpay.ru/payframe/pay.php' ?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_FRAME_URL_DESC'))?></td>\n\t</tr>\t\n\t<tr>\n <td><strong><?php echo $VM_LANG->_('ARSENALPAY_PAYMENT_SRC')?></strong></td>\n <td>\n\t\t\t<select name=\"AP_PAYMENT_SRC\" class=\"inputbox\" >\n <option <?php if (AP_PAYMENT_SRC == 'card') echo \"selected=\\\"selected\\\"\"; ?> value=\"card\">card</option>\n <option <?php if (AP_PAYMENT_SRC == 'mk') echo \"selected=\\\"selected\\\"\"; ?> value=\"mk\">mk</option>\n </select>\n </td>\n <td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_PAYMENT_SRC_DESC')) ?>\n </td>\n </tr>\n <tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_PAYER_CALLBACK_URL') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_PAYER_CALLBACK_URL\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_PAYER_CALLBACK_URL') ? AP_PAYER_CALLBACK_URL : 'http(s)://[joomla-site-domain]/administrator/components/com_virtuemart/arsenalpay_notify.php' ?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_PAYER_CALLBACK_URL_DESC'))?></td>\n\t</tr>\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_PAYMENT_CALLBACK_URL') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_PAYMENT_CALLBACK_URL\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_PAYMENT_CALLBACK_URL') ? AP_PAYMENT_CALLBACK_URL : 'http(s)://[joomla-site-domain]/administrator/components/com_virtuemart/arsenalpay_notify.php' ?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_PAYMENT_CALLBACK_URL_DESC'))?></td>\n\t</tr>\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_ALLOWED_IP') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_ALLOWED_IP\" class=\"inputbox\" value=\"<?php echo defined('AP_ALLOWED_IP') ? AP_ALLOWED_IP : '' ?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_ALLOWED_IP_DESC'))?></td>\n\t</tr>\n\t<tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_CSS_FILE') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_CSS_FILE\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_CSS_FILE') ? AP_CSS_FILE : '' ?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_CSS_FILE_DESC'))?></td>\n\t</tr>\n\t<tr>\n <td><strong><?php echo $VM_LANG->_('ARSENALPAY_FRAME_MODE')?></strong></td>\n <td>\n\t\t\t<select name=\"AP_FRAME_MODE\" class=\"inputbox\" >\n <option <?php if (AP_FRAME_MODE == '1') echo \"selected=\\\"selected\\\"\"; ?> value=\"1\">YES</option>\n <option <?php if (AP_FRAME_MODE == '0') echo \"selected=\\\"selected\\\"\"; ?> value=\"0\">NO</option>\n </select>\n </td>\n <td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_FRAME_MODE_DESC')) ?>\n </td>\n </tr>\n <tr>\n\t\t<td><strong><?php echo $VM_LANG->_('ARSENALPAY_FRAME_PARAMS') ?></strong></td>\n\t\t<td><input type=\"text\" name=\"AP_FRAME_PARAMS\" size=\"50\" class=\"inputbox\" value=\"<?php echo defined('AP_FRAME_PARAMS') ? AP_FRAME_PARAMS : \"width='700' height='500' frameborder='0' scrolling='auto'\"?>\" /></td>\n\t\t<td><?php echo vmtooltip($VM_LANG->_('ARSENALPAY_FRAME_PARAMS_DESC'))?></td>\n\t</tr>\n</table>\n\t\t<?php\n\t\treturn true;\n\t}", "public function __construct()\n {\n $this->_config = sspmod_janus_DiContainer::getInstance()->getConfig();\n }", "public function __construct()\n {\n $this->setMerchantD();\n $this->setMerchantKey();\n $this->setBaseUrl();\n $this->setBankTransferUrl();\n $this->setStatus(false);\n }", "public function __construct()\n {\n parent::__construct();\n CoinGate::config([\n 'app_id' => '5507',\n 'api_key' => '8aPuGKxTwVAr9ycZ3n2zvN',\n 'api_secret' => 'lgTBcsASv7a8QjxO1kC5nyHdI0qVJmeE',\n ]);\n }", "protected function _construct()\n {\n parent::_construct();\n $this->setTemplate('paypalplus/payment/info.phtml');\n }", "public function __construct()\n {\n $this->name = 'payneteasy';\n $this->tab = 'payments_gateways';\n $this->version = '1.0.0';\n $this->author = 'Artem Ponomarenko';\n $this->currencies_mode = 'radio';\n $this->submit_action = 'submit_' . $this->name;\n\n parent::__construct();\n\n $this->displayName = $this->l('PaynetEasy payment form');\n $this->description = $this->l('Accepts payments by credit cards with PaynetEasy payment form.');\n $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');\n }", "public function __construct(PaymentHelper $payment)\n {\n $this->payment_helper = $payment;\n $this->helper = new Helpers;\n }", "protected function _construct()\n {\n $this->_init('Dotpay\\Payment\\Model\\Resource\\Instruction');\n }", "public function _construct()\n {\n $this->_init('sellerplan/sellerplan', 'sellerplan_id');\n }", "public function __construct()\n\t\t{\n\t\t\t// Setup the required variables for the Protx Vps Direct checkout module\n\n\t\t\t$this->_languagePrefix = \"ProtxVspDirect\";\n\t\t\t$this->_id = \"checkout_vspdirect\";\n\t\t\t$this->_image = \"protx_logo.gif\";\n\n\t\t\tparent::__construct();\n\n\t\t\t$this->requiresSSL = true;\n\t\t\t$this->_currenciesSupported = array(\"GBP\");\n\t\t\t$this->_cardsSupported = array ('VISA','AMEX','MC', 'DINERS', 'DISCOVER', 'SOLO','MAESTRO','SWITCH','LASER');\n\t\t\t$this->_liveTransactionURL = 'https://ukvps.protx.com';\n\t\t\t$this->_testTransactionURL = 'https://ukvpstest.protx.com';\n\t\t\t$this->_liveTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_testTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_curlSupported = true;\n\t\t\t$this->_fsocksSupported = true;\n\t\t}" ]
[ "0.76908594", "0.7328332", "0.7209504", "0.7200372", "0.7177641", "0.7158414", "0.71389973", "0.712449", "0.70971227", "0.70776945", "0.7055535", "0.69846416", "0.68345803", "0.6833013", "0.6825782", "0.6820114", "0.68048567", "0.67796606", "0.6759061", "0.6759061", "0.6749729", "0.67336625", "0.67040116", "0.65632176", "0.6531144", "0.65063536", "0.6505009", "0.648137", "0.6434644", "0.6406453", "0.6406453", "0.64062953", "0.6377235", "0.63636166", "0.6348091", "0.6328248", "0.6314832", "0.6257044", "0.6187962", "0.6186958", "0.6182638", "0.6173785", "0.6163856", "0.6162826", "0.61625046", "0.6159912", "0.6153247", "0.6119741", "0.6119741", "0.61195534", "0.6105374", "0.6096743", "0.6081876", "0.60305893", "0.60223097", "0.6001695", "0.5997704", "0.59725386", "0.5957247", "0.5956169", "0.59525067", "0.59392244", "0.5923278", "0.59091634", "0.59081876", "0.58895934", "0.5888929", "0.5887775", "0.58682567", "0.58638215", "0.5856189", "0.58531886", "0.5846675", "0.5827333", "0.5824462", "0.5823005", "0.58229715", "0.58221066", "0.5821601", "0.57930535", "0.57865024", "0.5783938", "0.57832587", "0.5772808", "0.57667416", "0.57577235", "0.5753981", "0.5752907", "0.57490736", "0.574674", "0.5746028", "0.57441777", "0.5731732", "0.5730109", "0.57220304", "0.5714607", "0.57115704", "0.5708546", "0.5708153", "0.57080024", "0.57070625" ]
0.0
-1
Set another payment currency
public function setCurrency($currency) { $this->_currency = $currency; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCurrency(Currency|string $currency): self;", "public function setCurrency($currency){\n $this->currency = $currency;\n }", "public function setCurrency(string $currency);", "public function setCurrency($currency);", "private function setCurrency()\n {\n $currency = $this->em->getRepository('ClubUserBundle:LocationConfig')->getObjectByKey('default_currency',$this->order->getLocation());\n\n $this->order->setCurrency($currency);\n $this->order->setCurrencyValue(1);\n }", "function setCurrencyCode(){\n switch($this->Currency){\n case \"USD\": $this->CurrencyCode = 840;\n break;\n case \"EUR\": $this->CurrencyCode = 978;\n break;\n case \"AUD\": $this->CurrencyCode = 036;\n break;\n case \"CAD\": $this->CurrencyCode = 124;\n break;\n case \"GBP\": $this->CurrencyCode = 826;\n break;\n case \"JPY\": $this->CurrencyCode = 392;\n break;\n }// end switch\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n }", "public function setCurrency($currency) {\n\t\t$this->currency = $currency;\n\t}", "public function setCurrency($c)\n {\n $this->setOption('currency',$c);\n }", "public function setCurrencyCode($currencyCode);", "public static function set_currency($currency) {\n\t\tself::$currency = $currency;\n\t}", "public function setCurrency($currency = NULL) {\n if (($currency === NULL) || is_string($currency)) {\n $this->currency = $currency;\n }\n }", "public function setBaseCurrencyCode($code);", "public function setCurrency($currency)\n {\n return $this->setData(self::CURRENCY, $currency);\n }", "public function setGlobalCurrencyCode($code);", "public function setCurrency(?string $currency): self\n {\n $this->initialized['currency'] = true;\n $this->currency = $currency;\n\n return $this;\n }", "public function setCurrency(string $currency) : self\n {\n $this->currency = $currency;\n return $this;\n }", "public function setCurrency(string $currency) : self\n {\n $this->currency = $currency;\n return $this;\n }", "public function setCurrency(string $currency): self\n {\n $this->options['currency'] = $currency;\n return $this;\n }", "function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}", "function setCurrencyCode($currencycode) {\n\t\tif (strlen($currencycode) == 3) {\n\t\t\t$this->currencycode = $currencycode;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Currency Code\";\n\t\t}\n\t}", "public function setCurrency(?string $currency): self\n {\n $this->currency = $currency;\n\n return $this;\n }", "public function setCurrency(?string $currency): self\n {\n $this->currency = $currency;\n\n return $this;\n }", "public function getTargetCurrency();", "public function setCurrency(string $currency): self\n {\n $this->currency = $currency;\n\n return $this;\n }", "public function setCurrency($currency = 'USD')\n {\n $allowedCurrencies = ['AUD', 'BRL', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'INR', 'JPY', 'MYR', 'MXN', 'NOK', 'NZD', 'PHP', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'TWD', 'THB', 'USD', 'RUB'];\n\n // Check if provided currency is valid.\n if (!in_array($currency, $allowedCurrencies)) {\n throw new \\Exception('Currency is not supported by PayPal.');\n }\n\n $this->currency = $currency;\n\n return $this;\n }", "function updateCurrency($currency) {\n $el = $this->findElByCode($currency[\"code\"]);\n $el->rate = $currency[\"rate\"];\n $el->timestamp = $currency[\"timestamp\"];\n $this->writeCurrenciesToFile();\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n return $this;\n }", "public function setCurrency($currency) {\n\t\t$this->currency = $currency;\n\t\treturn $this;\n\t}", "public function setCoin(string $cryptoCoin);", "public function setStoreCurrencyCode($code);", "public function currency(string $currency): self\n {\n $this->set('currency', $currency);\n\n return $this;\n }", "public function setCurrency($currency)\n {\n $this::validateLength(self::SHIPPING_METHOD, $currency, 3);\n $this->currency = $currency;\n\n return $this;\n }", "public function set_currency($data)\n {\n $required = array(\n 'currency' => 'Currency code not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $currencyService = $this->di['mod_service']('currency');\n $currency = $currencyService->getByCode($data['currency']);\n if (!$currency instanceof \\Model_Currency) {\n throw new \\Box_Exception('Currency not found');\n }\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->changeCartCurrency($cart, $currency);\n }", "public function setCurrency($currency)\n {\n $this->currency = $this->limitLength($currency, 3);\n return $this;\n }", "public function setPayment($payment);", "public function setOrderCurrencyCode($code);", "public function setCurrency($var)\n {\n GPBUtil::checkInt32($var);\n $this->currency = $var;\n\n return $this;\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n\n return $this;\n }", "function ChangeCurrency($amount, $fromCurrency, $toCurrency)\n\t{\n\t\t$result = $this->sendRequest(\"ChangeCurrency\", array(\"Amount\"=>$amount, \"FromCurrency\"=>$fromCurrency, \"ToCurrency\"=>$toCurrency));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function setCurrency($currency)\n {\n if ($this->Status == 'Created') {\n $this->MoneyCurrency = $currency;\n }\n\n return $this;\n }", "public function setToCurrency($toCurrency)\n {\n $this->toCurrency = (string)$toCurrency;\n return $this;\n }", "public function setCurrency($currency = null)\n {\n // validation for constraint: string\n if (!is_null($currency) && !is_string($currency)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($currency)), __LINE__);\n }\n if (is_null($currency) || (is_array($currency) && empty($currency))) {\n unset($this->Currency);\n } else {\n $this->Currency = $currency;\n }\n return $this;\n }", "public function setTargetCurrency(CurrencyInterface $currency);", "public function setSourceCurrency(CurrencyInterface $currency);", "public function setPriceCurrency(?string $priceCurrency): self\n {\n $this->initialized['priceCurrency'] = true;\n $this->priceCurrency = $priceCurrency;\n\n return $this;\n }", "public static function useCurrency($currency, $symbol = null)\n {\n static::$currency = $currency;\n\n static::useCurrencySymbol($symbol ?: static::guessCurrencySymbol($currency));\n }", "public function pushTransactionCurrency($code)\n {\n $this->data['ecommerce']['currencyCode'] = $code;\n }", "function set_values() {\n\t\tparent::set_values();\n\t\t$currency = new currency($this->_currency_id);\n\t\t\n\t\t$this->order_id->value = $this->_order_id;\n\t\t$this->timestamp->value = date(\"j M Y\");\n\t\t$this->total_amount->value = $currency->format_money($this->_total_amount);\n\t}", "public function changeAmountCurrency($amount) {\n $amount_currency = $this->getConnectAmountCurrency();\n return ($amount*$amount_currency);\n }", "public function setPayment($value) {\n $this->payment = $value;\n }", "public function getCurrency(){\n return $this->currency;\n }", "public function save_currency() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_popup_currency\" );\n\n\t\tupdate_option( \"forminator_currency\", sanitize_text_field( $_POST['currency'] ) );\n\t\twp_send_json_success();\n\t}", "private function local_rate($currency)\n {\n switch ($currency) {\n case \"gbp\":\n $this->exchange_rate = 1;\n break;\n case \"usd\":\n $this->exchange_rate = 1.3;\n break;\n case \"eur\":\n $this->exchange_rate = 1.1;\n break;\n }\n }", "public function setDefaultCurrency(?string $defaultCurrency): self\n {\n $this->defaultCurrency = $defaultCurrency;\n\n return $this;\n }", "public static function useCurrencySymbol($symbol)\n {\n static::$currencySymbol = $symbol;\n }", "public function getCurrency(): Currency;", "public function setBaseCurrency(SetBaseCurrencyRequest $request)\n {\n $message = $this->exchange_service->updateUserBaseCurrency(\n auth()->user(),\n $request->base_currency\n )->message;\n return Responser::send(200, [], $message);\n }", "public function setCurrencyCode($value) \n {\n $this->_fields['CurrencyCode']['FieldValue'] = $value;\n return $this;\n }", "public function setCurrency($currency)\n {\n $correctCurrency = strtoupper($currency);\n if (!Currency::validate($correctCurrency)) {\n throw new CurrencyException($correctCurrency);\n }\n $this->currency = (string) $correctCurrency;\n\n return $this;\n }", "function eZProductCurrency( $id=-1 )\r\n {\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "public static function setCurrency(string $currency): void\n {\n $currency = strtolower($currency);\n\n if (! array_key_exists($currency, static::getCurrencies())) {\n throw new InvalidCurrencyException(\"The [{$currency}] currency is not registered.\");\n }\n\n static::$currency = $currency;\n }", "function calculateCurrency($prijs, $country)\r\n {\r\n }", "public function setRate($rate, $currencyCode = null){\n $this->rate = (string) $rate;\n $this->currencyCode = (string) $currencyCode;\n }", "public function update_currency($currency_identifier = FALSE)\r\n\t{\r\n\t\t// Check the currency table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('currency'))\r\n\t\t{\r\n\t\t\t$currency_data = $this->get_database_currency_data($currency_identifier);\r\n\t\t}\r\n\t\t\t\r\n\t\t// If no currency data has been set by the database lookup, get default values set via config file.\r\n\t\tif (empty($currency_data))\r\n\t\t{\r\n\t\t\t$currency_data = array(\r\n\t\t\t\t'name' => (! empty($this->flexi->cart_defaults['currency']['name'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['name'] : 'Currency',\r\n\t\t\t\t'exchange_rate' => (! empty($this->flexi->cart_defaults['currency']['exchange_rate'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['exchange_rate'] : 1,\r\n\t\t\t\t'symbol' => (! empty($this->flexi->cart_defaults['currency']['symbol'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['symbol'] : '&curren;',\r\n\t\t\t\t'symbol_suffix' => (! empty($this->flexi->cart_defaults['currency']['symbol_suffix'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['symbol_suffix'] : FALSE,\r\n\t\t\t\t'thousand_separator' => (! empty($this->flexi->cart_defaults['currency']['thousand_separator'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['thousand_separator'] : ',',\r\n\t\t\t\t'decimal_separator' => (! empty($this->flexi->cart_defaults['currency']['decimal_separator'])) ? \r\n\t\t\t\t\t$this->flexi->cart_defaults['currency']['decimal_separator'] : '.',\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\t### Currency data is now set, even if its a default value.\r\n\t\t\r\n\t\t// Set currency data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['currency']['name'] = $currency_data['name'];\r\n\t\t$this->flexi->cart_contents['settings']['currency']['exchange_rate'] = $currency_data['exchange_rate'];\r\n\t\t$this->flexi->cart_contents['settings']['currency']['symbol'] = $currency_data['symbol'];\r\n\t\t$this->flexi->cart_contents['settings']['currency']['symbol_suffix'] = (bool)$currency_data['symbol_suffix'];\r\n\t\t$this->flexi->cart_contents['settings']['currency']['thousand_separator'] = $currency_data['thousand_separator'];\r\n\t\t$this->flexi->cart_contents['settings']['currency']['decimal_separator'] = $currency_data['decimal_separator'];\r\n\r\n\t\t// If the carts internal default currency settings have not been set (On cart session being initially set).\r\n\t\tif (! isset($this->flexi->cart_contents['settings']['currency']['default']))\r\n\t\t{\r\n\t\t\t$this->flexi->cart_contents['settings']['currency']['default'] = $this->flexi->cart_contents['settings']['currency'];\r\n\t\t\tunset($this->flexi->cart_contents['settings']['currency']['default']['exchange_rate']);\r\n\t\t}\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function setRate(string $currency, float $rate)\n {\n $this->rates[$currency] = $rate;\n }", "public function setPrice($type = 'plain', $value, $currency_id = null, $primary = 0, $manual = 1)\n {\n if ( !$currency_id )\n $currency_id = self::getActiveCurrencyId();\n \n \t$money = new Money([\n \t\t'amount' => $value,\n \t\t'type' => $type,\n \t\t'currency_id' => $currency_id,\n 'manual' => $manual,\n 'primary' => $primary\n \t\t]);\n\n \t$this->price()->save($money);\n }", "public function setBaseCurrency(string $baseCurrency): ConversionResult\n {\n if (!isset($this->conversionRates[$baseCurrency])) {\n throw new CurrencyException(\"No conversion result for '$baseCurrency'!\");\n }\n\n if ($baseCurrency == $this->originalBaseCurrency) {\n $this->conversionRates = $this->originalConversionRates;\n return $this;\n }\n\n // Calculate new conversion rates.\n foreach ($this->originalConversionRates as $currency => $rate) {\n $this->conversionRates[$currency] = (float)$rate / (float)$this->originalConversionRates[$baseCurrency];\n }\n\n // Set new base currency.\n $this->baseCurrency = $baseCurrency;\n $this->conversionRates[$baseCurrency] = 1.0;\n\n // Return self\n return $this;\n }", "private function __getCurrency()\n\t{\n\t\tif($this->currency == null)\n\t\t$this->currency = 1;\n\t\treturn $this->currency;\n\t}", "public function SetPreferredCurrency(EcommerceCurrency $currency)\n {\n if ($this->owner->exists()) {\n if ($currency && $currency->exists()) {\n $this->owner->PreferredCurrencyID = $currency->ID;\n $this->owner->write();\n }\n }\n }", "public function convert($amount, Currency $currency);", "public function setPrice(Currency $price)\n {\n $this->values['Price'] = $price;\n return $this;\n }", "public function formatCurrency($amount);", "public function currency($value) {\n $this->annotations['currency'] = $value;\n return $this;\n }", "public function setCurrency(string $currency): TransactionRequest\n {\n $this->currency = $currency;\n return $this;\n }", "public function preferredCurrency()\n {\n return config('cashier.currency');\n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function setCurrency(string $currency): AmountBuilderInterface\n {\n $this->amount->setCurrency($currency);\n\n return $this;\n }", "public function setCurrencyCode($value)\n {\n $this->_fields['CurrencyCode']['FieldValue'] = $value;\n return $this;\n }", "public function getSourceCurrency();", "public function getCurrency();", "public function getCurrency();", "public function set_manual_currency($currency_data = FALSE)\r\n\t{\r\n\t\tif (is_array($currency_data) && ! empty($currency_data))\r\n\t\t{\r\n\t\t\t// Loop through data and set to cart session summary \r\n\t\t\tforeach($currency_data as $column => $column_value)\r\n\t\t\t{\r\n\t\t\t\tif ($column == 'exchange_rate')\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check currency is a postive number\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['currency']['exchange_rate'] = ($column_value >= 0) ? \r\n\t\t\t\t\t\t$this->format_calculation($column_value, 2, TRUE) : 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if (isset($this->flexi->cart_contents['settings']['currency'][$column]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['currency'][$column] = $column_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function setAmount($amount){\n\n $this->amount = $amount;\n\n }", "function setSymbol( $value )\r\n {\r\n $this->CurrencySymbol = $value;\r\n }", "public function maybe_update_currency_to_euro() {\n global $wpdb;\n\n $current_version = $this->config->get( 'version' );\n\n // check, if the current version is greater than or equal 0.9.8\n if ( version_compare( $current_version, '0.9.8', '>=' ) ) {\n\n // map old values to new ones\n $meta_key_mapping = array(\n 'Teaser content' => 'laterpay_post_teaser',\n 'Pricing Post' => 'laterpay_post_pricing',\n 'Pricing Post Type' => 'laterpay_post_pricing_type',\n );\n\n $this->logger->info(\n __METHOD__,\n array(\n 'current_version' => $current_version,\n 'meta_key_mapping' => $meta_key_mapping,\n )\n );\n\n // update the currency to default currency 'EUR'\n update_option( 'laterpay_currency', $this->config->get( 'currency.default' ) );\n\n // remove currency table\n $sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'laterpay_currency';\n $wpdb->query( $sql );\n }\n }", "public function __construct(Money $rate)\n {\n $this->rate = $rate;\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function setCurrencyID($currencyID)\n {\n $this->currencyID = $currencyID;\n return $this;\n }", "public static function of(string $amount, Currency|string|null $currency = null): Money;", "function acadp_get_payment_currency() {\n\n\t$currency_settings = acadp_get_payment_currency_settings();\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\n\treturn strtoupper( $currency );\n\n}", "function currSetCurrentCurrency($currencyID)\r\n{\r\n $_SESSION[\"current_currency\"] = (int)$currencyID;\r\n\r\n if (isset($_SESSION[\"log\"])) {\r\n db_query(\"UPDATE \" . CUSTOMERS_TABLE . \" SET CID=\" . (int)$currencyID .\r\n \" WHERE Login='\" . xEscSQL($_SESSION[\"log\"]) . \"'\");\r\n }\r\n}", "public function setCurrencySymbol($currencySymbol)\n {\n $this->currencySymbol = $currencySymbol;\n return $this;\n }", "function select_payment($idpaket){\n $cek = $this->model_payment->fetch_paket_by_id($idpaket);\n if($cek == null){\n redirect(\"payment/pilih_tagihan\");\n }\n $idsiswa = $this->session->userdata(\"id_siswa\");\n\n //set billing (id_paket di dalam tabel siswa)\n $setbill = $this->model_payment->edit_paket_siswa($idsiswa, $idpaket);\n\n if($setbill){\n redirect(\"payment/tagihan\");\n }\n}", "public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }", "public function currency($currency) {\n Varien_Profiler::start('locale/currency');\n if (!isset(self::$_currencyCache[$this->getLocaleCode()][$currency])) {\n try {\n $currencyObject = new Zend_Currency($currency, $this->getLocale());\n } catch (Exception $e) {\n $currencyObject = new Zend_Currency($this->getCurrency(), $this->getLocale());\n $options = array(\n 'name' => $currency,\n 'currency' => $currency,\n 'symbol' => $currency\n );\n $currencyObject->setFormat($options);\n }\n\n if(isset(self::$_currencySetup[$currency])) {\n $format = self::$_currencySetup[$currency];\n\n $format['position'] = $format['position'] == 'right' ?\n $currencyObject::RIGHT : $currencyObject::LEFT;\n $format['display'] = $currencyObject::USE_SYMBOL;\n\n $currencyObject->setFormat($format);\n }\n\n self::$_currencyCache[$this->getLocaleCode()][$currency] = $currencyObject;\n }\n Varien_Profiler::stop('locale/currency');\n return self::$_currencyCache[$this->getLocaleCode()][$currency];\n }", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();" ]
[ "0.76318496", "0.7594078", "0.7521203", "0.7491034", "0.72441393", "0.71843463", "0.7130317", "0.7130317", "0.70637923", "0.70415807", "0.6912305", "0.69078326", "0.6853418", "0.6732537", "0.66304487", "0.6595902", "0.65058446", "0.6468904", "0.6468904", "0.64568794", "0.6394014", "0.6394014", "0.6381888", "0.6381888", "0.6379596", "0.6369752", "0.63493496", "0.6322173", "0.63203764", "0.6272966", "0.6230856", "0.6167483", "0.6159627", "0.6131038", "0.6112848", "0.60864234", "0.6080755", "0.60666955", "0.603427", "0.6030688", "0.60290694", "0.5985933", "0.59832877", "0.5954365", "0.5951316", "0.590902", "0.5890457", "0.5884931", "0.5882953", "0.5863615", "0.5857612", "0.58347034", "0.583334", "0.58247113", "0.58191496", "0.5784789", "0.5770234", "0.5757339", "0.57330644", "0.5724773", "0.5723693", "0.57083786", "0.5702956", "0.5670846", "0.5661422", "0.5647386", "0.5643644", "0.5635852", "0.56346345", "0.56271935", "0.56130135", "0.56089944", "0.5603793", "0.5601731", "0.56012094", "0.5589285", "0.55876535", "0.55806816", "0.55581", "0.55457383", "0.5545497", "0.5537851", "0.5537851", "0.55253714", "0.552388", "0.5496636", "0.5493324", "0.5490623", "0.548538", "0.5482445", "0.54800946", "0.5477764", "0.5467092", "0.5457918", "0.5446386", "0.5445587", "0.5444611", "0.54439133", "0.54439133", "0.54439133" ]
0.7026823
10
Url to redirect user after success payment, must be set
public function setReturnUrl($url) { $this->_url_return = $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function getOrderPlaceRedirectUrl()\n {\n //The form of the Payment Gateway will be displayed to him\n return Mage::getUrl('mypaymentmethod1/payment/redirect', array('_secure' => false));\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('pagseguro/payment/request');\n }", "public function redirectAction()\n\t\t{\n\t\t\t// Load /app/code/community/Mage/Idealcheckoutdirectebanking/Model/Idealcheckoutdirectebanking.php\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\n\t\t\t// Create transaction record and get URL to /idealcheckoutdirectebanking/setup.php\n\t\t\t$sIdealcheckoutdirectebankingUrl = $oIdealcheckoutdirectebankingModel->setupPayment();\n\n\n\t\t\t// redirect\n\t\t\theader('Location: ' . $sIdealcheckoutdirectebankingUrl);\n\t\t\texit();\n\t\t}", "public function getOrderPlaceRedirectUrl()\n {\n if($this->_getHelper()->isRedirectMode()) {\n $paymentUrl = Mage::getSingleton('core/session')->getPicpayPaymentUrl();\n\n if ($paymentUrl) {\n return $paymentUrl;\n }\n else {\n Mage::throwException($this->_getHelper()->__(\"Invalid payment url\"));\n }\n }\n\n $isSecure = Mage::app()->getStore()->isCurrentlySecure();\n return Mage::getUrl('checkout/onepage/success', array('_secure' => $isSecure));\n }", "public function successAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t}", "public function getOrderPlaceRedirectUrl()\n\t{\n return Mage::getUrl('hostedpayments/processing/pay');\n\t}", "private function getDefaultSuccessPageUrl()\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\treturn $this->urlBuilder->getUrl('quotation/quote/success/');\n\t\t}\n\t}", "public function getRedirectUrl()\n {\n return $this->request->getTestMode()\n ? 'https://sslpayment.cathaybkdev.com.tw/EPOSService/Payment/OrderInitial.aspx'\n : 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx';\n }", "public function getSuccessUrl();", "public function needsRedirectToPayment() {\n $haPagado = $this->hasPaid();\n $renewTime = $this->timeFreameToRenewLicense();\n $mustPay = $this->mustPay();\n $optPayment = $this->hasOptionalPayment();\n $url = false;\n $temporary = $this->isTemporary() || $this->hasTemporaryPayment();\n $invoice = $this->hasInvoicesNotPayedFrameTime(true);\n\n if ($temporary && $this->isPremium()) {\n $url = \"/app/payment/temporary\";\n } elseif ($haPagado && $mustPay && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice && $invoice->getDaysToClose() < 0) {\n $url = \"/app/payment/invoice\";\n } elseif ($haPagado && $renewTime && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice) {\n $url = \"/app/payment/invoice\";\n }\n\n return $url;\n }", "protected function defaultSuccessUrl()\n {\n return $this->user->getReturnUrl();\n }", "protected function success_redirect()\n {\n tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));\n }", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setAlipayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n if (!$order->getId()) {\n $this->norouteAction();\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('alipay')->__('客户跳转到支付宝网站')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('alipay/redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('postfinancecheckout/transaction/redirect', array(\n '_secure' => true\n ));\n }", "public function redirectAction()\n {\n $this->getResponse()->setBody($this->getLayout()->createBlock('paymentsensegateway/redirect')->toHtml());\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('paynovapayment/processing/payment');\n }", "public function successAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n try {\n $quoteId = $event->successEvent();\n $this->_getCheckout()->setLastSuccessQuoteId($quoteId);\n $this->_redirect('checkout/onepage/success');\n return;\n } catch (Mage_Core_Exception $e) {\n $this->_getCheckout()->addError($e->getMessage());\n } catch(Exception $e) {\n Mage::logException($e);\n }\n $this->_redirect('checkout/cart');\n }", "public function stripeSignup()\n {\n $connect_url = Config::STRIPE_CONNECT;\n return \"<script> window.location.href = '$connect_url'; </script>\";\n }", "public function redirecturl()\n\t\t\t{\n\t\t\t\tif($this->fields_arr['pcakey'])\n\t\t\t\t Redirect2URL($_SESSION['pcakey'][$this->fields_arr['pcakey']]);\n\t\t\t}", "public function getOrderPlaceRedirectUrl()\n {\n return $this->getConfig()->getPaymentRedirectUrl();\n }", "public function paymentComplete() {\n\t\t$usersTable = TableRegistry::get('Users');\n\t\t$user = $usersTable->get($this->Auth->user('id'))->toArray();\n\t\t$this->Auth->setUser($user);\n\t\t$this->Flash->success(__('Payment successful.'));\n\t\treturn $this->redirect(['controller' => 'Users', 'action' => 'billing']);\n\t}", "public function redirectAction() \n\t{\n\t\t$session = Mage::getSingleton('checkout/session');\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusToHistory($order->getStatus(), Mage::helper('payza')->__('Customer was redirected to Payza.'));\n $order->save();\n\t\t\n\t\t$this->loadLayout();\n $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','payza',array('template' => 'payza/redirect.phtml'));\n\t\t$this->getLayout()->getBlock('content')->append($block);\n $this->renderLayout();\n\t}", "public function redirect();", "public function redirect();", "public function redirect();", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setCriptopayStandardQuoteId($session->getQuoteId());\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('criptopay')->__('Customer was redirected to CriptoPay')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('criptopay/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "abstract public function getPaymentPageUrl();", "private function _redirect()\n\t{\n\n\t\t$this->_urlPagSeguro = $this->request->post['url_ps'];\n\n\t\tif (!empty($this->_urlPagSeguro )) {\n\t\t\theader('Location: ' . $this->_urlPagSeguro);\n\t\t\t$this->cart->clear();\n\t\t}\n\t}", "protected function setPaymentSuccessUrl($id, $data = array())\n\t{\n\t\t$Itemid = JFactory::getApplication()->input->get->getInt('Itemid', DonationHelper::getItemid());\n\n\t\t$this->paymentSuccessUrl = JRoute::_('index.php?option=com_osproperty&task=payment_return&order_id='.$id);//JRoute::_(DonationHelperRoute::getDonationCompleteRoute($id, 0, $Itemid), false);\n\t}", "public function checkAndRedirectUserToFinishUrl(){\n if(isset($_COOKIE['wc_midtrans_last_order_finish_url'])){\n // authorized transacting-user\n wp_redirect($_COOKIE['wc_midtrans_last_order_finish_url']);\n }else{\n // else, unauthorized user, redirect to shop homepage by default.\n wp_redirect( get_permalink( wc_get_page_id( 'shop' ) ) );\n }\n }", "function paypal_success()\n {\n $this->session->set_flashdata('alert', 'paypal_success');\n redirect(base_url() . 'home/invoice/'.$this->session->userdata('payment_id'), 'refresh');\n $this->session->set_userdata('payment_id', '');\n }", "public function callbackSuccess()\n {\n $this->redirectTo();\n }", "public function returnAction() \n\t\t{\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\t\t\t$sOrderId = $this->getRequest()->get('order_id');\n\t\t\t$sOrderCode = $this->getRequest()->get('order_code');\n\n\t\t\tif($oIdealcheckoutdirectebankingModel->validatePayment($sOrderId, $sOrderCode))\n\t\t\t{ \n\t\t\t\t$this->_redirect('checkout/onepage/success', array('_secure' => true));\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t} \n\t\t}", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "protected function success() {\r\n $this->redirect();\r\n }", "public function callbacktransparentredirectAction()\n {\n $model = Mage::getModel('paymentsensegateway/direct');\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n \n \n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $szPaREQ = $this->getRequest()->getParams('Oper');\n $szPaRES = $this->getRequest()->getParams('TotalPagado');\n $nStatusCode = $this->getRequest()->getParams('Razon');\n \n if($szPaREQ && $szPaRES != 0)\n {\n self::_paymentComplete($szPaREQ, $szPaRES, $nStatusCode);\n }\n \n else\n {\n $error = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_260;\n Mage::logException($exc);\n \n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Transparent Redirect Payment Failed'));\n $order->setState($orderState, $orderStatus, $nStatusCode, false);\n $order->save();\n \n \n Mage::getSingleton('core/session')->addError($error);\n \n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n \n \n \n }", "function give_custom_pp_pro_redirect( $success_page ) {\n\n\t$form_id = isset( $_REQUEST['give-form-id'] ) ? sanitize_text_field($_REQUEST['give-form-id']) : '';\n\t$gateway = isset( $_REQUEST['payment-mode'] ) ? sanitize_text_field($_REQUEST['payment-mode']) : 'manual';\n\n\t$form_success_page = give_get_meta( $form_id, 'give_custom_pp_redirects_fields_pro_success_page', true );\n\n\t$pp_pro_gateways = array('paypalpro_payflow', 'paypalpro', 'paypalpro_rest');\n\n\t// If this donation form has a custom PP Standard success page.\n\tif ( ! empty( $form_success_page ) && in_array($gateway, $pp_pro_gateways) ) {\n\t\t$success_page = get_permalink( $form_success_page );\n\t}\n\n\treturn $success_page;\n\n}", "public function getOrderPlaceRedirectUrl()\n {\n if (Mage::getStoreConfig('payment/bitcoin/fullscreen')) {\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => true));\n }else{\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => false));\n }\n return $target_url;\n } else {\n return '';\n }\n }", "public function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->payment->links[1]->getHref();\r\n\t}", "public function getPaymentUrl(){\n\t\t$order = $this->getOrder();\n\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t$hostedpayment->load($order->getRealOrderId(), 'order_id');\n\t\t\n\t\t$paymentUrl = $hostedpayment->getUrl();\n\t\t\t\t\n\t\tif(!isset($paymentUrl) || trim($paymentUrl) == '' ){\n\t\t\t$paymentUrl = EvoSnapApi::getCheckoutUrl($this->_getOrderCheckout(),\n\t\t\t\t\t$this->getTrigger3ds(), $this->getHostedPaymentsConfiguration());\n\t\t\t\t\n\t\t\t$order->addStatusToHistory($order->getStatus(), Mage::helper('hostedpayments')->__('Customer was redirected to the Snap* Hosted Payments Checkout for payment.'));\n\t\t\t$order->save();\n\t\t\t\n\t\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t\t$hostedpayment->setOrderId($order->getRealOrderId());\n\t\t\t$hostedpayment->setUrl($paymentUrl);\n\t\t\t$hostedpayment->setPrefix($this->getConfigData('order_prefix'));\n\t\t\t$hostedpayment->setDataChanges(true);\n\t\t\t$hostedpayment->save();\n\t\t}\n\t\t\n\t\treturn $paymentUrl;\n\t}", "public function pay(\\OpenPayU_Result $order)\n {\n return new RedirectResponse($order->getResponse()->redirectUri);\n }", "function redirectPayment($baseUri, $amount_iUSD, $amount, $currencySymbol, $api_key, $redirect_url) {\n error_log(\"Entered into auto submit-form\");\n error_log(\"Url \".$baseUri . \"?api_key=\" . $api_key);\n // Using Auto-submit form to redirect user\n return \"<form id='form' method='post' action='\". $baseUri . \"?api_key=\" . $api_key.\"'>\".\n \"<input type='hidden' autocomplete='off' name='amount' value='\".$amount.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='amount_iUSD' value='\".$amount_iUSD.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='callBackUrl' value='\".$redirect_url.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='api_key' value='\".$api_key.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='cur' value='\".$currencySymbol.\"'/>\".\n \"</form>\".\n \"<script type='text/javascript'>\".\n \"document.getElementById('form').submit();\".\n \"</script>\";\n}", "public function getOrderPlaceRedirectUrl()\r\n {\r\n \t$result = false;\r\n \t$session = Mage::getSingleton('checkout/session');\r\n \t$nVersion = $this->getVersion();\r\n \t$mode = $this->getConfigData('mode');\r\n \t\r\n \tif($session->getMd() &&\r\n \t\t$session->getAcsurl() &&\r\n \t\t$session->getPareq())\r\n \t{\r\n \t\t// Direct (API) for 3D Secure payments\r\n \t\tif($nVersion >= 1410)\r\n\t \t{\r\n\t\t \t// need to re-add the ordered item quantity to stock as per not completed 3DS transaction\r\n\t\t \tif($mode != Paymentsense_Paymentsensegateway_Model_Source_PaymentMode::PAYMENT_MODE_TRANSPARENT_REDIRECT)\r\n\t\t \t{\r\n\t\t \t\t$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());\r\n\t\t \t\t$this->addOrderedItemsToStock($order);\r\n\t\t \t}\r\n\t \t}\r\n \t\t\r\n \t\t$result = Mage::getUrl('paymentsensegateway/payment/threedsecure', array('_secure' => true));\r\n \t}\r\n \tif($session->getHashdigest())\r\n \t{\r\n \t\t// Hosted Payment Form and Transparent Redirect payments\r\n \t\tif($nVersion >= 1410)\r\n\t \t{\r\n\t\t \t// need to re-add the ordered item quantity to stock as per not completed 3DS transaction\r\n\t\t \tif(!Mage::getSingleton('checkout/session')->getPares())\r\n\t\t \t{\r\n\t\t \t\t$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());\r\n\t\t \t\t$this->addOrderedItemsToStock($order);\r\n\t\t \t}\r\n\t \t}\r\n \t\r\n \t\t$result = Mage::getUrl('paymentsensegateway/payment/redirect', array('_secure' => true));\r\n \t}\r\n \r\n return $result;\r\n }", "public function redirectAction()\n {\n\t\t\n $session = Mage::getSingleton('checkout/session');\n $session->setHdfcStandardQuoteId($session->getQuoteId());\n\t\t$order = $this->getOrder();\n\t\t\n \n if (!$order->getId()) {\n\t\t\n\t\t\t$this->_forward('failurerefresh');\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('hdfc')->__('Customer was redirected to hdfc')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('hdfc/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "public function redirectAction()\n {\n $redirectParams = $this->getRequest()->getParams();\n $params = array();\n if (!empty($redirectParams['success'])\n && isset($redirectParams['x_invoice_num'])\n && isset($redirectParams['controller_action_name'])\n ) {\n $params['redirect_parent'] = Mage::helper('authorizenet/admin')->getSuccessOrderUrl($redirectParams);\n $this->_getDirectPostSession()->unsetData('quote_id');\n //cancel old order\n $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder();\n if ($oldOrder->getId()) {\n /* @var $order Mage_Sales_Model_Order */\n $order = Mage::getModel('sales/order')->loadByIncrementId($redirectParams['x_invoice_num']);\n if ($order->getId()) {\n $oldOrder->cancel()\n ->save();\n $order->save();\n $this->_getOrderCreateModel()->getSession()->unsOrderId();\n }\n }\n //clear sessions\n $this->_getSession()->clear();\n $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']);\n Mage::getSingleton('adminhtml/session')->clear();\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));\n }\n\n if (!empty($redirectParams['error_msg'])) {\n $cancelOrder = empty($redirectParams['x_invoice_num']);\n $this->_returnQuote($cancelOrder, $redirectParams['error_msg']);\n }\n\n $block = $this->getLayout()\n ->createBlock('directpost/iframe')\n ->setParams(array_merge($params, $redirectParams));\n $this->getResponse()->setBody($block->toHtml());\n }", "public function redirectTo();", "public function makeReturnUrl() {}", "public function creditredirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setAlipayPaymentCreditId($session->getCreditLastOrderId());\n\n $creditorder = $this->getCreditOrder();\n\n if (!$creditorder->getId()) {\n $this->norouteAction();\n return;\n }\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('alipay/creditredirect')\n ->setCreditOrder($creditorder)\n ->toHtml());\n\n }", "public function getReturnUrl()\n {\n return Mage::getUrl('payulite/processing/return', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function sendRedirect() {}", "public function redirect(){\r\n\t}", "public function callbackSuccess()\r\n {\r\n $this->redirectTo('question/user/'.$this->Value('uid') . \"/infouppdaterat\");\r\n }", "function thim_learnpress_checkout_free_course() {\n\treturn add_query_arg( 'redirect_to', 'http://' . $_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"], thim_get_login_page_url() );\n}", "public function seller_thanx() {\n\t\tLog::info ( 'Seller has been successfully redirected to Payment Page:' . $this->user_pk, array (\n\t\t\t\t'c' => '1' \n\t\t) );\n\t\tDB::table('users')->where('id',$this->user_pk)->update(['is_business'=>1]);\n\t\treturn view ( 'thankyou.seller_pay' );\n\t}", "public function redirect() {\n\n if (isset($_GET['view'])) {\n $view = \"view=\" . $_GET['view'];\n } else {\n $view = \"view=return\";\n }\n\n $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];\n header(\"Location: \" . $return_url);\n }", "public function getRedirectUrl()\n {\n\n if ($brandCode = $this->getBrandCode()) {\n return 'https://test.adyen.com/hpp/skipDetails.shtml';\n } else {\n return 'https://test.adyen.com/hpp/pay.shtml';\n }\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "public function getRedirectUrl()\n {\n }", "public function redirectToPayment($token)\n {\n header(\"Location: $this->paymentApiUrl/payment?data=$token\");\n exit;\n }", "public function redirectToGateway()\n {\n return Paystack::getAuthorizationUrl()->redirectNow();\n }", "public function redirectToGateway()\n {\n return Paystack::getAuthorizationUrl()->redirectNow();\n }", "public function redirectToGateway()\n {\n return Paystack::getAuthorizationUrl()->redirectNow();\n }", "public function redirectToGateway()\n {\n return Paystack::getAuthorizationUrl()->redirectNow();\n }", "protected function getRedirectUrl()\n\t{\n if ($customURL = $this->input->getBase64('returnurl', ''))\n {\n $customURL = base64_decode($customURL);\n }\n\n $url = !empty($customURL) ? $customURL : 'index.php?option='\n . $this->container->componentName\n . '&view='\n . $this->container->inflector->pluralize($this->view)\n . $this->getItemidURLSuffix(); // e.g. '&Itemid=123' or an empty string if no Itemid\n\n return $url;\n }", "protected function getRedirectUrl()\n {\n $sBaseUrl = Registry::getConfig()->getCurrentShopUrl().'index.php?cl=order&fnc=handleMollieReturn';\n\n return $sBaseUrl.$this->mollieGetAdditionalParameters();\n }", "public function redirectToGateway()\n {\n $paystack = new Paystack();\n return $paystack->getAuthorizationUrl()->redirectNow();\n }", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl()\r\n {\r\n return \"{$this->data['redirect_url']}?session={$this->data['session']}\";\r\n }", "public function redirectAction() {\n $session = Mage::getSingleton('chargepayment/session_quote');\n $redirectUrl = $session->getHostedPaymentRedirect();\n\n if (empty($redirectUrl)) {\n $this->norouteAction();\n return $this;\n }\n\n $this->loadLayout();\n $this->renderLayout();\n }", "function give_custom_pp_standard_redirect( $paypal_args, $payment_data ) {\n\t$form_id = intval( $payment_data['post_data']['give-form-id'] );\n\t$form_success_page = give_get_meta( $form_id, 'give_custom_pp_redirects_fields_standard_success_page', true );\n\n\t// If this donation form has a custom PP Standard success page.\n\tif ( ! empty( $form_success_page ) ) {\n\t\t$paypal_args['return'] = get_permalink( $form_success_page );\n\t}\n\n\treturn $paypal_args;\n\n}", "public function RedirectURL(){\n //echo Director::baseURL();exit(); \n return urlencode(Director::baseURL().$this->request->getURL(true));\n }", "public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}", "public function kick_pro_suc(){\n\n\t\tif (empty($_GET['order_success'])) {\n\n\t\t\t$this->redirect_to('index.php');\n\t\t}\n\t}", "protected function redirectTo()\n {\n $url = Skill::checkUserStatus();\n return $url;\n }", "public function getPaymentGatewayUrl(){\r\n\t\treturn 'index.php?option=com_virtuemart&view=cart&task=checkout';\r\n\t\texit;\r\n\t\t//return JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout', FALSE);\r\n\t}", "public function getPaymentFormUrl()\r\n {\r\n return self::HPF_URL;\r\n }", "abstract protected function redirectTo();", "public function success_payment() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n\n // Verify if the get param pay-return exits\n if ( get_instance()->input->get('pay-return', TRUE) ) {\n \n $pay = get_instance()->input->get('pay-return', TRUE);\n\n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n\n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n\n $get->save();\n\n } else {\n\n display_mess(47);\n\n }\n \n }\n \n }", "public function getSubmitUrl()\n {\n \treturn $this->getUrl('Purchase/Misc/Savepayment');\n }", "public function paymentAction()\n {\n try {\n $session = $this->_getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n $order->setState(Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING, Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING,\n Mage::helper('payanyway')->__('The customer was redirected to Payanyway.')\n );\n $order->save();\n\n $session->setPayanywayQuoteId($session->getQuoteId());\n $session->setPayanywayRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(false)->save();\n $session->clear();\n\n $this->loadLayout();\n $this->renderLayout();\n } catch (Exception $e){\n Mage::logException($e);\n parent::_redirect('checkout/cart');\n }\n }", "public function return_url(Request $request){\n\t\t // Get the payment ID before session clear\n //echo 'pppp'.$payment_id = Session::get('paypal_payment_id');\n\t\t//echo '<br><pre>'; print_r($request['PayerID']); echo '</pre>'; die;\n // clear the session payment ID\n //Session::forget('paypal_payment_id');\n\n\t\tif (empty($request['PayerID']) || empty($request['token'])) {\n\t\t\treturn redirect('service/payment/status')->with('error', 'Payment failed');\n }\n\t\t$payment_id = $request['paymentId'];\n\t\t$payment = Payment::get($payment_id, $this->_api_context);\n\t\t// PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n\t\t$execution = new PaymentExecution();\n $execution->setPayerId($request['PayerID']);\n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n //echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n //update database\n\t\t\t$user=Auth::user();\n\t\t\t$user_id=$user->id;\n\t\t\t$service_id=$request['service_id'];\n\t\t\t$service=Service::find($service_id,['name','price']);\n\t\t\t$user_order_data=[\n\t\t\t\t\t\t\t'user_id'=>$user_id,\n\t\t\t\t\t\t\t'item_id'=>$service_id,\n\t\t\t\t\t\t\t'item_name'=>$service->name,\n\t\t\t\t\t\t\t'item_type'=>'service',\n\t\t\t\t\t\t\t'item_amount'=> $service->price,\n\t\t\t\t\t\t\t'approved'=>1\n\t\t\t\t\t\t\t];\n\t\t\t$order_obj=Order::create($user_order_data);\n\t\t\t$order_id=$order_obj->id;\n\t\t\t$transaction_data=[\n\t\t\t\t\t\t\t 'order_id'=>$order_id,\n\t\t\t\t\t\t\t 'transaction_id'=>$result->getId(),\n\t\t\t\t\t\t\t 'amount'=>$service->price,\n\t\t\t\t\t\t\t 'transaction_type'=>'credit',\n\t\t\t\t\t\t\t 'payment_gateway_id' => 1,\n\t\t\t\t\t\t\t 'payment_method_id' => 2,\n\t\t\t\t\t\t\t 'order_status'=>1\n\t\t\t\t\t\t\t ];\n\t\t\tOrderTransaction::create($transaction_data);\n\t\t\t// forget the session of the service used to get service info for payment\n\t\t\tSession::forget('payment_service_id');\n\t\t\treturn redirect('service/payment/status')->with('success', 'Payment has been completed successfully!');\n }\n\n\t}", "public function redirectToGateway()\n {\n try{\n return Paystack::getAuthorizationUrl()->redirectNow();\n }catch(\\Exception $e) {\n return Redirect::back()->withMessage(['msg'=>'The paystack token has expired. Please refresh the page and try again.', 'type'=>'error']);\n }\n }", "public function redirectAction() {\n \n $this->getResponse()->setBody($this->getLayout()->createBlock('CardstreamHosted/standard_redirect')->toHtml());\n \n }", "public function paymentDashboard()\n\t{\n\t\t// Ensure only the logged in user is being pulled\n\t\t$user = User::find(Auth::user()->id); \n\t\t// If they have been onboarded, grab their login link. Otherwise grab the onboarding link\n\t\tif(isset($user->stripe_acc)) {\n\t\t\tStripeBase::setApiKey(config('services.stripe.secret'));\n\t\t\t$account = StripeAccount::retrieve($user->stripe_acc);\n\t\t\t$login = $account->login_links->create(); \n\t\t\t$url = $login->url;\n\t\t} else {\n\t\t\t$url = 'https://connect.stripe.com/express/oauth/authorize?response_type=code&client_id=ca_CZPOIJTAFwCIvxb3S6hMMdERxIioebWG&scope=read_write';\n\t\t}\n\t\t\n\t\treturn Redirect::to($url);\n\t}", "public function checkout_submit_all_after($observer){\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t$url = Mage::getModel('gpndata/paymentrecurring')->getOrderPlaceRedirectUrl();\n\t\tif ($session->getLastRecurringProfileIds() && $url){\n\t\t\t$session->setRedirectUrl($url);\n\t\t}\n\t}", "public function getAuthURL(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$data['title'] = 'Make Payment';\n\t\t\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->load->library('session');\n \n $this->load->library('email');\n $this->load->helper('url');\n $this->load->database();\n \n\t\t\n\n\t\t$this->form_validation->set_rules('name','Name', 'required');\n $this->form_validation->set_rules('phone','Phone', 'trim|required');\n $this->form_validation->set_rules('email','Email', 'trim|required');\n $this->form_validation->set_rules('location','Location', 'required');\n \n\n\t\t\n\t\t\n\t\t\t\n if($this->form_validation->run() == false){\n \t\t$this->load->view('templates/header', $data);\n\t\t\t\t\t$this->load->view('templates/nav');\n $this->load->view('billing');\n $this->load->view('templates/footer');\n \n }else{\n\t\t\n\t\n \n \n \n \n//get customer email\n$email = $this->input->post('email'); \n$amount = $this->input->post('location'); \n$name = $this->input->post('name');\n$phone = $this->input->post('phone');\n\n\n\n$length = 10;\n\n$order_id = substr(str_shuffle(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, $length);\n\n\n\t\t\t$this->Page_Model->payment($name,$phone,$email,$order_id);\n\t\t\t\t\t\n\t\t\t\t\t \n \n \n\n$amount2 = $amount * 100;\n \n\t\t\t\n //init($ref, $amount_in_kobo, $email, $metadata_arr=[], $callback_url=\"\", $return_obj=false)\n $url = $this->paystack->init($order_id, $amount2, $email, base_url('pay/callback'), FALSE);\n \n //$url ? header(\"Location: {$url}\") : \"\";\n $url ? redirect($url) : \"\"; \n \n \n}\n\t\t\n }", "public function paymentAction()\n {\n try {\n /* @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n\n /**\n * @var $order Mage_Sales_Model_Order\n */\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n\n $paymentMethod = $order->getPayment()->getMethodInstance();\n\n $url = $paymentMethod->getGatewayUrl($order);\n\n if(!$order->getEmailSent()) {\n $order->sendNewOrderEmail();\n $order->setEmailSent(true);\n }\n\n /**\n * @var $quote Mage_Sales_Model_Quote\n */\n $quote = Mage::getSingleton('sales/quote');\n $quote->load($order->getQuoteId());\n $quote->setIsActive(true);\n $quote->save();\n\n // redirect customer to the cart (dirty)\n $block = new Mage_Core_Block_Template();\n $block->setTemplate('mcpservice/redirect.phtml');\n $block->assign('url',$url);\n $block->assign('media_url',Mage::getBaseUrl().'../media/micropayment/');\n $block->assign('year',date('Y'));\n $block->assign('payment_method',$order->getPayment()->getMethod());\n $block->assign('payment_title',$order->getPayment()->getMethodInstance()->getConfigData('title'));\n $block->assign('shop_title', Mage::getStoreConfig('general/store_information/name', Mage::app()->getStore()->getId()));\n\n echo $block->renderView();\n } catch (Exception $e) {\n\n }\n }", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "protected function redirectTo()\n {\n\n return '/'; // return dynamicaly generated URL.\n }", "public function callbackSuccess()\n {\n $this->di->get(\"response\")->redirect(\"user\")->send();\n }", "abstract protected function redirect();", "public function success(){\n\n\t\tif ( !empty( $_GET['token'] ) ) {\n\n\t\t $token = $_GET['token'];\n\t\t $this->paypal->execute_agreement( $token );\n\t\t $this->index();\n\n\t\t}\n\n\t\treturn;\n\n\t}", "public function testPaymentSuccess() {\n\t\t$this->processor->capture($this->data);\n\n\t\t//Test redirect to gateway\n\t\t$response = Controller::curr()->getResponse();\n\t\t$gatewayURL = $this->processor->gateway->gatewayURL;\n\t\t\n\t\t$queryString = http_build_query(array(\n\t\t\t'Amount' => $this->data['Amount'],\n\t\t\t'Currency' => $this->data['Currency'],\n\t\t\t'ReturnURL' => $this->processor->gateway->returnURL\n\t\t));\n\t\t$this->assertEquals($response->getHeader('Location'), '/dummy/external/pay?' . $queryString);\n\t\t\n\t\t//Test payment completion after redirect from gateway\n\t\t$queryString = http_build_query(array('Status' => 'Success'));\n\t\tDirector::test($this->processor->gateway->returnURL . \"?$queryString\");\n\t\t\n\t\t$payment = $payment = Payment::get()->byID($this->processor->payment->ID);\n\t\t$this->assertEquals($payment->Status, Payment::SUCCESS);\n\t}", "public function testSuccessAction()\n {\n $order = Mage::getModel('sales/order')->loadByIncrementId($this->getRequest()->getParam('order'));\n\n if (!$order->getId()) {\n $this->_redirect('checkout/cart');\n return;\n }\n\n $session = $this->getOnepage()\n ->getCheckout()\n ->setLastOrderId($order->getId())\n ->setLastQuoteId($order->getQuoteId())\n ->setLastSuccessQuoteId($order->getQuoteId());\n\n $this->_forward('success');\n }" ]
[ "0.71955335", "0.71234095", "0.7058403", "0.70459", "0.70252424", "0.7013614", "0.69979554", "0.69882107", "0.69775075", "0.6975095", "0.69583756", "0.6949912", "0.69417197", "0.69224423", "0.68877566", "0.68795526", "0.68788314", "0.6862896", "0.68158406", "0.6814849", "0.6810274", "0.6807669", "0.67177856", "0.6708773", "0.6704308", "0.6704308", "0.6704308", "0.66972744", "0.6691343", "0.6690087", "0.668854", "0.666775", "0.66666937", "0.66539955", "0.6651375", "0.66432095", "0.6624266", "0.6624035", "0.6611996", "0.6608168", "0.6572938", "0.65728325", "0.65712893", "0.6539252", "0.65182513", "0.6516298", "0.65126264", "0.6505948", "0.6490001", "0.64743537", "0.64525974", "0.6450927", "0.6446876", "0.64129645", "0.64078224", "0.6401854", "0.63885593", "0.6385863", "0.63692755", "0.6367842", "0.63668776", "0.63555956", "0.6335328", "0.6335328", "0.6335328", "0.6335328", "0.62960035", "0.628735", "0.6268115", "0.62634224", "0.62634224", "0.62634224", "0.62634224", "0.62634224", "0.6255759", "0.6249509", "0.6247492", "0.6246958", "0.62439704", "0.62334424", "0.62294996", "0.6228282", "0.62230265", "0.6212188", "0.6206838", "0.6196329", "0.6187864", "0.61808854", "0.6173067", "0.6169518", "0.6161495", "0.6136873", "0.6134666", "0.613438", "0.6133968", "0.6111915", "0.61017406", "0.61008346", "0.6087014", "0.608648", "0.6078634" ]
0.0
-1
Url to redirect user if he decide to cancel an order
public function setCancelUrl($url) { $this->_url_cancel = $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCancelUrl()\n {\n return Mage::getUrl('payulite/processing/cancel', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "public function cancelAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/failure');\n\t}", "function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t}\n\n\t\t$this->setRedirect($url);\n\n\t}", "protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }", "public function cancelUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'cancel',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "protected function _getCancelOrderUrl($order)\n {\n return Mage::helper('core/url')\n ->addRequestParam(\n Mage::getUrl('paynow/payment/cancel', ['_secure' => true]),\n [\n 'key' => $this->getPaymentModel()->getOrderIdempotencyKey($order),\n 'order_id' => $order->getIncrementId()\n ]\n );\n }", "public function get_cancel_url() {\n\t\t$cancel_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'cancel',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $cancel_url;\n\t}", "public function cancel()\n\t{\n\t\t$option = JRequest::getVar('option');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false); ?>\n\t\t<script language=\"javascript\">\n\t\t\twindow.parent.location.href = \"<?php echo $link ?>\";\n\t\t</script>\n\t\t<?php exit;\n\t}", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "protected function cancelOrder(jshopOrder $order)\r\n {\r\n $this->redirect($this->getActionUrl('cancel', $order->order_id));\r\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('pagseguro/payment/request');\n }", "public function cancelAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId($session->getPaypalStandardQuoteId(true));\n\n $this->_redirect('checkout/cart');\n }", "public function abortAction()\n {\n /** @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n $order = Mage::getModel('sales/order');\n\n try {\n /** @var $order Mage_Sales_Model_Order */\n\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusHistoryComment('Customer cancelled the payment',false);\n\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n if($order->canCancel()) {\n $order->cancel()->save();\n }\n } catch (Exception $e) {\n\n }\n\n $quote = Mage::getSingleton('sales/quote');\n $quote->load($order->getQuoteId());\n $session->setQuoteId($order->getQuoteId());\n $session->getQuote()->setIsActive(1)->save();\n\n // redirect customer to the cart (dirty)\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n $block = new Mage_Core_Block_Template();\n $block->setTemplate('mcpservice/redirect.phtml');\n $block->assign('url',$redirectUrl);\n $block->assign('media_url',Mage::getBaseUrl() . '/../../media/micropayment/');\n $block->assign('year',date('Y'));\n $block->assign('payment_method',$order->getPayment());\n $block->assign('target','parent');\n\n echo $block->renderView();\n\n }", "function cancel()\n\t{\n\t\tif ($_GET[\"obj_id\"] != 0)\n\t\t{\n\t\t\tif ($_GET[\"new_type\"] == \"pg\")\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"view\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"subchap\");\n\t\t\t}\n\t\t}\n\t}", "function cancelUser( $option ) {\r\n\tmosRedirect( 'index2.php?ca='. $option .'&task=view' );\r\n}", "public function getCancelUrl() {\n return $this->getReturnUrl();\n }", "function cancel()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t// Checkin the weblink\n\t\t$model = $this->getModel('weblink');\n\t\t$model->checkin();\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "public function cancel()\n {\n session()->flash('warning', trans('saassubscription::app.super-user.plans.payment-cancel'));\n\n return redirect()->route($this->_config['redirect']);\n }", "public function get_cancel_url( $order ) {\n\t\t$return_url = $order->get_cancel_order_url();\n\n\t\tif ( is_ssl() || get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) {\n\t\t\t$return_url = str_replace( 'http:', 'https:', $return_url );\n\t\t}\n\n\t\t/** DOCBLOCK - Makes linter happy.\n\t\t * \n\t\t * @since today\n\t\t*/\n\t\treturn apply_filters( 'woocommerce_get_cancel_url', $return_url, $order );\n\t}", "function cancel() {\r\n\t\t$this->setRedirect ( 'index.php' );\r\n\t}", "public function getCancelUrl()\n {\n // TODO: Implement getCancelUrl() method.\n }", "public function cancelAction()\n {\n $params = $this->getRequest()->getParams();\n if (array_key_exists('shipment', $params)) {\n $shipment = Mage::getModel('sales/order_shipment')->load($params['shipment']);\n if (Mage::helper('iparcel/api')->cancelShipment($shipment)) {\n Mage::getSingleton('adminhtml/session')->addSuccess('Shipment canceled');\n }\n }\n\n $this->_redirectReferer();\n return true;\n }", "public function getOrderPlaceRedirectUrl()\n\t{\n return Mage::getUrl('hostedpayments/processing/pay');\n\t}", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('paynovapayment/processing/payment');\n }", "protected function cancelLink()\n\t{\n\t\treturn '<p class=\"form-link-cancel\"><a href=\"/journal\">Back to Journal</a></p>';\n\t}", "public function cancelTransaction(){\n \n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'EWAY Transaction cancelled by user');\n }", "public function cancelAction() {\n /**\n * Admin configuration for order cancel request active status.\n */\n $orderCancelStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request' );\n $data = $this->getRequest ()->getPost ();\n $emailSent = '';\n /**\n * Get order id\n * @var int\n */\n $orderId = $data ['order_id'];\n $loggedInCustomerId = '';\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Get customer data\n * @var id\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n $loggedInCustomerId = $customerData->getId ();\n $customerid = Mage::getModel ( 'sales/order' )->load ( $data ['order_id'] )->getCustomerId ();\n } else {\n /**\n * Error message for the when unwanted person access these request.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/history' );\n return;\n }\n if ($orderCancelStatusFlag == 1 && ! empty ( $loggedInCustomerId ) && $customerid == $loggedInCustomerId) {\n $shippingStatus = 0;\n try {\n /**\n * Get templete id for the order cancel request notification.\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n if ($templateId) {\n /**\n * Load email templete.\n */\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load order product details based on the orde id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Get increment id\n * @var int\n */\n $incrementId = $_order->getIncrementId ();\n $sellerProductDetails = array ();\n $selectedProducts = $data ['products'];\n $selectedItemproductId = '';\n /**\n * Get the order item from the order.\n */\n foreach ( $_order->getAllItems () as $item ) {\n /**\n * Get Product id\n * @var int\n */\n $itemProductId = $item->getProductId ();\n $orderItem = $item;\n if (in_array ( $itemProductId, $selectedProducts )) {\n $shippingStatus = $this->getShippingStatus ( $orderItem );\n\n $sellerId = Mage::getModel ( 'catalog/product' )->load ( $itemProductId )->getSellerId ();\n $selectedItemproductId = $itemProductId;\n $sellerProductDetails [$sellerId] [] = $item->getName ();\n }\n }\n /**\n * Get seller product details.\n */\n foreach ( $sellerProductDetails as $key => $productDetails ) {\n $productDetailsHtml = \"<ul>\";\n /**\n * Increment foreach loop\n */\n foreach ( $productDetails as $productDetail ) {\n $productDetailsHtml .= \"<li>\";\n $productDetailsHtml .= $productDetail;\n $productDetailsHtml .= \"</li>\";\n }\n $productDetailsHtml .= \"</ul>\";\n $customer = Mage::getModel ( 'customer/customer' )->load ( $loggedInCustomerId );\n $seller = Mage::getModel ( 'customer/customer' )->load ( $key );\n /**\n * Get customer name and customer email id.\n */\n $buyerName = $customer->getName ();\n $buyerEmail = $customer->getEmail ();\n $sellerEmail = $seller->getEmail ();\n $sellerName = $seller->getName ();\n $recipient = $sellerEmail;\n if (empty ( $sellerEmail )) {\n $adminEmailIdVal = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get the to mail id\n */\n $getToMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailIdVal/email\" );\n $recipient = $getToMailId;\n }\n $emailTemplate->setSenderName ( $buyerName );\n $emailTemplate->setSenderEmail ( $buyerEmail );\n /**\n * To set cancel/refund request sent\n */\n if ($shippingStatus == 1) {\n $requestedType = $this->__ ( 'cancellation' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 0 );\n } else {\n $requestedType = $this->__ ( 'return' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 1 );\n }\n $emailTemplateVariables = array (\n 'ownername' => $sellerName,'productdetails' => $productDetailsHtml, 'order_id' => $incrementId,\n 'customer_email' => $buyerEmail,'customer_firstname' => $buyerName,\n 'reason' => $data ['reason'],'requesttype' => $requestedType,\n 'requestperson' => $this->__ ( 'Customer' )\n );\n $emailTemplate->setDesignConfig ( array ('area' => 'frontend') );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailSent = $emailTemplate->send ( $recipient, $sellerName, $emailTemplateVariables );\n }\n if ($shippingStatus == 1) {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item cancellation request has been sent successfully.\" ) );\n } else {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item return request has been sent successfully.\" ) );\n }\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n }\n } else {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $orderId );\n }\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('postfinancecheckout/transaction/redirect', array(\n '_secure' => true\n ));\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function cancel()\n {\n $user = Auth::user();\n\n if ( $user->cancel_rank() )\n flash('Your place request was canceled.')->success()->important();\n\n if ( $user->cancel_place() )\n flash('Your place as been removed.')->success()->important();\n\n return redirect()->back();\n }", "public function getOrderPlaceRedirectUrl()\n {\n //The form of the Payment Gateway will be displayed to him\n return Mage::getUrl('mypaymentmethod1/payment/redirect', array('_secure' => false));\n }", "public function cancelAction() \n {\n if (Mage::getEdition() == Mage::EDITION_ENTERPRISE) {\n $this->helper()->storeCreditSessionUnset();\n $this->helper()->giftCardsSessionUnset();\n }\n\n $this->_redirect('checkout/cart');\n }", "public function actionCancel() {\n $token = trim($_GET['token']);\n// $payerId = trim($_GET['PayerID']);\n $criteria = new CDbCriteria;\n $criteria->condition = 'token=:Tokenw';\n $criteria->params = array(':Tokenw' => $token);\n $orders = Orders::model()->find($criteria);\n if ($orders->status_id == '4') {\n $orders->status_id = '2';\n $orders->save();\n// need to clear cart\n//Yii::app()->shoppingCart->clear();\n }\n $this->render('cancel');\n }", "public function getOrderPlaceRedirectUrl()\n {\n if (Mage::getStoreConfig('payment/bitcoin/fullscreen')) {\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => true));\n }else{\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => false));\n }\n return $target_url;\n } else {\n return '';\n }\n }", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public function render_cancel_link() {\n\n\t\tif ( ! $this->is_checkout_confirmation() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<a href=\"%1$s\" class=\"wc-' . sanitize_html_class( $this->get_gateway()->get_id_dasherized() ) . '-cancel\">%2$s</a>',\n\t\t\tesc_url( add_query_arg( array( 'wc_' . $this->get_gateway()->get_id() . '_clear_session' => true ), wc_get_cart_url() ) ),\n\t\t\tesc_html__( 'Cancel', 'woocommerce-gateway-paypal-powered-by-braintree' )\n\t\t);\n\t}", "function cancel($key=null)\n\t{\n\t\t$this->setRedirect( 'index.php' );\n\t}", "public function getOrderPlaceRedirectUrl()\r\n {\r\n \t$result = false;\r\n \t$session = Mage::getSingleton('checkout/session');\r\n \t$nVersion = $this->getVersion();\r\n \t$mode = $this->getConfigData('mode');\r\n \t\r\n \tif($session->getMd() &&\r\n \t\t$session->getAcsurl() &&\r\n \t\t$session->getPareq())\r\n \t{\r\n \t\t// Direct (API) for 3D Secure payments\r\n \t\tif($nVersion >= 1410)\r\n\t \t{\r\n\t\t \t// need to re-add the ordered item quantity to stock as per not completed 3DS transaction\r\n\t\t \tif($mode != Paymentsense_Paymentsensegateway_Model_Source_PaymentMode::PAYMENT_MODE_TRANSPARENT_REDIRECT)\r\n\t\t \t{\r\n\t\t \t\t$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());\r\n\t\t \t\t$this->addOrderedItemsToStock($order);\r\n\t\t \t}\r\n\t \t}\r\n \t\t\r\n \t\t$result = Mage::getUrl('paymentsensegateway/payment/threedsecure', array('_secure' => true));\r\n \t}\r\n \tif($session->getHashdigest())\r\n \t{\r\n \t\t// Hosted Payment Form and Transparent Redirect payments\r\n \t\tif($nVersion >= 1410)\r\n\t \t{\r\n\t\t \t// need to re-add the ordered item quantity to stock as per not completed 3DS transaction\r\n\t\t \tif(!Mage::getSingleton('checkout/session')->getPares())\r\n\t\t \t{\r\n\t\t \t\t$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());\r\n\t\t \t\t$this->addOrderedItemsToStock($order);\r\n\t\t \t}\r\n\t \t}\r\n \t\r\n \t\t$result = Mage::getUrl('paymentsensegateway/payment/redirect', array('_secure' => true));\r\n \t}\r\n \r\n return $result;\r\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "public function getOrderPlaceRedirectUrl()\n {\n if($this->_getHelper()->isRedirectMode()) {\n $paymentUrl = Mage::getSingleton('core/session')->getPicpayPaymentUrl();\n\n if ($paymentUrl) {\n return $paymentUrl;\n }\n else {\n Mage::throwException($this->_getHelper()->__(\"Invalid payment url\"));\n }\n }\n\n $isSecure = Mage::app()->getStore()->isCurrentlySecure();\n return Mage::getUrl('checkout/onepage/success', array('_secure' => $isSecure));\n }", "public function cancel()\n\t{\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\t\t$this->setRedirect('index.php');\n\t}", "private function merchantPageCancel()\n {\n $cart = $this->context->cart;\n\n $customer = new Customer($cart->id_customer);\n\n if (!Validate::isLoadedObject($customer) || !isset($this->module->currentOrder)) {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n\n $id_order = $this->module->currentOrder;\n if (! $id_order || null == $id_order || empty($id_order)) {\n $id_order = Context::getContext()->cookie->__get('aps_apple_order_id');\n $this->aps_payment->refillCart($id_order);\n $this->aps_helper->log('refill cart and merchantPageCancel called');\n }\n Context::getContext()->cookie->apsErrors = $error_message;\n Tools::redirect('index.php?controller=order&step=1');\n }\n $this->aps_payment->merchantPageCancel();\n $objOrder = new Order($this->module->currentOrder);\n if ($objOrder) {\n $this->aps_payment->refillCart($objOrder->id);\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->apsErrors = $error_message;\n $this->aps_helper->log('merchantPageCancel called');\n\n Tools::redirect('index.php?controller=order&step=1');\n } else {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->__set('aps_error_msg', $error_message);\n Tools::redirect(\n 'index.php?fc=module&module=amazonpaymentservices&controller=error&action=displayError'\n );\n }\n }", "public function getCancelUrl() {\n return new Url('tfa.settings');\n }", "function cancel()\n\t{\n\t\t// Initialize variables.\n\t\t$app = & JFactory::getApplication();\n\n\t\t// Clear the link id from the session.\n\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "function cancel()\n\t{\n\t\t// Initialize some variables\n\t\t$db = & JFactory::getDBO();\n\t\t$user = & JFactory::getUser();\n\n\t\t// Get an article table object and bind post variabes to it [We don't need a full model here]\n\t\t$article = & JTable::getInstance( 'content' );\n\t\t$article->bind( JRequest::get( 'post' ) );\n\n\t\tif ( $user->authorize( 'com_content', 'edit', 'content', 'all' ) || ($user->authorize( 'com_content', 'edit', 'content', 'own' ) && $article->created_by == $user->get( 'id' )) )\n\t\t{\n\t\t\t$article->checkin();\n\t\t}\n\n\t\t// If the task was edit or cancel, we go back to the content item\n\t\t$referer = JRequest::getString( 'ret', base64_encode( JURI::base() ), 'get' );\n\t\t$referer = base64_decode( $referer );\n\t\tif ( !JURI::isInternal( $referer ) )\n\t\t{\n\t\t\t$referer = '';\n\t\t}\n\t\t$this->setRedirect( $referer );\n\n\t}", "public function massCancelAction()\n {\n $this->_ratepayMassEvent('cancel');\n \n $this->_redirect('*/*/index');\n }", "protected function defaultCancelUrl()\n {\n return Url::to($this->user->loginUrl);\n }", "function cancel()\n\t{\n\t\t// Get some objects from the JApplication\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Must be logged in\n\t\tif ($user->get('id') < 1) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\t// Checkin the weblink\n\t\t$model = $this->getModel('weblink');\n\t\t$model->checkin();\n\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=categories', false));\n\t}", "public function redirectAction()\n {\n $redirectParams = $this->getRequest()->getParams();\n $params = array();\n if (!empty($redirectParams['success'])\n && isset($redirectParams['x_invoice_num'])\n && isset($redirectParams['controller_action_name'])\n ) {\n $params['redirect_parent'] = Mage::helper('authorizenet/admin')->getSuccessOrderUrl($redirectParams);\n $this->_getDirectPostSession()->unsetData('quote_id');\n //cancel old order\n $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder();\n if ($oldOrder->getId()) {\n /* @var $order Mage_Sales_Model_Order */\n $order = Mage::getModel('sales/order')->loadByIncrementId($redirectParams['x_invoice_num']);\n if ($order->getId()) {\n $oldOrder->cancel()\n ->save();\n $order->save();\n $this->_getOrderCreateModel()->getSession()->unsOrderId();\n }\n }\n //clear sessions\n $this->_getSession()->clear();\n $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']);\n Mage::getSingleton('adminhtml/session')->clear();\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));\n }\n\n if (!empty($redirectParams['error_msg'])) {\n $cancelOrder = empty($redirectParams['x_invoice_num']);\n $this->_returnQuote($cancelOrder, $redirectParams['error_msg']);\n }\n\n $block = $this->getLayout()\n ->createBlock('directpost/iframe')\n ->setParams(array_merge($params, $redirectParams));\n $this->getResponse()->setBody($block->toHtml());\n }", "public function paymentcancel(Request $req){\n\treturn(\"Payment was cancelled\");\n }", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setAlipayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n if (!$order->getId()) {\n $this->norouteAction();\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('alipay')->__('客户跳转到支付宝网站')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('alipay/redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "public function cancel()\n {\n dd('Your payment is canceled. You can create cancel page here.');\n }", "public function cancel(){\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t// load additonal language (for breadcrumbs)\n\t\t$this->language->load( 'checkout/success' );\n\n\t\t$this->load->library( 'encryption' );\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t// get order id\n\t\tif( isset( $this->request->get['order_id'] ) ) {\n\t\t\t$order_id = $encryption->decrypt( $this->request->get['order_id'] );\n\t\t}else{\n\t\t\t$order_id = 0;\n\t\t}\n\n\t\t// get project id\n\t\t$project_id = $this->getRequest( 'pid', 0 );\n\n\t\t// write log\n\t\t$msg = sprintf( $this->language->get( 'text_log_return_cancel'), $project_id, $order_id );\n\t\t$this->writeLog( $msg, 4 );\n\n\t\t$this->data['heading_title']\t= $this->language->get( 'text_cancel' );\n\t\t$this->data['text_message']\t\t= sprintf(\n\t\t\t$this->language->get( 'text_cancel_message' ),\n\t\t\t$this->buildUrl( 'information/contact' )\n\t\t);\n\t\t$this->data['button_continue']\t= $this->language->get( 'button_continue' );\n\t\t$this->data['continue']\t\t\t= $this->buildUrl( 'common/home' );\n\n\t\tif( $this->_ocversion == '1.4' ) {\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t \t),\n\t\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t\t\t);\n\n\t\t\tif( $this->customer->isLogged() ) {\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/shipping' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_shipping' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/payment' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_payment' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_guest' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$breadcrumbs = array_merge( $breadcrumbs, $breadcrumbs_add );\n\n\t \t$breadcrumbs[] = array(\n\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t \t'text' => $this->language->get( 'text_failed' ),\n\t \t'separator' => $this->language->get( 'text_separator' )\n\t \t);\n\t\t}else{\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t\t\t),\n\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t),\n\t\t \tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'checkout/checkout', '', 'SSL' ),\n\t\t\t\t\t'text' => $this->language->get( 'text_checkout' ),\n\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t\t \t'text' => $this->language->get( 'text_failed' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t \t);\n\t\t}\n\n\t\t$this->getTemplate( '/template/common/success.tpl' );\n\t\t$this->buildBreadcrumbs( $breadcrumbs );\n\t\t$this->buildTitle( $this->language->get( 'text_cancel' ) );\n\t\t$this->getChildren();\n\t\t$this->buildResponse();\n\t}", "public function get_cancel_booking_url() {\n $bookings_endpoint = YITH_WCBK()->endpoints->get_endpoint( 'bookings' );\n $bookings_url = wc_get_endpoint_url( $bookings_endpoint, '', wc_get_page_permalink( 'myaccount' ) );\n $cancel_url = add_query_arg( array( 'cancel-booking' => $this->id ), $bookings_url );\n\n return apply_filters( 'yith_wcbk_get_cancel_booking_url', $cancel_url, $this );\n }", "public function cancelOrder($id)\n {\n //\n\n $order=Order::find($id);\n if($order ->status == 2 || $order->status ==4 ){\n $order ->status == $order ->status;\n }\n else{\n $order->status=3;\n }\n try{\n $order->save();\n return redirect()->route('order.list-order')->with('success',\"Cancel Order Success!\");\n }catch(\\Exception $ex){\n return redirect()->back()->with('error',$ex->getMessage());\n }\n\n }", "public function cancel()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\t\r\n\t\t$this->setRedirect( 'index.php?option=com_joomfish' );\r\n\t}", "function ting_visual_relation_slide_form_cancel($form, &$form_state) {\n // Go back to app-settings (or destination if parameter is set)\n $form_state['redirect'] = 'admin/config/ting/ting-visual-relation/app-settings';\n}", "public function actionCancel()\n {\n }", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "public function postCancelRecurring($order) {\n Auth::user()\n ->requires('delete')\n ->ofScope('Subscriber',Subscriber::current()->id)\n ->orScope('Protocol')\n ->orScope('Client',$order->client->id)\n ->over('Order',$order->id);\n\n $order->autoship->delete();\n\n return Redirect::route('order',array($order->id));\n }", "public function getOrderPlaceRedirectUrl()\n {\n return $this->getConfig()->getPaymentRedirectUrl();\n }", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setCriptopayStandardQuoteId($session->getQuoteId());\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('criptopay')->__('Customer was redirected to CriptoPay')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('criptopay/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "private function getCancelLink() {\n\t\t$cancelParams = array();\n\n\t\treturn Linker::linkKnown(\n\t\t\t$this->getContext()->getTitle(),\n\t\t\twfMessage( 'cancel' )->parse(),\n\t\t\tarray( 'id' => 'mw-editform-cancel' ),\n\t\t\t$cancelParams\n\t\t);\n\t}", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "public function paypal_cancel() {\n\t\t\t// on va donc chercher son adresse mail\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'conditions'=>array('id'=>$this->Auth->user('id')),\n\t\t\t\t'fields'=>array('mail')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// et on lui envoie le mail de confirmation pour son annulation\n\t\t\tApp::uses('CakeEmail', 'Network/Email');\n\t\t\t$email = new CakeEmail('gmail');\n\t\t\t$email->to($user['User']['mail']) // à qui ? $this->Auth->user('mail')\n\t\t\t\t ->from(Configure::read('Site_Contact.mail')) // par qui ?\n\t\t\t\t ->subject('Votre demande a été annulée') // sujet du mail\n\t\t\t\t ->emailFormat('html') // le format à utiliser\n\t\t\t\t ->template('paypal_cancel') // le template à utiliser\n\t\t\t\t ->send(); // envoi du mail\n\n\t\t\t$this->Session->setFlash(__(\"Votre demande a été annulée\"), 'success');\n\t\t\t$this->redirect(array('controller'=>'posts', 'action'=>'index'));\n\t\t}", "public function redirectAction()\n {\n\t\t\n $session = Mage::getSingleton('checkout/session');\n $session->setHdfcStandardQuoteId($session->getQuoteId());\n\t\t$order = $this->getOrder();\n\t\t\n \n if (!$order->getId()) {\n\t\t\n\t\t\t$this->_forward('failurerefresh');\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('hdfc')->__('Customer was redirected to hdfc')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('hdfc/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "public function confirmOrder()\n {\n $order = Order::query()->findOrFail(request()->input('order'));\n\n if ($order->orderStatus->slug !== OrderStatus::PROCESSED) {\n return redirect()->back();\n }\n\n $order->delivery_tracking = request()->input('delivery_tracking');\n\n $order->setStatusSent();\n\n $order->save();\n\n $order->user->notify(new OrderSent($order));\n\n return redirect(backpack_url('order?status=2')) //http://lucilevilaine.local/admin/order?status=2\n ->with('success', 'La commande a bien été confirmé');\n }", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function cancelOrderByUser(Request $req){\n $validation = Validator::make($req->all(),[\n \"orders_id\" => \"required|numeric|exists:orders,id\"\n ]);\n if($validation->fails())\n {\n return $this->apiResponseNoObj(400,$validation->errors());\n }\n\n /*Check status of this order */\n $order = Order::find($req->orders_id);\n if($order->status != \"awaitingPayment\"){\n return $this->apiResponseNoObj(423,\"can't cancel the order\");\n }\n \n /*update status of this order*/\n $order->status = \"cancelledByUser\";\n $order->save();\n\n /*retrun data*/\n return $this->apiResponseNoObj(200,\"Successfully canceled\");\n }", "function cancel() \r\n\t\t{\r\n\t $msg = JText::_('COM_QRCODE_CANCEL');\r\n\t $this->setRedirect(JRoute::_('index.php?option=com_qrcode', false), $msg);\r\n\t }", "public function view_cancel_booking()\n\t{\n\t\tif ($this->checkLogin('A') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['heading'] = 'View Rental Cancel';\n\t\t\t$booking_no = $this->uri->segment(4,0);\n\t\t\t$this->data['review_details'] = $this->review_model->get_dispute_details($booking_no);\n\t\t\tif ($this->data['review_details']->num_rows() > 0){\n\t\t\t\t$this->load->view('admin/dispute/view_cancel_booking',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "function actionCancel($id)\n {\n $order = $this->orderManager->find($id);\n $previousOrderStatus = $order->objednavky_stav_id;\n $affected = $this->orderManager->cancelPendingOrder($id);\n\n if ($affected > 0) {\n try {\n $this->notificationMailer\n ->addTo($order->uzivatele->email)\n ->setTemplateFile('storno.latte')\n ->setSubject('Objednávka byla stornována')\n ->setTemplateVar('order', $order)\n ->send();\n\n if (!$this->isAjax()) {\n $this->flashMessage('Objednávka byla zrušena.', 'info');\n }\n } catch (SmtpException $exception) {\n $this->flashMessage('E-mail se nepodařilo odeslat.', 'danger');\n\n // rollback order status\n $this->orderManager->setStatus($id, $previousOrderStatus);\n }\n }\n\n if (!$this->isAjax()) {\n $ref = $this->getParameter('ref');\n if ($ref) {\n $this->redirect($ref);\n } else {\n $backlink = \"/kryo/orders?ordersGrid-id={$id}&do=ordersGrid-detail\";\n $backlink = $this->appendFlashMessage($backlink);\n $this->redirectUrl($backlink);\n }\n }\n }", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\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 * Return to order manage page\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 cancel_ord($order_code)\n {\n $order_cod = Order::where('order_code', $order_code)->first();\n $order_cod->update(['order_status' => 0]);\n return redirect()->back()->with('message', 'Đã hủy đơn hàng');\n }", "public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }", "public function return_page_action ()\n\t{\n\t\t$status = $this->get_order_status($_GET['order_id']);\n\n\t\tif ($status == \"paid\")\n\t\t{\n\t\t\t// Cleanup cart and session.\n\t\t\tglobal $cart;\n\t\t\t$cart->reset(TRUE);\n\n\t\t\ttep_session_unregister(\"sendto\");\n\t\t\ttep_session_unregister(\"billto\");\n\t\t\ttep_session_unregister(\"shipping\");\n\t\t\ttep_session_unregister(\"payment\");\n\t\t\ttep_session_unregister(\"comments\");\n\n\t\t\t// Show success page.\n\t\t\theader(\"Location: /checkout_success.php\");\n\t\t}\n\t\telse \n\t\t{\n\t\t\t// Send back to cart.\n\t\t\theader(\"Location: /shopping_cart.php\");\n\t\t}\n\t}", "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function cancel($key = null)\n\t{\n\t\t$this->_result = $result = parent::cancel();\n\t\t$model = $this->getModel();\n\n\t\t//Define the redirections\n\t\tswitch ($this->getLayout() . '.' . $this->getTask())\n\t\t{\n\t\t\tcase 'reservation.cancel':\n\n\t\t\t\t$app = JFactory::getApplication();\n\t\t\t\t$app->redirect(\"index.php\");\n\n\t\t\t\t/*$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));*/\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function paymentCancel() {\n return view('cancelarpago');\n }", "function cps_changeset_publish_changeset_form_cancel($form, &$form_state) {\n $form_state['redirect'] = $form_state['entity']->uri();\n}", "public function needsRedirectToPayment() {\n $haPagado = $this->hasPaid();\n $renewTime = $this->timeFreameToRenewLicense();\n $mustPay = $this->mustPay();\n $optPayment = $this->hasOptionalPayment();\n $url = false;\n $temporary = $this->isTemporary() || $this->hasTemporaryPayment();\n $invoice = $this->hasInvoicesNotPayedFrameTime(true);\n\n if ($temporary && $this->isPremium()) {\n $url = \"/app/payment/temporary\";\n } elseif ($haPagado && $mustPay && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice && $invoice->getDaysToClose() < 0) {\n $url = \"/app/payment/invoice\";\n } elseif ($haPagado && $renewTime && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice) {\n $url = \"/app/payment/invoice\";\n }\n\n return $url;\n }", "public function redirectCancel($url = null)\n {\n if ($url === null) {\n $url = $this->getCancelUrl();\n }\n return $this->redirect($url, false);\n }", "protected function _goBack()\n {\n\t $buy_now = $this->getRequest()->getParam('buy_now');\n\n\t $returnUrl = $this->getRequest()->getParam('return_url');\n if ($returnUrl) {\n\n if (!$this->_isUrlInternal($returnUrl)) {\n throw new Mage_Exception('External urls redirect to \"' . $returnUrl . '\" denied!');\n }\n\n $this->_getSession()->getMessages(true);\n\t $this->getResponse()->setRedirect($returnUrl);\n\n } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')\n && !$this->getRequest()->getParam('in_cart')\n && $backUrl = $this->_getRefererUrl()\n ) {\n $referralUrl=Mage::getSingleton('core/session')->getCustomRefererUrl();\n if(!empty($referralUrl)){\n $backUrl = Mage::getSingleton('core/session')->getCustomRefererUrl();\n Mage::getSingleton('core/session')->unsCustomRefererUrl();\n }\n //$this->getResponse()->setRedirect($backUrl);\n\t if (!empty($buy_now)) {\n\t\t $this->_redirect('onestepcheckout'); // If you are using onepagecheckout or use this $this->_redirect('checkout/onepage/')\n\t }else{\n\t\t $this->getResponse()->setRedirect($backUrl);\n\t }\n } else {\n if ((strtolower($this->getRequest()->getActionName()) == 'add') && !$this->getRequest()->getParam('in_cart')) {\n $this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl());\n }\n $this->_redirect('checkout/cart');\n }\n return $this;\n }", "function OrderCancelled()\r\n {\r\n // Clear PayPalResult from session userdata\r\n $this->session->unset_userdata('PayPalResult');\r\n \r\n // Clear cart from session userdata\r\n $this->session->unset_userdata('shopping_cart');\r\n \r\n // Successful call. Load view or whatever you need to do here.\r\n $this->load->view('paypal/express_checkout/order_cancelled');\r\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public function getConfirmInscriptionURL(){\n return $this->rootUrl().\"confirmInscription\";\n }", "public function getOrderPlaceRedirectUrl()\n {\n $session = Mage::getSingleton('ckopayment/session_quote');\n $isApm = $session->getIsApm();\n $isApmUrl = $session->getPaymentRedirectUrl();\n\n $session\n ->setIsApm(false)\n ->setPaymentRedirectUrl(false);\n\n if ($isApm && $isApmUrl) {\n return $isApmUrl;\n }\n\n return false;\n }", "public function cancel($key = 'a_id')\n\t{\n\t\tparent::cancel($key);\n\n\t\t// Redirect to the return page.\n\t\t$this->setRedirect($this->getReturnPage());\n\t}", "public function cancel($key = 'a_id')\n\t{\n\t\tparent::cancel($key);\n\n\t\t// Redirect to the return page.\n\t\t$this->setRedirect($this->getReturnPage());\n\t}", "public function cancelEdit($data) {\n\t\t\n\t\t// Redirect back to the edit page\n\t\treturn $this->redirect(\"budgeting/edit\");\n\t}", "public function cancelSession(AdminContext $adminContext)\n {\n /** @var Session */\n $session = $adminContext->getEntity()->getInstance();\n $session->setStatus(EnumSessionStatus::CANCELED);\n\n $this->refundBookings($session);\n\n $this->getDoctrine()->getManager()->flush();\n return $this->redirect($adminContext->getReferrer());\n }", "public function actionCancelPlan(){\n // Redirect back to billing page if doesnt have a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if(!$isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n $customerName = Yii::$app->user->identity->agent_name;\n $latestInvoice = Yii::$app->user->identity->getInvoices()->orderBy('invoice_created_at DESC')->limit(1)->one();\n\n if($latestInvoice){\n Yii::error(\"[Requested Cancel Billing #\".$latestInvoice->billing->twoco_order_num.\"] Customer: $customerName\", __METHOD__);\n // Cancel the recurring plan\n $latestInvoice->billing->cancelRecurring();\n }\n\n Yii::$app->getSession()->setFlash('warning', \"[Plan Cancelled] Billing plan has been cancelled as requested.\");\n\n return $this->redirect(['billing/index']);\n }", "public function cancel($token = null)\n\t{\n\t\t$this->load->model('order_model');\n\n\t\t/* Deletes the incompleted order */\n\t\t$this->order_model->delete($token);\n\t\theader(\"Location: \" . base_url() . \"cart\");\n\t}", "private function _redirect()\n\t{\n\n\t\t$this->_urlPagSeguro = $this->request->post['url_ps'];\n\n\t\tif (!empty($this->_urlPagSeguro )) {\n\t\t\theader('Location: ' . $this->_urlPagSeguro);\n\t\t\t$this->cart->clear();\n\t\t}\n\t}", "function handleCancelProgramItemSelector(EventContext $context)\n {\n $context->setForward(dirname(__FILE__) . \"/index.php\");\n }", "function urlCanceled()\r\n\t{\r\n\t\t$input_def['id'] = 'urlCanceled';\r\n\t\t$input_def['name'] = 'urlCanceled';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}", "public function handleCancel() {\n // logit('HC: ' . print_r($this->data, true));\n if ($this->data['submit_button'] == 'Cancel') {\n $this->data = array();\n $this->error = array();\n $this->_redirector->gotoUrl($this->mainpage);\n }\n }" ]
[ "0.74424624", "0.73776853", "0.7364959", "0.71495885", "0.6904727", "0.6868556", "0.6736522", "0.6731848", "0.67258835", "0.67234993", "0.67233145", "0.66998124", "0.6685076", "0.66244173", "0.66038394", "0.65974164", "0.6574803", "0.65630287", "0.65606046", "0.6525642", "0.6487763", "0.64711803", "0.6465149", "0.64580494", "0.6444746", "0.63964957", "0.6382812", "0.6377783", "0.6357385", "0.63535017", "0.63197106", "0.63113725", "0.62963134", "0.6280003", "0.62710536", "0.62634856", "0.6232008", "0.6216842", "0.62060845", "0.6202567", "0.61659396", "0.61456156", "0.61397874", "0.613088", "0.6114924", "0.6105651", "0.6099561", "0.609858", "0.6082309", "0.60523516", "0.6024872", "0.6021039", "0.60134846", "0.6009526", "0.6005499", "0.5990475", "0.5974626", "0.597054", "0.59664476", "0.59638494", "0.5960291", "0.5949636", "0.5941669", "0.5930544", "0.5930464", "0.59304476", "0.59111315", "0.5907913", "0.5907623", "0.59073454", "0.589869", "0.5896032", "0.58959913", "0.5891445", "0.58886737", "0.5887085", "0.5877051", "0.5875928", "0.58756286", "0.5874183", "0.5873101", "0.58638823", "0.5854575", "0.58389956", "0.5837213", "0.5822817", "0.5816062", "0.5784102", "0.57728356", "0.57690066", "0.5758838", "0.5754793", "0.5754793", "0.57498133", "0.5740532", "0.5729576", "0.571536", "0.5713913", "0.5706532", "0.5702352", "0.5699469" ]
0.0
-1
Set desired PayPal interface locale
public function setLocale($locale) { $this->_locale = $locale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function settingLocale() {}", "function setLocale($locale);", "public function setLocale($locale);", "private function set_locale() {\n\n\t\t$plugin_i18n = new Soisy_Pagamento_Rateale_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\t}", "public function settingLanguage() {}", "public function setLocale($locale = null);", "public function setInterfaceLocale($interfaceLocale);", "protected function getLocale()\n {\n return Mage::getStoreConfig('payment/gene_braintree_paypal/locale');\n }", "public function setLocale($locale)\n {\n //\n }", "function switch_to_locale($locale)\n {\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new APS_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "public function setLocale()\n\t{\n\t\tif ($locale = $this->app->session->get('admin_locale'))\n\t\t{\n\t\t\t$this->app->setLocale($locale);\n\t\t} else {\n \\Session::put('admin_locale', \\Config::get('app.locale'));\n }\n\t}", "function set_locale($locale) {\n\t\t\t$this->i18n_locale = $locale;\n\t\t\treturn $this->i18n_locale;\n\t\t}", "function set_language($locale) {\n\t\t\t$this->i18n_locale = $locale;\n\t\t}", "private function set_locale() {\n\n if (function_exists('determine_locale')) {\n $locale = determine_locale();\n } else {\n // @todo Remove when start supporting WP 5.0 or later.\n $locale = is_admin() ? get_user_locale() : get_locale();\n }\n $locale = apply_filters('plugin_locale', $locale, 'careerfy-frame');\n \n unload_textdomain('careerfy-frame');\n load_textdomain('careerfy-frame', WP_LANG_DIR . '/plugins/careerfy-frame-' . $locale . '.mo');\n load_plugin_textdomain('careerfy-frame', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages');\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new Service_Tracker_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function setLocale() {\n if ($this->_language == 'french')\n setlocale (LC_ALL, 'fr_FR.iso88591', 'fr_FR@euro', 'fr_FR', 'french', 'fra');\n else if ($this->_language == 'english')\n setlocale (LC_ALL, 'en_GB.iso88591', 'en_GB', 'english', 'eng');\n }", "public function locale();", "function restore_current_locale()\n {\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale()\n {\n\n $plugin_i18n = new myFOSSIL_Resources_i18n();\n $plugin_i18n->set_domain( $this->get_plugin_name() );\n\n $this->loader->add_action( 'plugins_loaded', $plugin_i18n,\n 'load_plugin_textdomain' );\n\n }", "protected function setLocaleForMailer(): void\n {\n if (function_exists('switch_to_locale') && ($locale = $this->params->locale)) {\n \\switch_to_locale($locale);\n }\n }", "function configure() {\n\t\tif($GLOBALS['TSFE']->config['config']['locale_all'])\n\t\t\tsetlocale(LC_ALL, $GLOBALS['TSFE']->config['config']['locale_all']);\n\n $this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t}", "function determine_locale()\n {\n }", "private function SetCulture()\n {\n \tif($_SESSION['LANGUAGE'] == \"fr\" )\n \t{\n \t\t$this->lang_name_field = \"subscription_name_fr\";\n\t\t\t$this->lang_desc_field = \"subscription_desc_fr\";\n \t}\n \telse\n \t{\n \t\t$this->lang_name_field = \"subscription_name_en\";\n\t\t\t$this->lang_desc_field = \"subscription_desc_en\";\n \t}\n }", "public function setLocale()\n {\n $lang = Request::segment(2);\n\n try {\n $this->language->set($lang);\n return Redirect::back();\n } catch (Exception $e) {\n //show error\n }\n }", "public function restore_current_locale()\n {\n }", "private function set_locale()\n {\n $plugin_i18n = new MailChimp_WooCommerce_i18n();\n $this->loader->add_action('init', $plugin_i18n, 'load_plugin_textdomain');\n }", "public function setPaypalLocalCode($args)\n {\n $lang = pll_current_language('locale');\n $args['locale.x'] = $lang;\n\n return $args;\n }", "function setLocale($locale) {\n\t\t$this->locale = $locale;\n\t}", "function default_locale()\n{\n return Config::getDefaultLocale();\n}", "public function getInterfaceLocale();", "public function getLocale() {}", "public function setLocale($val)\n {\n $this->locale = $val;\n }", "function getDefaultLocale();", "function setLocale($key) {\n\t\t\t$this->locale = $key;\n\t\t}", "public function setDefaultLocale()\n {\n $this->setLocale('en');\n $locale = \\Locale::getDefault();\n if ($locale) {\n $this->setLocale($locale);\n }\n }", "public function setCurrentLocale($currentLocale);", "private function setLocale()\n {\n $plugin_i18n = new I18n();\n $plugin_i18n->setDomain(Plugin_Name::PLUGIN_ID);\n\n add_action('plugins_loaded', [$plugin_i18n, 'loadPluginTextdomain']);\n }", "public function getLocale()\n {\n return 'en';\n }", "public function getTargetLocale();", "public function locale(string $locale = null);", "function getLocale();", "public function setLocaleOverride(ContextInterface $ctx, SetLocaleOverrideRequest $request): void;", "public function getLocale();", "public function getLocale();", "public function setLanguage($l)\n {\n $this->setOption('language',$l);\n }", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "function _setlocale($category, $locale)\r\n\t{\r\n\t\tglobal $CURRENTLOCALE, $EMULATEGETTEXT;\r\n\t\tif ($locale === 0) { // use === to differentiate between string \"0\"\r\n\t\t\tif ($CURRENTLOCALE != '')\r\n\t\t\t\treturn $CURRENTLOCALE;\r\n\t\t\telse\r\n\t\t\t// obey LANG variable, maybe extend to support all of LC_* vars\r\n\t\t\t// even if we tried to read locale without setting it first\r\n\t\t\t\treturn _setlocale($category, $CURRENTLOCALE);\r\n\t\t} else {\r\n\t\t\tif (function_exists('setlocale')) {\r\n\t\t\t\t$ret = setlocale($category, $locale);\r\n\t\t\t\tif (($locale == '' and !$ret) or // failed setting it by env\r\n\t\t\t\t\t($locale != '' and $ret != $locale)) { // failed setting it\r\n\t\t\t\t\t// Failed setting it according to environment.\r\n\t\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$CURRENTLOCALE = $ret;\r\n\t\t\t\t\t$EMULATEGETTEXT = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// No function setlocale(), emulate it all.\r\n\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t}\r\n\t\t\t// Allow locale to be changed on the go for one translation domain.\r\n\t\t\tglobal $text_domains, $default_domain;\r\n\t\t\tif (array_key_exists($default_domain, $text_domains)) {\r\n\t\t\t\tunset($text_domains[$default_domain]->l10n);\r\n\t\t\t}\r\n\t\t\treturn $CURRENTLOCALE;\r\n\t\t}\r\n\t}", "public function get_switched_locale()\n {\n }", "public function setDefaultLocale($defaultLocale = null);", "function setLocale($args) {\n\t\t$setLocale = isset($args[0]) ? $args[0] : null;\n\t\t\n\t\t$site = &Request::getSite();\n\t\t$journal = &Request::getJournal();\n\t\tif ($journal != null) {\n\t\t\t$journalSupportedLocales = $journal->getSetting('supportedLocales');\n\t\t\tif (!is_array($journalSupportedLocales)) {\n\t\t\t\t$journalSupportedLocales = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Locale::isLocaleValid($setLocale) && (!isset($journalSupportedLocales) || in_array($setLocale, $journalSupportedLocales)) && in_array($setLocale, $site->getSupportedLocales())) {\n\t\t\t$session = &Request::getSession();\n\t\t\t$session->setSessionVar('currentLocale', $setLocale);\n\t\t}\n\t\t\n\t\tif(isset($_SERVER['HTTP_REFERER'])) {\n\t\t\tRequest::redirect($_SERVER['HTTP_REFERER']);\n\t\t}\n\t\t\n\t\t$source = Request::getUserVar('source');\n\t\tif (isset($source) && !empty($source)) {\n\t\t\tRequest::redirect(Request::getProtocol() . '://' . Request::getServerHost() . $source, false);\n\t\t}\n\t\t\n\t\tRequest::redirect('index');\t\t\n\t}", "public function getDefaultLocale();", "public function setLocale ($locale) {\n\t\t$this->locale = $locale;\n\t}", "protected function setLanguage() {\r\n\t\t$this->language = $GLOBALS['TSFE']->config['config']['language'];\r\n\t}", "private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}", "function dev_change_locale( $locale ) {\n\n $dev_locale = filter_input( INPUT_GET, 'dev_lang', FILTER_SANITIZE_STRING );\n\n\tif ( ! empty( $dev_locale ) ) {\n\t\t$locale = $dev_locale;\n\t}\n\n\treturn $locale;\n}", "protected function setLang() {\n \n /*\n //setlocale (LC_ALL,\"russian\");\n //setlocale (LC_ALL,\"\");\n $locale = 'ru_RU';\n putenv('LANG='.$locale);\n setlocale(LC_ALL,\"\");\n setlocale(LC_MESSAGES,$locale);\n setlocale(LC_CTYPE,$locale);\n \n //putenv(\"LANG=ru_RU\");\n \n bindtextdomain (\"messages\", XPATH_TEMPLATE_FRONT . DS . 'locale');\n textdomain (\"messages\");\n bind_textdomain_codeset(\"messages\", \"UTF-8\");*/\n \n //setlocale(LC_MESSAGES, $this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n putenv(\"LC_MESSAGES=\".$this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n bindtextdomain('messages', XPATH_TEMPLATE_FRONT . DS . 'locale' . DS);\n bind_textdomain_codeset('messages', 'UTF-8');\n textdomain('messages');\n }", "public function setLocaleManager(LocaleManagerInterface $localeManager);", "function restore_previous_locale()\n {\n }", "function edds_get_stripe_checkout_locale() {\n\treturn apply_filters( 'edd_stripe_checkout_locale', 'auto' );\n}", "function setLocale($locale) {\n\t\treturn $this->setData('locale', $locale);\n\t}", "public function setLocale($locale) {\n\n\t\t// Set the locale manually?\n\t\tif (isset($locale) && in_array($locale, $this->validLocales)) {\n\t\t\t$this->locale = $locale;\n\t\t\treturn;\n\t\t}\n\n\t\t// Is the locale explicitly set as a GET parameter?\n\t\tif (isset($_GET['locale']) && in_array($_GET['locale'], $this->validLocales)) {\n\t\t\t$this->locale = $_GET['locale'];\n\t\t\treturn;\n\t\t}\n\n\t\t// Get language from the browser settings and do a 302 redirect\n\t\tif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n\t\t\t$httpLangs = array();\n\t\t\tforeach ($this->validLocales as $l) {\n\t\t\t\t$httpLangs[] = array('locale' => $l, 'pos' => stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $l));\n\t\t\t}\n\t\t\tusort($httpLangs, 'Content::sortHttpLangs');\n\t\t\t$this->locale = $httpLangs[0]['locale'];\n\t\t\theader('Location: /'.$this->locale.$this->getNonLocalUrl(), true, 302);\n\t\t\texit;\n\t\t}\n\n\t\t// Set language to default\n\t\t// This is really just a fallback in case I made a mistake, actually it should never happen\n\t\t$this->locale = $this->validLocales[0];\n\t}", "private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}", "public function setup_i18n() {\n\t\tload_plugin_textdomain( 'woocommerce-bundle-rate-shipping', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t}", "public function __construct()\n {\n $this->setCode(SolarLite_Config::get('locale', 'en_US'));\n }", "public function getLocale()\n {\n return $this->parameters['hipay.locale'];\n }", "protected function _initLocale() {\n Zend_Locale::setDefault('zh_HK');\n }", "protected function setCountry(): void\n {\n Config::set('butik.country', 'DE');\n }", "public static function setDefaultLocale($locale): void\n {\n static::$defaultFormatSettings['locale'] = static::resolveLocaleCode($locale);\n }", "public function __construct()\n {\n app()->setLocale('arm');\n }", "function GetDefaultLang() : string\n{\n return 'ar';\n}", "public function restore_previous_locale()\n {\n }", "function locale(string $locale = null)\n{\n if (!$locale) {\n return app('translator')->getLocale();\n }\n\n app('translator')->setLocale($locale);\n}", "private function processLocale(): void\n {\n if ($this->request->has(self::LOCALE) && null !== $this->request->get(self::LOCALE, null)) {\n $this->setLocale($this->request->get(self::LOCALE));\n }\n }", "public function setLocale(MvcEvent $e) {\n $translator = $e->getApplication()->getServiceManager()->get('translator');\n $translator->setLocale('ru_RU');\n \n }", "function regional_settings()\n {\n // set the time zone\n $timezones = $this->config->item('timezones');\n if (function_exists('date_default_timezone_set'))\n {\n date_default_timezone_set($timezones[$this->settings->timezones]);\n }\n\n // set site language\n $this->languages = get_languages();\n \n // set language according to this priority:\n // 1) Set user selected language\n // 2) If no session, use the global setting languauge\n if ($this->session->language)\n {\n $this->config->set_item('language', $this->session->language);\n }\n else\n {\n $this->config->set_item('language', $this->settings->default_language);\n \n // save language to session\n $this->session->language = $this->config->item('language');\n }\n }", "private function _initInternationalization()\n {\n $ER = error_reporting(~ E_NOTICE & ~ E_STRICT);\n if(function_exists('date_default_timezone_set')){\n $timezone = App::config()->project->timezone;\n // Set default timezone, due to increased validation of date settings\n // which cause massive amounts of E_NOTICEs to be generated in PHP 5.2+\n date_default_timezone_set(empty($timezone) ? date_default_timezone_get() : $timezone);\n }\n error_reporting($ER);\n $i18n = new App_I18n();\n $languages = $i18n->getSiteLanguages();\n $default_request_lang = 'en';\n $default_site_locale = 'en_US';\n foreach($languages as $lang){\n if($lang['is_active'] and $lang['is_default'] > 0){\n $default_request_lang = $lang['request_lang'];\n $default_site_locale = $lang['locale'];\n break;\n }\n }\n Zend_Locale::setDefault($default_request_lang);\n $i18n->setLocale(new Zend_Locale($default_request_lang));\n App::setI18N($i18n);\n $this->_language_identificator = $default_request_lang;\n }", "abstract public function getLocaleCode();", "public function actionSetLocale($locale = 'en_us')\n {\n //Set cookies\n $localeCookie = new CHttpCookie('Locale', $locale);\n $localeCookie->expire = time() + 15 * 24 * 3600;\n Yii::app()->request->cookies['Locale'] = $localeCookie;\n\n //Set application langauge\n Yii::app()->setLanguage($locale);\n }", "public function setLocale($locale) {\n $this->locale = $locale;\n }", "function setLocale($inLocale = null) {\n\t\t$locale = false;\n\t\t$source = false;\n\t\tif ( $inLocale === null || strlen($inLocale) < 2 ) {\n\t\t\tif ( !$locale && isset($_COOKIE['locale']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_COOKIE['locale'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_COOKIE;\n\t\t\t}\n\t\t\tif ( !$locale && $this->getSession() instanceof mvcSessionBase ) {\n\t\t\t\t$locale = $this->getSession()->getParam('locale');\n\t\t\t\t$source = self::LOCALE_SOURCE_SESSION;\n\t\t\t}\n\t\t\tif ( !$locale && isset($_REQUEST['lang']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_REQUEST['lang'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_REQUEST;\n\t\t\t}\n\t\t\tif ( !$locale && strlen($this->getRequestUri()) > 0 ) {\n\t\t\t\t// check first chunk of request\n\t\t\t\t$pieces = explode('/', $this->getRequestUri());\n\t\t\t\tif ( strlen($pieces[0]) == 0 ) {\n\t\t\t\t\tunset($pieces[0]);\n\t\t\t\t}\n\t\t\t\t$locale = array_shift($pieces);\n\t\t\t\t$source = self::LOCALE_SOURCE_URI;\n\t\t\t}\n\t\t} else {\n\t\t\t$locale = strip_tags(trim(stripslashes($inLocale)));\n\t\t\t$source = self::LOCALE_SOURCE_OTHER;\n\t\t}\n\t\t\n\t\tif ( systemLocale::isValidLocale($locale, true) ) {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, $locale);\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, $source);\n\t\t} else {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, (string) system::getLocale());\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, self::LOCALE_SOURCE_SYSTEM);\n\t\t}\n\t\treturn $this;\n\t}", "function UseDefaultLocale() {\n $array = $this->_readDefaultLocaleInfo();\n if($array == false ||\n !isset($array[\"id\"])) {\n return 'en'; //Earlier versions of Openbiblio only supported English\n }\n else {\n $this->_locale = $array[\"id\"];\n $this->localekey = $array[\"code\"];\n //$this->_charset = $array[\"charset\"];\n $this->_isdefaultlocale = ($array[\"default_flg\"] == \"Y\");\n\t\t$this->_localeDescr = $array[\"description\"];\n return $array[\"id\"]; \n }\n }", "function site_locale($locale = null)\n{\n if ($locale) {\n return config(['app.locale' => $locale]);\n }\n\n return config('app.locale');\n}", "public static function setNextLocale($locale) {\n $_SESSION['core\\locale'] = \\substr($locale, 0, 2);\n }", "public function setLocale($locale) {\n $availableLanguages = $this->languageSettings['available'];\n if (array_key_exists($locale, $availableLanguages)) {\n $locale_code = $locale;\n } else {\n $default = $this->languageSettings['default'];\n $locale_code = $default;\n }\n $session = new SessionManager();\n $session->putParameter('locale', $locale_code);\n }", "public function preferredLocale()\n {\n return $this->locale;\n }", "function get_locale(): string\n{\n $locale = \\Locale::acceptFromHttp(input_server('HTTP_ACCEPT_LANGUAGE'));\n if (!$locale) {\n $locale = 'en_US';\n }\n return $locale;\n}", "public function __construct()\n\t{\n\t\t\\App::setLocale('en');\n\t}", "function setLocale($localename)\r\n\t{\r\n\t\t$this->pathLocale = $localename;\r\n\t\t$f = $this->_getFileName();\r\n\t\t/* load language configuration */\r\n\t\tif (file_exists($f))\r\n\t\t{\r\n\t\t\tglobal $tmp;\r\n\t\t\tinclude($f);\r\n\t\t\tif ($this->varMode == 'names')\r\n\t\t\t{\r\n#\t\t\t\t$this->lang = array_merge($this->lang, ${$this->varName});\r\n\t\t\t\t$this->lang = ${$this->varName};\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function setLang(){\n\n\t\tif( isset($_GET['lang']) )\n\t\t\t$lang\t= $_GET['lang'];\n\n\t\telse{\n\t\t\t$sess_lang\t= session('lang');\n\t\t\t$lang\t\t= $sess_lang ? $sess_lang : App::getLocale();\n\t\t}\n\n\t\tsession(['lang'=>$lang]);\n\t\tApp::setLocale( $lang );\n\t}", "function acf_get_locale()\n{\n}", "function get_user_locale($user = 0)\n {\n }", "private function initLocale()\n {\n if (!$this->initialised) {\n putenv(\"LANG=$this->locale\");\n setlocale(LC_ALL, $this->locale);\n\n $this->initialised = true;\n }\n }", "public function getLocaleManager();", "public function setLocale(string $locale = null)\n {\n $locales = [];\n if (empty($locale)) {\n array_push(\n $locales,\n 'en-EN.utf8',\n 'en_EN.utf8',\n 'en-EN',\n 'en-US.utf8',\n 'en_US.utf8',\n 'en-US',\n 'en',\n 'en_US'\n );\n\n if (!defined('BBN_LOCALE')) {\n // No user detection for CLI: default language\n if ($this->_mode === 'cli') {\n if (defined('BBN_LANG')) {\n $lang = BBN_LANG;\n }\n }\n else {\n $user_locales = self::detectLanguage();\n if (!defined('BBN_LANG') && $user_locales) {\n if (strpos($user_locales[0], '-')) {\n if ($lang = X::split($user_locales[0], '-')[0]) {\n define('BBN_LANG', $lang);\n }\n }\n elseif (strpos($user_locales[0], '_')) {\n if ($lang = X::split($user_locales[0], '_')[0]) {\n define('BBN_LANG', $lang);\n }\n }\n elseif ($user_locales[0]) {\n define('BBN_LANG', $user_locales[0]);\n }\n }\n\n if (!defined('BBN_LANG')) {\n throw new \\Exception(\"Impossible to determine the language\");\n }\n\n $lang = BBN_LANG;\n }\n\n if (isset($lang)) {\n array_unshift(\n $locales,\n $lang . '-' . strtoupper($lang) . '.utf8',\n $lang . '_' . strtoupper($lang) . '.utf8',\n $lang . '-' . strtoupper($lang),\n $lang\n );\n\n if (!empty($user_locales)) {\n array_unshift($locales, ...$user_locales);\n }\n }\n }\n }\n elseif (!strpos($locale, '-') && !strpos($locale, '_')) {\n if ($locale === 'en') {\n array_unshift(\n $locales,\n 'en_US.utf8',\n 'en-US.utf8',\n 'en_US',\n 'en-US'\n );\n }\n\n array_unshift(\n $locales,\n strtolower($locale) . '-' . strtoupper($locale) . '.utf8',\n strtolower($locale) . '_' . strtoupper($locale) . '.utf8',\n strtolower($locale) . '-' . strtoupper($locale),\n strtolower($locale)\n );\n }\n else {\n $locales[] = $locale;\n }\n\n if ($confirmed = $this->_tryLocales($locales)) {\n if (!defined('BBN_LOCALE')) {\n define('BBN_LOCALE', $confirmed);\n }\n\n $this->_locale = $confirmed;\n if (!isset($lang)) {\n $lang = X::split(X::split($this->_locale, '-')[0], '_')[0];\n }\n\n putenv(\"LANG=\".$lang);\n putenv(\"LC_MESSAGES=\".$this->_locale);\n setlocale(LC_MESSAGES, $this->_locale);\n }\n else {\n throw new \\Exception(\"Impossible to find a corresponding locale on this server for this app\");\n }\n }", "public function setLocale($locale)\n\t {\n\t \t $this->json['params'][$this->account]['locale'] = $locale;\n\t \t \n\t \t return $this;\n\t }", "public static function locale(): string\n {\n // in the end to handle that case\n return Arr::get(config('currencies'), strtolower(static::currency()).'.locale', 'en_US') ?? 'en_US';\n }" ]
[ "0.7341603", "0.70109236", "0.67024475", "0.666348", "0.6543944", "0.6496231", "0.6469882", "0.6463589", "0.6458139", "0.6364509", "0.63393587", "0.63272625", "0.62912565", "0.6272205", "0.62619877", "0.6246781", "0.6220771", "0.6220205", "0.620067", "0.6169296", "0.6166886", "0.6160352", "0.60892373", "0.60889256", "0.60705745", "0.60681516", "0.60589844", "0.60566026", "0.6056352", "0.6047769", "0.60462326", "0.6019493", "0.5985017", "0.5982808", "0.59599745", "0.5948268", "0.5901951", "0.58923215", "0.5890264", "0.58899724", "0.5889142", "0.5885949", "0.5878883", "0.5860212", "0.5851", "0.5851", "0.5797886", "0.578821", "0.578821", "0.578821", "0.5768825", "0.576352", "0.575912", "0.5754282", "0.5747659", "0.574703", "0.5743645", "0.57344526", "0.5728086", "0.57263213", "0.57112384", "0.57107294", "0.5693968", "0.56939065", "0.56918865", "0.569133", "0.5660619", "0.56602657", "0.56517303", "0.56054574", "0.55968755", "0.55849624", "0.55833393", "0.557349", "0.5562647", "0.55513525", "0.55507743", "0.5550577", "0.5550108", "0.55443966", "0.55382586", "0.5537903", "0.5511898", "0.5510804", "0.5509913", "0.55003554", "0.5494513", "0.5484692", "0.5467254", "0.54641", "0.54538417", "0.5452393", "0.54512435", "0.5448486", "0.54414296", "0.5438141", "0.5429455", "0.54284835", "0.5425134", "0.54202855" ]
0.55508506
76
Contact with PayPal to get TOKEN 1st Step
public function setExpressCheckout($price, $user_email) { $price = round($price, 2); $nvpstr = '&RETURNURL=' . urlencode($this->_url_return) . '&CANCELURL=' . urlencode($this->_url_cancel) . '&PAYMENTREQUEST_0_AMT=' . $price . '&PAYMENTREQUEST_0_CURRENCYCODE=' . $this->_currency . '&LOCALECODE=' . $this->_locale . '&PAYMENTREQUEST_0_PAYMENTACTION=Sale&ALLOWNOTE=1&NOSHIPPING=1'; $i = 0; $nvpstr .= '&L_PAYMENTREQUEST_0_NAME' . $i . '=' . urlencode('Add funds to ' . $user_email) . '&L_PAYMENTREQUEST_0_AMT' . $i . '=' . $price . '&L_PAYMENTREQUEST_0_QTY' . $i . '=1'; $resArray = $this->hash_call('SetExpressCheckout', $nvpstr); if ($resArray['ACK'] == self::ACK_SUCCESS) { return $this->_pp_url . $resArray['TOKEN']; } //Dao_Abstract::getLogger()->log( // "Acd_Payment_PayPal: setExpressCheckout() failed\n" . print_r($resArray, true), Zend_Log::DEBUG); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function make_payment($token) {\n\t // Getting settings.\n\t $settings = $this->pex_settings;\n\t\t $nvpstr=\"&TOKEN=\".$token;\n\t\t // call api with token and getting result.\n\t\t $resarray = $this->hash_call(\"GetExpressCheckoutDetails\",$nvpstr);\n\t\t $ack = strtoupper($resarray[\"ACK\"]);\n\t\t if($ack == 'SUCCESS' || $ack == 'SUCCESSWITHWARNING'){\n\t\t\tini_set('session.bug_compat_42',0);\n\t\t\tini_set('session.bug_compat_warn',0);\n\t\t\t$token = trim($resarray['TOKEN']);\n\t\t\t$payment_amount = trim($resarray['AMT']);\n\t\t\t$payerid = trim($resarray['PAYERID']);\n\t\t\t$server_name = trim($_SERVER['SERVER_NAME']);\n\t\t\t$nvpstr='&TOKEN='.$token.'&PAYERID='.$payerid.'&PAYMENTACTION='.$settings['payment_type'].'&AMT='.$payment_amount.'&CURRENCYCODE='.$settings['currency'].'&IPADDRESS='.$server_name ;\n\t\t\t$resarray = $this->hash_call(\"DoExpressCheckoutPayment\",$nvpstr);\n\t\t\t$ack = strtoupper($resarray[\"ACK\"]);\n\t\t\t// checking response for success.\n\t\t\tif($ack != 'SUCCESS' && $ack != 'SUCCESSWITHWARNING'){\n\t\t\t\treturn $resarray;\n\t\t\t}\n\t\t\telse {\n\t\t\t return $resarray;\n\t\t\t}\n\t\t } \n\t\t else \n\t\t {\n\t\t\treturn $resarray;\n\t\t }\n\t}", "function getToken(){\n$ch = curl_init();\n\n$clientId = \"AYt_dJ6QdBSaPhkMlve0v9rOGW5H-B5KNsniQ73nBzf3z1PdO6UYpfy8PqYNOmwdfJXhL9IMzhgTJHFG\";\n$secret = \"ELU5wuQabDdOIYLRwIQIZ31rPP8VcV5eXyHOwy1jVkqiLJP2awH9xRDA608ljN8JiPDVov35dDXH10wz\";\n\n$domain = \"https://api.sandbox.paypal.com/v1/oauth2/token\";\n\ncurl_setopt($ch, CURLOPT_URL,$domain );\ncurl_setopt($ch, CURLOPT_HEADER, false);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($ch, CURLOPT_SSLVERSION , 6); //NEW ADDITION\n// CURLOPT_HTTPHEADER\n//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\ncurl_setopt($ch, CURLOPT_POST, true);\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n\ncurl_setopt($ch, CURLOPT_USERPWD, $clientId.\":\".$secret);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n//curl_setopt($ch, CURLOPT_SSLVERSION , 6); \n\n$result = curl_exec($ch);\n $obj= json_decode($result);\n\n // print_r($obj); die; \n\n $get_access_token= $obj->access_token;\n\n\n\n if(empty($result)){\n \tdie(\"Error: No response.\");\n }else{\n return $get_access_token;\n \t// 'Acesss Token::';\n \t//echo $get_access_token;\n //echo\t$msg= $get_access_token.'::<br/>'; //die; \n }\n\ncurl_close($ch); //THIS CODE IS NOW WORKING!\n\n }", "public function returnFromPaypal($token)\n {\n $quote = $this->_quote;\n $payment = $quote->getPayment();\n\n $setServiceResponse = $this->_checkoutSession->getSetServiceResponse();\n $request = $this->dataBuilder->buildCheckStatusService($setServiceResponse, $quote);\n $getDetailsResponse = $this->_api->checkStatusService($request);\n $this->_checkoutSession->setGetDetailsResponse($getDetailsResponse);\n\n $isBillingAgreement = $payment->getAdditionalInformation(VaultConfigProvider::IS_ACTIVE_CODE);\n\n // signing up for billing agreement\n if ($isBillingAgreement) {\n $baRequest = $this->dataBuilder->buildBillingAgreementService(\n $setServiceResponse['requestID'],\n $quote\n );\n\n $baResponse = $this->_api->billingAgreementService($baRequest);\n\n // saving BA info to payment\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_REQUEST_ID, $baResponse->requestID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_EMAIL, $baResponse->billTo->email);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_PAYER_ID, $baResponse->apReply->payerID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_ID, $baResponse->apReply->billingAgreementID);\n $payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BA_DATE, $baResponse->apBillingAgreementReply->dateTime);\n }\n\n $this->ignoreAddressValidation();\n\n // import shipping address\n $exportedShippingAddress = $getDetailsResponse['shippingAddress'];\n if (!$quote->getIsVirtual()) {\n $shippingAddress = $quote->getShippingAddress();\n if ($shippingAddress) {\n if ($exportedShippingAddress\n && $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) == 1\n ) {\n $shippingAddress = $this->_setExportedAddressData($shippingAddress, $exportedShippingAddress);\n $shippingAddress->setPrefix(null);\n $shippingAddress->setCollectShippingRates(true);\n $shippingAddress->setSameAsBilling(0);\n }\n\n // import shipping method\n $code = '';\n $quote->getPayment()->setAdditionalInformation(\n self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD,\n $code\n );\n }\n }\n\n // import billing address\n $portBillingFromShipping = $quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON) && !$quote->isVirtual();\n if ($portBillingFromShipping) {\n $billingAddress = clone $shippingAddress;\n $billingAddress->unsAddressId()->unsAddressType()->setCustomerAddressId(null);\n $data = $billingAddress->getData();\n $data['save_in_address_book'] = 0;\n $quote->getBillingAddress()->addData($data);\n $quote->getShippingAddress()->setSameAsBilling(1);\n } else {\n $billingAddress = $quote->getBillingAddress();\n }\n $exportedBillingAddress = $getDetailsResponse['billingAddress'];\n\n $billingAddress = $this->_setExportedAddressData($billingAddress, $exportedBillingAddress, true);\n $billingAddress->setCustomerNote($exportedBillingAddress->getData('note'));\n $billingAddress->setCustomerAddressId(null); // force new address creation for the order instead of updating address book entity\n $quote->setBillingAddress($billingAddress);\n $quote->setCheckoutMethod($this->getCheckoutMethod());\n\n // import payment info\n $payment->setMethod($this->_methodType);\n $payment\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $getDetailsResponse['paypalPayerId'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_EMAIL, $getDetailsResponse['paypalCustomerEmail'])\n ->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token)\n ;\n $quote->collectTotals();\n $this->quoteRepository->save($quote);\n }", "private function getAccessToken()\n {\n if (time() < $this->get_option('paypal_access_token_expires_at')) {\n return $this->get_option('paypal_access_token');\n }\n\n $response = wp_remote_retrieve_body(wp_remote_post('https://api.sandbox.paypal.com/v1/oauth2/token', [\n 'method' => 'POST',\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'Authorization' => 'Basic ' . base64_encode($this->get_option('client_id') . ':' . $this->get_option('client_secret'))\n ],\n 'body' => [\n 'client_id' => $this->get_option('client_id'),\n 'client_secret' => $this->get_option('client_secret'),\n 'grant_type' => 'client_credentials'\n ]\n ]));\n\n $response = json_decode($response, true);\n\n add_option('paypal_access_token', $response['access_token']);\n add_option('paypal_access_token_expires_at', time() + $response['expires_in']);\n\n return $response['access_token'];\n }", "public function GetToken()\n {\n $args['method'] = 'getToken';\n $args['secretkey'] = $this->SecretKey;\n $response = $this->GetPublic('apiv1','payexpress',$args);\n\n return (!empty($response['token'])) ? $response['token'] : '';\n }", "public function generate_express_checkout_token() {\n\n\t\t$step_id = intval( $_POST['step_id'] );\n\t\t$order_id = intval( $_POST['order_id'] );\n\t\t$order_key = sanitize_text_field( $_POST['order_key'] );\n\t\t$session_key = $_POST['session_key'];\n\n\t\t$is_valid_order = true;\n\n\t\tif ( $is_valid_order ) {\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t$response = $this->initiate_express_checkout_request(\n\t\t\t\tarray(\n\t\t\t\t\t'currency' => $order ? $order->get_currency() : get_woocommerce_currency(),\n\t\t\t\t\t'return_url' => $this->get_callback_url(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action' => 'cartflows_paypal_return',\n\t\t\t\t\t\t\t'step_id' => $step_id,\n\t\t\t\t\t\t\t'order_id' => $order_id,\n\t\t\t\t\t\t\t'order_key' => $order_key,\n\t\t\t\t\t\t\t'session_key' => $session_key,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'cancel_url' => $this->get_callback_url(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'action' => 'cancel_url',\n\t\t\t\t\t\t\t'step_id' => $step_id,\n\t\t\t\t\t\t\t'order_id' => $order_id,\n\t\t\t\t\t\t\t'order_key' => $order_key,\n\t\t\t\t\t\t\t'session_key' => $session_key,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'notify_url' => $this->get_callback_url( 'notify_url' ),\n\t\t\t\t\t'order' => $order,\n\t\t\t\t\t'step_id' => $step_id,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\tif ( isset( $response['TOKEN'] ) && '' !== $response['TOKEN'] ) {\n\n\t\t\t\twp_send_json(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t\t'token' => $response['TOKEN'],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\twp_send_json(\n\t\t\tarray(\n\t\t\t\t'result' => 'error',\n\t\t\t\t'response' => $response,\n\t\t\t)\n\t\t);\n\n\t}", "private function _expressCheckoutPayment()\r\n\t{\r\n\t\t/* Verifying the Payer ID and Checkout tokens (stored in the customer cookie during step 2) */\r\n\t\tif (isset($this->context->cookie->paypal_express_checkout_token) && !empty($this->context->cookie->paypal_express_checkout_token))\r\n\t\t{\r\n\t\t\t/* Confirm the payment to PayPal */\r\n\t\t\t$currency = new Currency((int)$this->context->cart->id_currency);\r\n\t\t\t$result = $this->paypal_usa->postToPayPal('DoExpressCheckoutPayment', '&TOKEN='.urlencode($this->context->cookie->paypal_express_checkout_token).'&PAYERID='.urlencode($this->context->cookie->paypal_express_checkout_payer_id).'&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_AMT='.$this->context->cart->getOrderTotal(true).'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($currency->iso_code).'&IPADDRESS='.urlencode($_SERVER['SERVER_NAME']));\r\n\r\n\t\t\tif (strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING')\r\n\t\t\t{\r\n\t\t\t\t/* Prepare the order status, in accordance with the response from PayPal */\r\n\t\t\t\tif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'COMPLETED')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYMENT');\r\n\t\t\t\telseif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'PENDING')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYPAL');\r\n\t\t\t\telse\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_ERROR');\r\n\r\n\t\t\t\t/* Prepare the transaction details that will appear in the Back-office on the order details page */\r\n\t\t\t\t$message =\r\n\t\t\t\t\t\t'Transaction ID: '.$result['PAYMENTINFO_0_TRANSACTIONID'].'\r\n\t\t\t\tTransaction type: '.$result['PAYMENTINFO_0_TRANSACTIONTYPE'].'\r\n\t\t\t\tPayment type: '.$result['PAYMENTINFO_0_PAYMENTTYPE'].'\r\n\t\t\t\tOrder time: '.$result['PAYMENTINFO_0_ORDERTIME'].'\r\n\t\t\t\tFinal amount charged: '.$result['PAYMENTINFO_0_AMT'].'\r\n\t\t\t\tCurrency code: '.$result['PAYMENTINFO_0_CURRENCYCODE'].'\r\n\t\t\t\tPayPal fees: '.$result['PAYMENTINFO_0_FEEAMT'];\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_EXCHANGERATE']) && !empty($result['PAYMENTINFO_0_EXCHANGERATE']))\r\n\t\t\t\t\t$message .= 'Exchange rate: '.$result['PAYMENTINFO_0_EXCHANGERATE'].'\r\n\t\t\t\tSettled amount (after conversion): '.$result['PAYMENTINFO_0_SETTLEAMT'];\r\n\r\n\t\t\t\t$pending_reasons = array(\r\n\t\t\t\t\t'address' => 'Customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments.',\r\n\t\t\t\t\t'echeck' => 'The payment is pending because it was made by an eCheck that has not yet cleared.',\r\n\t\t\t\t\t'intl' => 'You hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.',\r\n\t\t\t\t\t'multi-currency' => 'You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.',\r\n\t\t\t\t\t'verify' => 'You are not yet verified, you have to verify your account before you can accept this payment.',\r\n\t\t\t\t\t'other' => 'Unknown, for more information, please contact PayPal customer service.');\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_PENDINGREASON']) && !empty($result['PAYMENTINFO_0_PENDINGREASON']) && isset($pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']]))\r\n\t\t\t\t\t$message .= \"\\n\".'Pending reason: '.$pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']];\r\n\r\n\t\t\t\t/* Creating the order */\r\n\t\t\t\t$customer = new Customer((int)$this->context->cart->id_customer);\r\n\t\t\t\tif ($this->paypal_usa->validateOrder((int)$this->context->cart->id, (int)$order_status, (float)$result['PAYMENTINFO_0_AMT'], $this->paypal_usa->displayName, $message, array(), null, false, $customer->secure_key))\r\n\t\t\t\t{\r\n\t\t\t\t\t/* Store transaction ID and details */\r\n\t\t\t\t\t$this->paypal_usa->addTransactionId((int)$this->paypal_usa->currentOrder, $result['PAYMENTINFO_0_TRANSACTIONID']);\r\n\t\t\t\t\t$this->paypal_usa->addTransaction('payment', array('source' => 'express', 'id_shop' => (int)$this->context->cart->id_shop, 'id_customer' => (int)$this->context->cart->id_customer, 'id_cart' => (int)$this->context->cart->id,\r\n\t\t\t\t\t\t'id_order' => (int)$this->paypal_usa->currentOrder, 'id_transaction' => $result['PAYMENTINFO_0_TRANSACTIONID'], 'amount' => $result['PAYMENTINFO_0_AMT'],\r\n\t\t\t\t\t\t'currency' => $result['PAYMENTINFO_0_CURRENCYCODE'], 'cc_type' => '', 'cc_exp' => '', 'cc_last_digits' => '', 'cvc_check' => 0,\r\n\t\t\t\t\t\t'fee' => $result['PAYMENTINFO_0_FEEAMT']));\r\n\r\n\t\t\t\t\t/* Reset the PayPal's token so the customer will be able to place a new order in the future */\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Redirect the customer to the Order confirmation page */\r\n\t\t\t\tif (_PS_VERSION_ < 1.4)\r\n\t\t\t\t\tTools::redirect('order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\telse\r\n\t\t\t\t\tTools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t\t/* If PayPal is returning an error code equal to 10486, it means either that:\r\n\t\t\t\t *\r\n\t\t\t\t * - Billing address could not be confirmed\r\n\t\t\t\t * - Transaction exceeds the card limit\r\n\t\t\t\t * - Transaction denied by the card issuer\r\n\t\t\t\t * - The funding source has no funds remaining\r\n\t\t\t\t *\r\n\t\t\t\t * Therefore, we are displaying a new PayPal Express Checkout button and a warning message to the customer\r\n\t\t\t\t * He/she will have to go back to PayPal to select another funding source or resolve the payment error\r\n\t\t\t\t */\r\n\t\t\t\tif (isset($result['L_ERRORCODE0']) && (int)$result['L_ERRORCODE0'] == 10486)\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t\t$this->context->smarty->assign('paypal_usa_action', $this->context->link->getModuleLink('paypalusa', 'expresscheckout', array('pp_exp_initial' => 1)));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "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 getPartnerRequestToken()\n {\n $uri = $this->urlRequestToken();\n\n $client = $this->createHttpClient();\n\n $header = $this->temporaryPartnerRequestTokenProtocolHeader($uri);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n //echo \"dump data\";\n //var_dump($data);\n\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n //echo 'DECODE<br/>';\n //echo \"oauth_token: \" . $oauth_token.'<br/>';\n //echo \"oauth_secret\" . $oauth_token_secret.'<br/>';\n\n\n\n //////////////////////////////\n $uri = $this->urlAccessToken();\n\n $client = $this->createHttpClient();\n\n $credentials = $this->createClientCredentials(['identifier' => $oauth_token, 'secret' => $oauth_token_secret]);\n\n $header = $this->temporaryPartnerAccessTokenProtocolHeader($uri, $credentials);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n //var_dump($e);\n //exit;\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n\n //echo \"final:<br/>\";\n //var_dump($data);\n $resp = $data;\n\n return $resp;\n }", "function retrieveAddressForToken()\n{\n $usertoken = $_SESSION['usertoken'];\n\n $payload = array(\n 'identifier' => $usertoken, //required\n );\n\n //this will return a jsonencoded array with a payment information about the user if found\n $endpoint = 'https://api.coinbee.io/retrieve/address/identifier';\n\n return doCurl($endpoint, $payload);\n}", "public function perform_express_checkout_details_request( $token ) {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\t$api_prefix = '';\n\n\t\tif ( 'live' !== $environment ) {\n\t\t\t$api_prefix = 'sandbox_';\n\t\t}\n\n\t\t$this->setup_api_vars(\n\t\t\t$this->key,\n\t\t\t$environment,\n\t\t\t$this->wc_gateway()->get_option( $api_prefix . 'api_username' ),\n\t\t\t$this->wc_gateway()->get_option( $api_prefix . 'api_password' ),\n\t\t\t$this->wc_gateway()->get_option( $api_prefix . 'api_signature' )\n\t\t);\n\n\t\t$this->set_express_checkout_method( $token );\n\t\t$this->add_credentials_param( $this->api_username, $this->api_password, $this->api_signature, 124 );\n\t\t$request = new stdClass();\n\t\t$request->path = '';\n\t\t$request->method = 'POST';\n\t\t$request->body = $this->to_string();\n\n\t\treturn $this->perform_request( $request );\n\t}", "private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}", "private function generateToken() {\n $response = null;\n $args = [\n 'body' => $this->body,\n 'timeout' => '5',\n 'redirection' => '5',\n 'httpversion' => '1.0',\n 'blocking' => true,\n 'headers' => [],\n 'cookies' => [],\n ];\n \n $response = wp_remote_post($this->url, $args);\n \n if ($response instanceof WP_Error) {\n throw new Exception(\"Error trying to connect to instance\");\n } else {\n $responseBody = json_decode($response['body']);\n\n if (isset($responseBody->error)) {\n throw new Exception(\"Error with Salesforce login credentials\");\n } else {\n return $responseBody;\n }\n }\n }", "public function paypal(Request $request)\n {\nrequire 'vendor/autoload.php';\n\n$apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AedIVbiADiRsvL3jFM6Z6Kcx5wSgwyBIMJFFQq0UFcBfrew-mhHGMZVpqWJhvQGbn-HkUpt5F023HH4n',\n 'EIs32ISB07N21Ey0z2a4Qthy5Obo173s1wD9Yx9hhiYJoC2bxdnNJVLpb2MvnT5QTYK74RBMg84FvPd4'\n )\n);\n\n return response()->json([\n 'message' => 'paypal route hit',\n 'request' => $request->all()\n ]);\n }", "private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }", "private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }", "public function GetPaymentAccounts($token);", "public function paypal_payment($paymentID = \"\", $paymentToken = \"\", $payerID = \"\", $paypalClientID = \"\", $paypalSecret = \"\") {\n $paypal_keys = get_settings('paypal');\n $paypal_data = json_decode($paypal_keys);\n\n $paypalEnv = $paypal_data[0]->mode; // Or 'production'\n if ($paypal_data[0]->mode == 'sandbox') {\n $paypalURL = 'https://api.sandbox.paypal.com/v1/';\n } else {\n $paypalURL = 'https://api.paypal.com/v1/';\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $paypalURL.'oauth2/token');\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $paypalClientID.\":\".$paypalSecret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n $response = curl_exec($ch);\n curl_close($ch);\n\n if(empty($response)){\n return false;\n }else{\n $jsonData = json_decode($response);\n $curl = curl_init($paypalURL.'payments/payment/'.$paymentID);\n curl_setopt($curl, CURLOPT_POST, false);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer ' . $jsonData->access_token,\n 'Accept: application/json',\n 'Content-Type: application/xml'\n ));\n $response = curl_exec($curl);\n curl_close($curl);\n\n // Transaction data\n $result = json_decode($response);\n\n // CHECK IF THE PAYMENT STATE IS APPROVED OR NOT\n if($result && $result->state == 'approved'){\n return true;\n }else{\n return false;\n }\n }\n }", "function get_apps_auth_token($merchantid, $secret) {\n\t\n $token_url = \"https://ipguat.apps.net.pk/Ecommerce/api/Transaction/GetAccessToken?MERCHANT_ID=\".$merchantid.\"&SECURED_KEY=\".$secret; error_log($token_url );\n\t\n $data = array();\n $jsonpayload = json_encode($data);\n $response = curl_request($token_url, $jsonpayload);\n $response_decode = json_decode($response);\n \n if (isset($response_decode->ACCESS_TOKEN)) {\t\n return $response_decode->ACCESS_TOKEN;\n }\n return;\n}", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function getToken()\n {\n $api_key = \"lv_I4EE93OHHDADBW7DVLNJ\";\n $secret_key = \"lv_HTCYZPYLQG7O12C0DC5PXMLWLZ02T2\";\n \\Unirest\\Request::verifyPeer(false);\n $headers = array('content-type' => 'application/json');\n $query = array('apiKey' => $api_key, 'secret' => $secret_key);\n $body = \\Unirest\\Request\\Body::json($query);\n $response = \\Unirest\\Request::post('https://live.moneywaveapi.co/v1/merchant/verify', $headers, $body);\n $response = json_decode($response->raw_body, true);\n $status = $response['status'];\n if (!$status == 'success') {\n echo 'INVALID TOKEN';\n } else {\n $token = $response['token'];\n return $token;\n }\n }", "public function getPayPalResponse(){\r\n\t\t\r\n\t}", "private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }", "public function process_payment($nvpstr) {\n\t // Getting settings.\n\t $settings = $this->pex_settings;\n\t\t// call api with nvp string andset checkout request.\n\t $resarray = $this->hash_call(\"SetExpressCheckout\",$nvpstr);\n\t\t$ack = strtoupper($resarray[\"ACK\"]);\n if($ack==\"SUCCESS\") {\n\t\t $token = trim($resarray[\"TOKEN\"]);\n\t $payurl = $settings['api_url'].$token;\n\t\t // redirect user to paypal url.\n\t\t header(\"Location: \".$payurl);\n\t\t} \n\t\telse {\n\t\t return $resarray;\n\t\t}\n\t}", "function complete($postcard_id = null){\n\t\t$paypal_config = array('Sandbox' => $this->sandbox);\n\t\t$paypal = new PayPal($paypal_config);\n\t\t\n\t\t#####[ CALL GET EXPRESS CHECKOUT DETAILS ]###########################\n\t\t\n\t\t#echo \"<pre>\";\n\t\t#print_r($_SESSION);\n\t\t#echo \"</pre>\";\n\t\t#exit;\n\t\t\n\t\t$GECDResult = $paypal -> GetExpressCheckoutDetails($this->session->userdata('Token'));\n\t\t$this->session->set_userdata('paypal_errors', $GECDResult['ERRORS']);\n\t\tif(strtolower($GECDResult['ACK']) != 'success' && strtolower($GECDResult['ACK']) != 'successwithwarning')\n\t\t{\n\t\t\tredirect('payment/error');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t#####[ SET EXPRESS CHECKOUT ]#######################################\n\t\t\n\t\t// DoExpressCheckout\n\t\t$DECPFields = array(\n\t\t\t\t\t\t\t'token' => $this->session->userdata('Token'), \t\t\t\t\t\t\t\t// Required. A timestamped token, the value of which was returned by a previous SetExpressCheckout call.\n\t\t\t\t\t\t\t'paymentaction' => 'Sale', \t\t\t\t\t\t// Required. How you want to obtain payment. Values can be: Authorization, Order, Sale. Auth indiciates that the payment is a basic auth subject to settlement with Auth and Capture. Order indiciates that this payment is an order auth subject to settlement with Auth & Capture. Sale indiciates that this is a final sale for which you are requesting payment.\n\t\t\t\t\t\t\t'payerid' => isset($GECDResult['PAYERID']) ? $GECDResult['PAYERID'] : '', \t\t\t\t\t\t\t// Required. Unique PayPal customer id of the payer. Returned by GetExpressCheckoutDetails, or if you used SKIPDETAILS it's returned in the URL back to your RETURNURL.\n\t\t\t\t\t\t\t'payerid' => isset($GECDResult['PAYERID']) ? $GECDResult['PAYERID'] : '',\n\t\t\t\t\t\t\t'returnfmfdetails' => '1' \t\t\t\t\t// Flag to indiciate whether you want the results returned by Fraud Management Filters or not. 1 or 0.\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t$PaymentDetails = array(\n\t\t\t\t\t\t\t\t'amt' => $this->session->userdata('amount'), \t\t\t\t\t\t\t// Required. Total amount of the order, including shipping, handling, and tax.\n\t\t\t\t\t\t\t\t'currencycode' => $this->session->userdata('currency'), \t\t\t\t\t// A three-character currency code. Default is USD.\n\t\t\t\t\t\t\t\t'itemamt' => '', \t\t\t\t\t\t// Required if you specify itemized L_AMT fields. Sum of cost of all items in this order. \n\t\t\t\t\t\t\t\t'shippingamt' => '', \t\t\t\t\t// Total shipping costs for this order. If you specify SHIPPINGAMT you mut also specify a value for ITEMAMT.\n\t\t\t\t\t\t\t\t'handlingamt' => '', \t\t\t\t\t// Total handling costs for this order. If you specify HANDLINGAMT you mut also specify a value for ITEMAMT.\n\t\t\t\t\t\t\t\t'taxamt' => '', \t\t\t\t\t\t// Required if you specify itemized L_TAXAMT fields. Sum of all tax items in this order. \n\t\t\t\t\t\t\t\t'desc' => 'Epic Thanks, 501(c)(3) Epic Change', \t\t\t\t\t\t\t// Description of items on the order. 127 char max.\n\t\t\t\t\t\t\t\t'custom' => $this->session->userdata('postcard_id'), \t\t\t\t\t\t// Free-form field for your own use. 256 char max.\n\t\t\t\t\t\t\t\t'invnum' => $this->session->userdata('invoice'), \t\t\t\t\t\t// Your own invoice or tracking number. 127 char max.\n\t\t\t\t\t\t\t\t//'notifyurl' => site_url() .\"/payment/ipn\" \t\t\t\t\t\t// URL for receiving Instant Payment Notifications\n\t\t\t\t\t\t\t\t);\n\t\t\n\t\t$OrderItems = array();\n\t\t\n\t\t$Item\t\t = array(\n\t\t\t\t\t\t'l_name' => $this->session->userdata('item_name'), \t\t\t\t\t\t// Item name. 127 char max.\n\t\t\t\t\t\t'l_amt' => $this->session->userdata('amount'), \t\t\t\t\t\t// Cost of item.\n\t\t\t\t\t\t'l_number' => $this->session->userdata('postcard_id'), \t\t\t\t\t\t// Item number. 127 char max.\n\t\t\t\t\t\t'l_qty' => '1' \t\t\t\t\t\t// Item qty on order. Any positive integer.\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\tarray_push($OrderItems, $Item);\n\t\t\n\t\t$DECPData = array(\n\t\t\t\t\t\t 'DECPFields' => $DECPFields, \n\t\t\t\t\t\t 'PaymentDetails' => $PaymentDetails,\n\t\t\t\t\t\t 'OrderItems' => $OrderItems\n\t\t\t\t\t\t );\n\t\t\n\t\t#####[ CALL DO EXPRESS CHECKOUT PAYMENT ]#############################\n\t\t\n\t\t$DECPResult = $paypal -> DoExpressCheckoutPayment($DECPData);\n\t\t$this->session->set_userdata('paypal_errors', $DECPResult['ERRORS']);\n\t\t\n\t\t#####[ REDIRECT DEPENDING ON RESPONSE ]###############################\n\t\t\n\t\tif(strtolower($DECPResult['ACK']) != 'success' && strtolower($DECPResult['ACK']) != 'successwithwarning')\n\t\t{\n\t\t\tredirect('payment/error?type=2');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t/*\n\t\t$_SESSION['PayerEmailAddress'] = isset($GECDResult['EMAIL']) ? $GECDResult['EMAIL'] : '';\n\t\t$_SESSION['FirstName'] = isset($GECDResult['FIRSTNAME']) ? $GECDResult['FIRSTNAME'] : '';\n\t\t$_SESSION['LastName'] = isset($GECDResult['LASTNAME']) ? $GECDResult['LASTNAME'] : '';\n\t\t$_SESSION['Street'] = isset($GECDResult['SHIPTOSTREET']) ? $GECDResult['SHIPTOSTREET'] : '';\n\t\t$_SESSION['City'] = isset($GECDResult['SHIPTOCITY']) ? $GECDResult['SHIPTOCITY'] : '';\n\t\t$_SESSION['State'] = isset($GECDResult['SHIPTOSTATE']) ? $GECDResult['SHIPTOSTATE'] : '';\n\t\t$_SESSION['Zip'] = isset($GECDResult['SHIPTOZIP']) ? $GECDResult['SHIPTOZIP'] : '';\n\t\t$_SESSION['Country'] = isset($GECDResult['SHIPTOCOUNTRYNAME']) ? $GECDResult['SHIPTOCOUNTRYNAME'] : '';\n\t\t$_SESSION['transaction_id'] = isset($DECPResult['TRANSACTIONID']) ? $DECPResult['TRANSACTIONID'] : '';\n\t\t$_SESSION['CustomerNotes'] = isset($DECPResult['NOTE']) ? $DECPResult['NOTE'] : '';\n\t\t$_SESSION['PaymentStatus'] = isset($DECPResult['PAYMENTSTATUS']) ? $DECPResult['PAYMENTSTATUS'] : '';\n\t\t$_SESSION['PendingReason'] = isset($DECPResult['PENDINGREASON']) ? $DECPResult['PENDINGREASON'] : '';\n\t\t$_SESSION['payment_type'] = isset($DECPResult['PAYMENTTYPE']) ? $DECPResult['PAYMENTTYPE'] : '';\n\t\t\n\t\t*/\n\t\t\n\t\t#echo \"<pre>\";\n\t\t#print_r($_SESSION);\n\t\t#echo \"</pre>\";\n\t\t#exit;\n\t\t\n\t\t// Everything went fine, so redirect to completed page.\n\t\t$type = $this->session->userdata('payment_source');\n\t\t$d = new Donations();\n\t\t$d->donation_amount = $this->session->userdata('amount');\n\t\t$d->type = $type;\n\t\t$d->save();\n\t\t$session_data = array(\n\t\t\t\t\t\t\t\t'donor_name' => $GECDResult['FIRSTNAME'] . ' ' . $GECDResult['LASTNAME'],\n\t\t\t\t\t\t\t\t'donation_id' => $d->donation_id\n\t\t\t\t\t\t\t);\n\t\t$this->session->set_userdata($session_data);\n\t\t\n\t\tif( $type == 'postcard'){\n\t\t\t$r = new PostDonationRel();\n\t\t\t$r->post_id = $postcard_id;\n\t\t\t$r->donation_id = $d->donation_id;\n\t\t\t$r->save();\n\t\t\tif($this->session->userdata('amount') >= PARADE_CUTOFF){\n\t\t\t\t$g = new GratitudeParade();\n\t\t\t\t$g->donation_id = $d->donation_id;\n\t\t\t\t$g->name = Users::user()->username;\n\t\t\t\t$g->image_url = Users::user()->profile_avatar;\n\t\t\t\t$g->url = 'http://www.' . Users::user()->oauth_provider . '.com/' . Users::user()->username;\n\t\t\t\t$g->save();\n\t\t\t\t$this->session->set_flashdata('added_to_parade', true);\n\t\t\t}\n\t\t\t$this->session->set_flashdata('added_to_parade', false);\n\t\t\tredirect('postcard/send/' . $postcard_id . '/'. md5($postcard_id));\n\t\t}\n\t\telse \n\t\t\tredirect('payment/thankyou');\n\t}", "public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}", "public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function getTokenUrl();", "abstract protected function getTokenUrl();", "protected function request_token() {\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/request_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_callback' => SocialHelper::php_self()\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$_SESSION['oauth'] = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->authorize();\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "function ecReturn()\n{\n $error_message = '';\n\n if (isset($_REQUEST['token']) && isset($_REQUEST['PayerID'])) {\n $access_token = $_REQUEST['access_token'];\n $token = $_REQUEST['token'];\n $data = array('TOKEN' => $token);\n // Send the request to PayPal.\n $response = sendNvpRequest('GetExpressCheckoutDetails', $data);\n\n if (strtoupper($response['ACK']) == 'SUCCESS') {\n $data['PAYERID'] = $_REQUEST['PayerID'];\n $data['PAYMENTREQUEST_0_PAYMENTACTION'] = 'Sale';\n\n foreach (array('PAYMENTREQUEST_0_AMT', 'PAYMENTREQUEST_0_ITEMAMT', 'PAYMENTREQUEST_0_CURRENCYCODE', 'L_PAYMENTREQUEST_0') as $parameter) {\n if (array_key_exists($parameter, $response)) {\n $data[$parameter] = $response[$parameter];\n }\n }\n\n global $wpdb;\n\n $table_coupans = $wpdb->prefix . 'bookme_coupons';\n $table_settings = $wpdb->prefix . 'bookme_settings';\n $table_all_employee = $wpdb->prefix . 'bookme_employee';\n $table = $wpdb->prefix . 'bookme_category';\n $table_enotification = $wpdb->prefix . 'bookme_email_notification';\n $table_sms_notification = $wpdb->prefix . 'bookme_sms_notification';\n $table_current_booking_fields = $wpdb->prefix . 'bookme_current_booking_fields';\n $table_current_booking = $wpdb->prefix . 'bookme_current_booking';\n $table_book_service = $wpdb->prefix . 'bookme_service';\n $table_customer_booking = $wpdb->prefix . 'bookme_customer_booking';\n $table_customers = $wpdb->prefix . 'bookme_customers';\n $table_payments = $wpdb->prefix . 'bookme_payments';\n $table_holidays = $wpdb->prefix . 'bookme_holidays';\n\n add_filter('wp_mail_content_type', 'bookme_set_html_mail_content_type');\n\n $cart_enable = bookme_get_settings('bookme_enable_cart', 0) && (!bookme_get_settings('enable_woocommerce', 0));\n if ($cart_enable) {\n $access_token = 1;\n $name = $_SESSION['bookme'][$access_token]['name'];\n $email = $_SESSION['bookme'][$access_token]['email'];\n $phone = $_SESSION['bookme'][$access_token]['phone'];\n $notes = $_SESSION['bookme'][$access_token]['notes'];\n\n $custom_text = $_SESSION['bookme'][$access_token]['custom_text'];\n $custom_textarea = $_SESSION['bookme'][$access_token]['custom_textarea'];\n $custom_content = $_SESSION['bookme'][$access_token]['custom_content'];\n $custom_checkbox = $_SESSION['bookme'][$access_token]['custom_checkbox'];\n $custom_radio = $_SESSION['bookme'][$access_token]['custom_radio'];\n $custom_select = $_SESSION['bookme'][$access_token]['custom_select'];\n\n foreach ($_SESSION['bookme']['cart'] as $key => $cart) {\n $code = isset($cart['disc_code']) ? $cart['disc_code'] : '';\n $dic_price = isset($cart['off_price']) ? $cart['off_price'] : '';\n $appointstart = $cart['time_s'];\n $appointend = $cart['time_e'];\n $category = $cart['category'];\n $service = $cart['service'];\n $employee = $cart['employee'];\n $dates = $cart['date'];\n $person = $cart['person'];\n\n $resultS = $wpdb->get_results(\"SELECT price FROM $table_book_service WHERE id='$service'\");\n $price = $resultS[0]->price;\n\n $dt = new DateTime($dates);\n $booking_date = $dt->format('Y-m-d');\n\n $hodiday = 0;\n $result = $wpdb->get_results(\"SELECT * FROM $table_holidays WHERE staff_id = $employee\");\n foreach ($result as $holiday) {\n if ($holiday->holi_date == $booking_date) {\n $hodiday = 1;\n }\n }\n\n if ($hodiday == 0) {\n $rowcount = $wpdb->get_var(\"SELECT COUNT(cb.id) FROM $table_customer_booking cb LEFT JOIN $table_current_booking b ON cb.booking_id = b.id LEFT JOIN $table_customers c ON cb.customer_id = c.id WHERE b.cat_id='\" . $category . \"' and b.ser_id='\" . $service . \"' and b.emp_id='\" . $employee . \"' and b.date='\" . $dates . \"' and b.time = '\" . $appointstart . \"' and c.email='\" . $email . \"'\");\n if ($rowcount >= 1) {\n $error_message = __('Booking already exist.', 'bookme');\n } else {\n $booked = 0;\n $resultSs = $wpdb->get_results(\"SELECT capacity,duration,name FROM $table_book_service WHERE id=$service and catId=$category\");\n $capacity = $resultSs[0]->capacity;\n $duration = $resultSs[0]->duration;\n $servname = $resultSs[0]->name;\n $countAppoint = $wpdb->get_results(\"SELECT SUM(cb.no_of_person) as sump FROM $table_customer_booking cb LEFT JOIN $table_current_booking b ON b.id = cb.booking_id WHERE b.ser_id='$service' and b.emp_id='$employee' and b.date='$dates' and b.time = '$appointstart' and b.duration = '$duration'\");\n if (empty($countAppoint[0]->sump)) {\n $booked = 0;\n } else {\n $booked = $countAppoint[0]->sump;\n }\n $avl = 0;\n $avl = $capacity - $booked;\n if ($person > $avl) {\n $error_message = __('Seats not available for this time period.', 'bookme');\n }\n }\n }\n }\n if (empty($error_message)) {\n $response = sendNvpRequest('DoExpressCheckoutPayment', $data);\n if ('SUCCESS' == strtoupper($response['ACK']) || 'SUCCESSWITHWARNING' == strtoupper($response['ACK'])) {\n // Get transaction info\n $response = sendNvpRequest('GetTransactionDetails', array('TRANSACTIONID' => $response['PAYMENTINFO_0_TRANSACTIONID']));\n if ('SUCCESS' == strtoupper($response['ACK']) || 'SUCCESSWITHWARNING' == strtoupper($response['ACK'])) {\n\n foreach ($_SESSION['bookme']['cart'] as $key => $cart) {\n $code = isset($cart['disc_code']) ? $cart['disc_code'] : '';\n $dic_price = isset($cart['off_price']) ? $cart['off_price'] : '';\n $appointstart = $cart['time_s'];\n $appointend = $cart['time_e'];\n $category = $cart['category'];\n $service = $cart['service'];\n $employee = $cart['employee'];\n $dates = $cart['date'];\n $person = $cart['person'];\n\n $resultS = $wpdb->get_results(\"SELECT name,price,duration FROM $table_book_service WHERE id='$service'\");\n $price = $resultS[0]->price;\n $duration = $resultS[0]->duration;\n $servname = $resultS[0]->name;\n\n $resultE = $wpdb->get_results(\"SELECT name,email,google_data,phone FROM $table_all_employee WHERE id=\" . $employee);\n $employee_name = $resultE[0]->name;\n $employee_email = $resultE[0]->email;\n $employee_phone = $resultE[0]->phone;\n $google_data = $resultE[0]->google_data;\n\n if ($wpdb->insert($table_customers, array(\n 'name' => $name,\n 'email' => $email,\n 'phone' => $phone,\n 'notes' => $notes\n ))\n ) {\n $customer_id = $wpdb->insert_id;\n $booking_result = $wpdb->get_results(\"select id,google_event_id from $table_current_booking where ser_id = $service and emp_id = $employee and date = '$dates' and time = '$appointstart'\");\n $gc_event_id = null;\n if ($wpdb->num_rows > 0) {\n $booking_id = $booking_result[0]->id;\n $gc_event_id = $booking_result[0]->google_event_id;\n }else{\n $wpdb->insert($table_current_booking, array('cat_id' => $category, 'ser_id' => $service, 'emp_id' => $employee, 'date' => $dates, 'time' => $appointstart, 'duration' => $duration));\n $booking_id = $wpdb->insert_id;\n }\n\n $wpdb->insert($table_payments, array(\n 'created' => current_time('mysql'),\n 'type' => 'Paypal',\n 'price' => $price,\n 'discount_price' => $dic_price,\n 'status' => 'Completed'\n ));\n $payment_id = $wpdb->insert_id;\n $wpdb->insert($table_customer_booking, array(\n 'customer_id' => $customer_id,\n 'booking_id' => $booking_id,\n 'payment_id' => $payment_id,\n 'no_of_person' => $person,\n 'status' => 'Approved'\n ));\n $customer_booking_id = $wpdb->insert_id;\n $limit = 0;\n if ($code) {\n $resultOption = $wpdb->get_results(\"SELECT * FROM $table_coupans where coupon_code='$code' and find_in_set($service,ser_id) <> 0\");\n if ($wpdb->num_rows >= 1) {\n $limit = $resultOption[0]->coupon_used_limit + 1;\n $wpdb->update($table_coupans, array('coupon_used_limit' => $limit), array('id' => $resultOption[0]->id), array('%s'), array( '%d'));\n }\n\n }\n\n $resultcompanyName = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyName'\");\n $resultcompanyAddress = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyAddress'\");\n $resultcompanyPhone = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyPhone'\");\n $resultcompanyWebsite = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyWebsite'\");\n\n $company_name = $resultcompanyName[0]->book_value;\n $company_address = $resultcompanyAddress[0]->book_value;\n $company_phone = $resultcompanyPhone[0]->book_value;\n $company_website = $resultcompanyWebsite[0]->book_value;\n\n $endtime = strtotime($appointstart);\n $appointment_time = date_i18n(get_option('time_format'), strtotime($appointstart));\n $appointment_end_time = date_i18n(get_option('time_format'), $endtime + $duration);\n\n $results = $wpdb->get_results(\"SELECT name FROM $table where id=\" . $category . \"\");\n $category_name = $results[0]->name;\n $service_name = $servname;\n\n $booking_date = date_i18n(get_option('date_format'), strtotime($dates));\n $ttl_person = $person;\n $customer_name = ucfirst($name);\n $customer_email = $email;\n $customer_phone = $phone;\n $customer_note = $notes;\n $custom_fields_text = '';\n $custom_fields_html = '';\n\n foreach ($custom_text as $custom) {\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_textarea as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_content as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_select as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_radio as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_checkbox as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => implode(',', $custom['value']), 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), implode(',', $custom['value'])\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), implode(',', $custom['value'])\n );\n }\n }\n if ( $custom_fields_html != '' ) {\n $custom_fields_html = \"<table cellspacing=0 cellpadding=0 border=0>$custom_fields_html</table>\";\n }\n\n $headers = array('From: ' . bookme_get_settings('bookme_email_sender_name', get_bloginfo('name')) . ' <' . bookme_get_settings('bookme_email_sender_email', get_bloginfo('admin_email')) . '>');\n\n if (bookme_get_settings('email_customer', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='customer_sub' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='customer_msg' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wdm_mail_new($customer_email, $subject, $message, $headers);\n }\n\n if (bookme_get_settings('email_employee', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='employee_sub' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='employee_msg' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wdm_mail_new($employee_email, $subject, $message, $headers);\n }\n\n if (bookme_get_settings('email_admin', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='admin_sub' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='admin_msg' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wdm_mail_new(get_bloginfo('admin_email'), $subject, $message, $headers);\n }\n\n remove_filter('wp_mail_content_type', 'wpdocs_set_html_mail_content_type');\n\n if (bookme_get_settings('sms_customer', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='customer_msg' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($customer_phone, $message);\n }\n\n if (bookme_get_settings('sms_employee', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='employee_msg' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($employee_phone, $message);\n }\n\n if (bookme_get_settings('sms_admin', 'true') == 'true') {\n $admin_phone = bookme_get_settings('bookme_admin_phone_no');\n if($admin_phone) {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='admin_msg' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($admin_phone, $message);\n }\n }\n\n\n if (bookme_get_settings('bookme_gc_client_id') != null) {\n if($google_data) {\n include_once plugin_dir_path(__FILE__) . '/../../google.php';\n $bookme_gc_client = new Google_Client();\n $bookme_gc_client->setClientId(bookme_get_settings('bookme_gc_client_id'));\n $bookme_gc_client->setClientSecret(bookme_get_settings('bookme_gc_client_secret'));\n\n try {\n $bookme_gc_client->setAccessToken($google_data);\n if ($bookme_gc_client->isAccessTokenExpired()) {\n $bookme_gc_client->refreshToken($bookme_gc_client->getRefreshToken());\n $wpdb->update($table_all_employee, array('google_data' => $bookme_gc_client->getAccessToken()), array('id' => $employee), array('%s'), array('%d'));\n }\n $bookme_gc_service = new Google_Service_Calendar($bookme_gc_client);\n $google_calendar_id = 'primary';\n $gc_calendar = $bookme_gc_service->calendarList->get( $google_calendar_id );\n $gc_access = $gc_calendar->getAccessRole();\n if ( in_array( $gc_access, array( 'writer', 'owner' ) ) ) {\n if($gc_event_id == null) {\n $event_data = array(\n 'start' => $dates.' '.$appointstart,\n 'end' => $dates.' '.$appointend,\n 'name' => array($name),\n 'email' => array($email),\n 'phone' => array($phone),\n 'service' => $service_name,\n 'category' => $category_name,\n 'employee' => $employee_name,\n 'service_id' => $service,\n 'customer_id' => array($customer_id),\n 'booking_id' => $booking_id\n );\n $gc_event = bookme_get_event_data($event_data);\n\n $createdEvent = $bookme_gc_service->events->insert($google_calendar_id, $gc_event);\n\n $event_id = $createdEvent->getId();\n if ($event_id) {\n $wpdb->update($table_current_booking, array('google_event_id' => $event_id), array('id' => $booking_id), array('%s'), array('%d'));\n }\n }else{\n $customer_result = $wpdb->get_results(\"select customer_id from $table_customer_booking where booking_id = $booking_id\");\n $customer_ids = array();\n $name = array();\n $email = array();\n $phone = array();\n foreach($customer_result as $customer_id){\n $customer_ids[] = $customer_id->customer_id;\n $customer_data = $wpdb->get_results(\"select name,email,phone from $table_customers where id = $customer_id->customer_id\");\n $name[] = $customer_data[0]->name;\n $email[] = $customer_data[0]->email;\n $phone[] = $customer_data[0]->phone;\n }\n\n $event_data = array(\n 'start' => $dates.' '.$appointstart,\n 'end' => $dates.' '.$appointend,\n 'name' => $name,\n 'email' => $email,\n 'phone' => $phone,\n 'service' => $service_name,\n 'category' => $category_name,\n 'employee' => $employee_name,\n 'service_id' => $service,\n 'customer_id' => $customer_ids,\n 'booking_id' => $booking_id\n );\n $gc_event = bookme_get_event_data($event_data);\n $bookme_gc_service->events->update( $google_calendar_id, $gc_event_id, $gc_event );\n }\n }\n } catch (Exception $e) {\n\n }\n }\n }\n\n }\n }\n } else {\n $error_message = $response['L_LONGMESSAGE0'];\n }\n } else {\n $error_message = $response['L_LONGMESSAGE0'];\n }\n if (empty($error_message)) {\n unset($_SESSION['bookme']);\n $remove_parameters = array('bookme_action', 'access_token', 'error_msg', 'token', 'PayerID', 'type');\n header('Location: ' . remove_query_arg($remove_parameters, bookme_getCurrentPageURL()) . '?status=success');\n exit;\n }\n }\n } else {\n $code = isset($_SESSION['bookme'][$access_token]['disc_code']) ? $_SESSION['bookme'][$access_token]['disc_code'] : '';\n $dic_price = isset($_SESSION['bookme'][$access_token]['discount']['off_price']) ? $_SESSION['bookme'][$access_token]['discount']['off_price'] : '';\n\n $appointstart = $_SESSION['bookme'][$access_token]['time_s'];\n $appointend = $_SESSION['bookme'][$access_token]['time_e'];\n $category = $_SESSION['bookme'][$access_token]['category'];\n $service = $_SESSION['bookme'][$access_token]['service'];\n $employee = $_SESSION['bookme'][$access_token]['employee'];\n $dates = $_SESSION['bookme'][$access_token]['date'];\n $person = $_SESSION['bookme'][$access_token]['person'];\n $name = $_SESSION['bookme'][$access_token]['name'];\n $email = $_SESSION['bookme'][$access_token]['email'];\n $phone = $_SESSION['bookme'][$access_token]['phone'];\n $notes = $_SESSION['bookme'][$access_token]['notes'];\n $price = $_SESSION['bookme'][$access_token]['price'];\n\n $custom_text = $_SESSION['bookme'][$access_token]['custom_text'];\n $custom_textarea = $_SESSION['bookme'][$access_token]['custom_textarea'];\n $custom_content = $_SESSION['bookme'][$access_token]['custom_content'];\n $custom_checkbox = $_SESSION['bookme'][$access_token]['custom_checkbox'];\n $custom_radio = $_SESSION['bookme'][$access_token]['custom_radio'];\n $custom_select = $_SESSION['bookme'][$access_token]['custom_select'];\n\n $dt = new DateTime($dates);\n $booking_date = $dt->format('Y-m-d');\n\n $hodiday = 0;\n $result = $wpdb->get_results(\"SELECT * FROM $table_holidays WHERE staff_id = $employee\");\n foreach ($result as $holiday) {\n if ($holiday->holi_date == $booking_date) {\n $hodiday = 1;\n }\n }\n\n if ($hodiday == 0) {\n $rowcount = $wpdb->get_var(\"SELECT COUNT(cb.id) FROM $table_customer_booking cb LEFT JOIN $table_current_booking b ON cb.booking_id = b.id LEFT JOIN $table_customers c ON cb.customer_id = c.id WHERE b.cat_id='\" . $category . \"' and b.ser_id='\" . $service . \"' and b.emp_id='\" . $employee . \"' and b.date='\" . $dates . \"' and b.time = '\" . $appointstart . \"' and c.email='\" . $email . \"'\");\n if ($rowcount >= 1) {\n $error_message = __('Booking already exist.', 'bookme');\n } else {\n $booked = 0;\n $resultSs = $wpdb->get_results(\"SELECT capacity,duration,name FROM $table_book_service WHERE id=$service and catId=$category\");\n $capacity = $resultSs[0]->capacity;\n $duration = $resultSs[0]->duration;\n $servname = $resultSs[0]->name;\n\n $resultE = $wpdb->get_results(\"SELECT name,email,google_data,phone FROM $table_all_employee WHERE id=\" . $employee);\n $employee_name = $resultE[0]->name;\n $employee_email = $resultE[0]->email;\n $employee_phone = $resultE[0]->phone;\n $google_data = $resultE[0]->google_data;\n\n $countAppoint = $wpdb->get_results(\"SELECT SUM(cb.no_of_person) as sump FROM $table_customer_booking cb LEFT JOIN $table_current_booking b ON b.id = cb.booking_id WHERE b.ser_id='$service' and b.emp_id='$employee' and b.date='$dates' and b.time = '$appointstart' and b.duration = '$duration'\");\n if (empty($countAppoint[0]->sump)) {\n $booked = 0;\n } else {\n $booked = $countAppoint[0]->sump;\n }\n $avl = 0;\n $avl = $capacity - $booked;\n if ($person <= $avl) {\n if ($wpdb->insert($table_customers, array(\n 'name' => $name,\n 'email' => $email,\n 'phone' => $phone,\n 'notes' => $notes\n ))\n ) {\n $customer_id = $wpdb->insert_id;\n\n // We need to execute the \"DoExpressCheckoutPayment\" at this point to Receive payment from user.\n $response = sendNvpRequest('DoExpressCheckoutPayment', $data);\n if ('SUCCESS' == strtoupper($response['ACK']) || 'SUCCESSWITHWARNING' == strtoupper($response['ACK'])) {\n // Get transaction info\n $response = sendNvpRequest('GetTransactionDetails', array('TRANSACTIONID' => $response['PAYMENTINFO_0_TRANSACTIONID']));\n if ('SUCCESS' == strtoupper($response['ACK']) || 'SUCCESSWITHWARNING' == strtoupper($response['ACK'])) {\n\n $booking_result = $wpdb->get_results(\"select id,google_event_id from $table_current_booking where ser_id = $service and emp_id = $employee and date = '$dates' and time = '$appointstart'\");\n $gc_event_id = null;\n if ($wpdb->num_rows > 0) {\n $booking_id = $booking_result[0]->id;\n $gc_event_id = $booking_result[0]->google_event_id;\n }else{\n $wpdb->insert($table_current_booking, array('cat_id' => $category, 'ser_id' => $service, 'emp_id' => $employee, 'date' => $dates, 'time' => $appointstart, 'duration' => $duration));\n $booking_id = $wpdb->insert_id;\n }\n\n $wpdb->insert($table_payments, array(\n 'created' => current_time('mysql'),\n 'type' => 'Paypal',\n 'price' => $price,\n 'discount_price' => $dic_price,\n 'status' => 'Completed'\n ));\n $payment_id = $wpdb->insert_id;\n $wpdb->insert($table_customer_booking, array(\n 'customer_id' => $customer_id,\n 'booking_id' => $booking_id,\n 'payment_id' => $payment_id,\n 'no_of_person' => $person,\n 'status' => 'Approved'\n ));\n $customer_booking_id = $wpdb->insert_id;\n $limit = 0;\n if (isset($_SESSION['bookme'][$access_token]['disc_code'])) {\n\n $resultOption = $wpdb->get_results(\"SELECT * FROM $table_coupans where coupon_code='$code' and ser_id='$service'\");\n if ($wpdb->num_rows >= 1) {\n $limit = $resultOption[0]->coupon_used_limit + 1;\n $wpdb->update($table_coupans, array('coupon_used_limit' => $limit), array('coupon_code' => $code, 'ser_id' => $service,), array('%s'), array('%s', '%d'));\n }\n\n }\n\n $resultcompanyName = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyName'\");\n $resultcompanyAddress = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyAddress'\");\n $resultcompanyPhone = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyPhone'\");\n $resultcompanyWebsite = $wpdb->get_results(\"SELECT book_value FROM $table_settings WHERE book_key='companyWebsite'\");\n\n $company_name = $resultcompanyName[0]->book_value;\n $company_address = $resultcompanyAddress[0]->book_value;\n $company_phone = $resultcompanyPhone[0]->book_value;\n $company_website = $resultcompanyWebsite[0]->book_value;\n\n $endtime = strtotime($appointstart);\n $appointment_time = date_i18n(get_option('time_format'), strtotime($appointstart));\n $appointment_end_time = date_i18n(get_option('time_format'), $endtime + $duration);\n\n $results = $wpdb->get_results(\"SELECT name FROM $table where id=\" . $category . \"\");\n $category_name = $results[0]->name;\n $service_name = $servname;\n\n\n $booking_date = date_i18n(get_option('date_format'), strtotime($dates));\n $ttl_person = $person;\n $customer_name = ucfirst($name);\n $customer_email = $email;\n $customer_phone = $phone;\n $customer_note = $notes;\n $custom_fields_text = '';\n $custom_fields_html = '';\n\n foreach ($custom_text as $custom) {\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_textarea as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_content as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_select as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_radio as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => $custom['value'], 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), $custom['value']\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), $custom['value']\n );\n }\n }\n foreach ($custom_checkbox as $custom) {\n\n $wpdb->insert($table_current_booking_fields, array('booking_id' => $customer_booking_id, 'key_field' => base64_decode($custom['name']), 'field_val' => implode(',', $custom['value']), 'status' => 'valid'));\n\n if ( $custom['value'] != '' ) {\n $custom_fields_text .= sprintf(\n \"%s: %s\\n\",\n base64_decode($custom['name']), implode(',', $custom['value'])\n );\n\n $custom_fields_html .= sprintf(\n '<tr valign=top><td>%s:&nbsp;</td><td>%s</td></tr>',\n base64_decode($custom['name']), implode(',', $custom['value'])\n );\n }\n }\n if ( $custom_fields_html != '' ) {\n $custom_fields_html = \"<table cellspacing=0 cellpadding=0 border=0>$custom_fields_html</table>\";\n }\n\n $headers = array('From: ' . bookme_get_settings('bookme_email_sender_name', get_bloginfo('name')) . ' <' . bookme_get_settings('bookme_email_sender_email', get_bloginfo('admin_email')) . '>');\n\n if (bookme_get_settings('email_customer', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='customer_sub' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='customer_msg' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wp_mail($customer_email, $subject, $message, $headers);\n }\n\n if (bookme_get_settings('email_employee', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='employee_sub' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='employee_msg' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wp_mail($employee_email, $subject, $message, $headers);\n }\n\n if (bookme_get_settings('email_admin', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='admin_sub' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $subject = $reslabl[0]->email_value;\n $sqlblbc = \"SELECT * FROM $table_enotification where email_key='admin_msg' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->email_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_html, $message);\n\n wp_mail(get_bloginfo('admin_email'), $subject, $message, $headers);\n }\n\n remove_filter('wp_mail_content_type', 'wpdocs_set_html_mail_content_type');\n\n if (bookme_get_settings('sms_customer', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='customer_msg' and key_type='customer_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($customer_phone, $message);\n }\n\n if (bookme_get_settings('sms_employee', 'true') == 'true') {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='employee_msg' and key_type='employee_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($employee_phone, $message);\n }\n\n if (bookme_get_settings('sms_admin', 'true') == 'true') {\n $admin_phone = bookme_get_settings('bookme_admin_phone_no');\n if($admin_phone) {\n $sqlblbc = \"SELECT * FROM $table_sms_notification where sms_key='admin_msg' and key_type='admin_confirm'\";\n $reslabl = $wpdb->get_results($sqlblbc);\n $message = $reslabl[0]->sms_value;\n\n $message = str_replace(\"{booking_time}\", $appointment_time, $message);\n $message = str_replace(\"{booking_end_time}\", $appointment_end_time, $message);\n $message = str_replace(\"{booking_date}\", $booking_date, $message);\n $message = str_replace(\"{customer_name}\", $customer_name, $message);\n $message = str_replace(\"{customer_email}\", $customer_email, $message);\n $message = str_replace(\"{customer_phone}\", $customer_phone, $message);\n $message = str_replace(\"{customer_note}\", $customer_note, $message);\n $message = str_replace(\"{number_of_persons}\", $ttl_person, $message);\n $message = str_replace(\"{company_name}\", $company_name, $message);\n $message = str_replace(\"{company_address}\", $company_address, $message);\n $message = str_replace(\"{company_phone}\", $company_phone, $message);\n $message = str_replace(\"{company_website}\", $company_website, $message);\n $message = str_replace(\"{employee_name}\", $employee_name, $message);\n $message = str_replace(\"{category_name}\", $category_name, $message);\n $message = str_replace(\"{service_name}\", $service_name, $message);\n $message = str_replace(\"{custom_field}\", $custom_fields_text, $message);\n $message = str_replace(\"{custom_field_2col}\", $custom_fields_text, $message);\n\n bookme_send_sms_twilio($admin_phone, $message);\n }\n }\n\n\n /* Google Calendar integration */\n if (bookme_get_settings('bookme_gc_client_id') != null) {\n if($google_data) {\n include_once plugin_dir_path(__FILE__) . '/../../google.php';\n $bookme_gc_client = new Google_Client();\n $bookme_gc_client->setClientId(bookme_get_settings('bookme_gc_client_id'));\n $bookme_gc_client->setClientSecret(bookme_get_settings('bookme_gc_client_secret'));\n\n try {\n $bookme_gc_client->setAccessToken($google_data);\n if ($bookme_gc_client->isAccessTokenExpired()) {\n $bookme_gc_client->refreshToken($bookme_gc_client->getRefreshToken());\n $wpdb->update($table_all_employee, array('google_data' => $bookme_gc_client->getAccessToken()), array('id' => $employee), array('%s'), array('%d'));\n }\n $bookme_gc_service = new Google_Service_Calendar($bookme_gc_client);\n $google_calendar_id = 'primary';\n $gc_calendar = $bookme_gc_service->calendarList->get( $google_calendar_id );\n $gc_access = $gc_calendar->getAccessRole();\n if ( in_array( $gc_access, array( 'writer', 'owner' ) ) ) {\n if($gc_event_id == null) {\n $event_data = array(\n 'start' => $dates.' '.$appointstart,\n 'end' => $dates.' '.$appointend,\n 'name' => array($name),\n 'email' => array($email),\n 'phone' => array($phone),\n 'service' => $service_name,\n 'category' => $category_name,\n 'employee' => $employee_name,\n 'service_id' => $service,\n 'customer_id' => array($customer_id),\n 'booking_id' => $booking_id\n );\n $gc_event = bookme_get_event_data($event_data);\n\n $createdEvent = $bookme_gc_service->events->insert($google_calendar_id, $gc_event);\n\n $event_id = $createdEvent->getId();\n if ($event_id) {\n $wpdb->update($table_current_booking, array('google_event_id' => $event_id), array('id' => $booking_id), array('%s'), array('%d'));\n }\n }else{\n $customer_result = $wpdb->get_results(\"select customer_id from $table_customer_booking where booking_id = $booking_id\");\n $customer_ids = array();\n $name = array();\n $email = array();\n $phone = array();\n foreach($customer_result as $customer_id){\n $customer_ids[] = $customer_id->customer_id;\n $customer_data = $wpdb->get_results(\"select name,email,phone from $table_customers where id = $customer_id->customer_id\");\n $name[] = $customer_data[0]->name;\n $email[] = $customer_data[0]->email;\n $phone[] = $customer_data[0]->phone;\n }\n\n $event_data = array(\n 'start' => $dates.' '.$appointstart,\n 'end' => $dates.' '.$appointend,\n 'name' => $name,\n 'email' => $email,\n 'phone' => $phone,\n 'service' => $service_name,\n 'category' => $category_name,\n 'employee' => $employee_name,\n 'service_id' => $service,\n 'customer_id' => $customer_ids,\n 'booking_id' => $booking_id\n );\n $gc_event = bookme_get_event_data($event_data);\n $bookme_gc_service->events->update( $google_calendar_id, $gc_event_id, $gc_event );\n }\n }\n } catch (Exception $e) {\n\n }\n }\n }\n\n unset($_SESSION['bookme']);\n $remove_parameters = array('bookme_action', 'access_token', 'error_msg', 'token', 'PayerID', 'type');\n header('Location: ' . remove_query_arg($remove_parameters, bookme_getCurrentPageURL()) . '?status=success');\n exit;\n } else {\n $error_message = $response['L_LONGMESSAGE0'];\n }\n } else {\n $error_message = $response['L_LONGMESSAGE0'];\n }\n } else {\n $error_message = __('Something went wrong, please try again.', 'bookme');\n }\n } else {\n $error_message = __('Seats not available for this time period.', 'bookme');\n }\n }\n }\n }\n }\n } else {\n $error_message = __('Invalid token provided', 'bookme');\n }\n\n if (!empty($error_message)) {\n header('Location: ' . add_query_arg(array(\n 'bookme_action' => 'error',\n 'error_msg' => urlencode($error_message),\n ), bookme_getCurrentPageURL()\n ));\n exit;\n }\n}", "function makeRequestRecipientToken(){\n\t// is an URL that will open up a signing session for the listed recipient. We will store the return value\n\t// in session and pull it out on the next page (DocuSign.php) that is actuallly hosting the signing\n $RequestRecipientToken = new RequestRecipientToken();\n $RequestRecipientToken->EnvelopeID = $_SESSION[\"EnvelopeID\"];\n $RequestRecipientToken->ClientUserID = session_id();\n $RequestRecipientToken->Username = $_POST[\"FirstName\"].\" \".$_POST[\"LastName\"];\n $RequestRecipientToken->Email = $_POST[\"Email\"];\n\n\t// an authentication assertion is a statement by the hosting code (i.e. this code) to docusign that\n\t// the recipient has been authenticated locally, and providing a record of what that authentication method was.\n\t$RequestRecipientToken->AuthenticationAssertion->AssertionID = makeFakeID();\n\n $RequestRecipientToken->AuthenticationAssertion->AuthenticationInstant = makeISO8601Date();\n $RequestRecipientToken->AuthenticationAssertion->AuthenticationMethod = \"Password\";\n $RequestRecipientToken->AuthenticationAssertion->SecurityDomain = $_SERVER['HTTP_HOST'];\n\n\t// Client URLS indicate where the signing session will redirect to when it is finished - because the user\n\t// signed, or cancelled, or failed ID check, etc. You can set separate pages for these or just use\n\t// one page and use a param like 'id' to differentiate the events.\n $RequestRecipientToken->ClientURLs= getClientCallbackURLS();\n\n\treturn $RequestRecipientToken;\n\n}", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "public function redirectToPayment($token)\n {\n header(\"Location: $this->paymentApiUrl/payment?data=$token\");\n exit;\n }", "public function PaypalGetAndDoExpressCheckout($oPaypal){\n if (!isset($_GET['token'])){\n header('Location:'.'http://localhost/PHPScripts_website/live_demo/buy_ticket.php?c=cancel'); \n }\n\n // *** Checkout process (get and do expresscheckout) \n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n\n // GetExpressCheckoutDetails (get orders, buyer, transaction informations)\n $response = $oPaypal->request('GetExpressCheckoutDetails', array(\n 'TOKEN' => $_GET['token']\n ));\n\n //Store buyer information\n $oPaypal->RecordPaypalPayer($response); \n\n // Store order\n $oOrder = new Order();\n\n //Record order\n $id_cat = 1;\n $sIdOrder = $oOrder->RecordOrder($response, $id_cat);\n\n if($response){\n // if checkout success\n if($response['CHECKOUTSTATUS'] == 'PaymentActionCompleted'){\n die('This payment has already been validated');\n }\n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n die();\n }\n\n // DoExpressCheckoutPayment setting\n $params = array(\n 'TOKEN' => $response['TOKEN'],\n 'PAYERID'=> $response['PAYERID'],\n 'PAYMENTREQUEST_0_PAYMENTACTION'=>'Sale',\n 'PAYMENTREQUEST_0_AMT' => $response['AMT'],\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $response['ITEMAMT'],\n );\n\n foreach($_SESSION['tickets'] as $k => $ticket){\n // Send again order informations to paypal for the history buyer purchases.\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // DoExpressCheckoutPayment\n $response = $oPaypal->request('DoExpressCheckoutPayment',$params );\n\n if($response){\n // DoExpressCheckoutPayment is success then update order in database ('Transaction ID', 'paymentstatus'...=\n $oOrder->updateOrder($sIdOrder, $response);\n\n if ($response['PAYMENTINFO_0_PAYMENTSTATUS'] == 'Completed'){\n // Send mail confirmation (with order information and ticket pdf link). A FAIRE\n echo \"<br>the transaction n°{$response['PAYMENTINFO_0_TRANSACTIONID']} was successful\";\n } \n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n }\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n\n}", "public function get_payment_token() {\n\n\t\tif ( 'credit_card' === $this->get_method_type() ) {\n\n\t\t\t$data = array(\n\t\t\t\t'type' => $this->get_method_type(),\n\t\t\t\t'card_type' => $this->cardType,\n\t\t\t\t'last_four' => ltrim( $this->number, 'x' ),\n\t\t\t\t'exp_month' => $this->expMonth,\n\t\t\t\t'exp_year' => $this->expYear,\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t$data = array(\n\t\t\t\t'type' => $this->get_method_type(),\n\t\t\t\t'last_four' => ltrim( $this->accountNumber, 'X' ),\n\t\t\t\t'account_type' => 'PERSONAL_SAVINGS' === $this->accountType ? 'savings' : 'checking',\n\t\t\t);\n\t\t}\n\n\t\treturn new Framework\\SV_WC_Payment_Gateway_Payment_Token( $this->get_method_id(), $data );\n\t}", "public function getPaymentToolToken()\n {\n return $this->getParameter('paymentToolToken');\n }", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public static function authnet_sp_checkout ()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!empty($_POST[\"s2member_pro_authnet_sp_checkout\"][\"nonce\"]) && ($nonce = $_POST[\"s2member_pro_authnet_sp_checkout\"][\"nonce\"]) && wp_verify_nonce ($nonce, \"s2member-pro-authnet-sp-checkout\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$GLOBALS[\"ws_plugin__s2member_pro_authnet_sp_checkout_response\"] = array(); // This holds the global response details.\n\t\t\t\t\t\t\t\t$global_response = &$GLOBALS[\"ws_plugin__s2member_pro_authnet_sp_checkout_response\"]; // This is a shorter reference.\n\n\t\t\t\t\t\t\t\t$post_vars = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($_POST[\"s2member_pro_authnet_sp_checkout\"]));\n\t\t\t\t\t\t\t\t$post_vars[\"attr\"] = (!empty($post_vars[\"attr\"])) ? (array)unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($post_vars[\"attr\"])) : array();\n\t\t\t\t\t\t\t\t$post_vars[\"attr\"] = apply_filters(\"ws_plugin__s2member_pro_authnet_sp_checkout_post_attr\", $post_vars[\"attr\"], get_defined_vars ());\n\n\t\t\t\t\t\t\t\t$post_vars[\"name\"] = trim ($post_vars[\"first_name\"] . \" \" . $post_vars[\"last_name\"]);\n\t\t\t\t\t\t\t\t$post_vars[\"email\"] = apply_filters(\"user_registration_email\", sanitize_email ($post_vars[\"email\"]), get_defined_vars ());\n\n\t\t\t\t\t\t\t\tif(empty($post_vars[\"card_expiration\"]) && isset($post_vars[\"card_expiration_month\"], $post_vars[\"card_expiration_year\"]))\n\t\t\t\t\t\t\t\t\t$post_vars[\"card_expiration\"] = $post_vars[\"card_expiration_month\"].\"/\".$post_vars[\"card_expiration_year\"];\n\n\t\t\t\t\t\t\t\t$post_vars = c_ws_plugin__s2member_utils_captchas::recaptcha_post_vars($post_vars); // Collect reCAPTCHA™ post vars.\n\n\t\t\t\t\t\t\t\tif (!c_ws_plugin__s2member_pro_authnet_responses::authnet_form_attr_validation_errors ($post_vars[\"attr\"])) // Attr errors?\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (!($error = c_ws_plugin__s2member_pro_authnet_responses::authnet_form_submission_validation_errors (\"sp-checkout\", $post_vars)))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$cp_attr = c_ws_plugin__s2member_pro_authnet_utilities::authnet_apply_coupon ($post_vars[\"attr\"], $post_vars[\"coupon\"], \"attr\", array(\"affiliates-silent-post\"));\n\t\t\t\t\t\t\t\t\t\t\t\t$cost_calculations = c_ws_plugin__s2member_pro_authnet_utilities::authnet_cost (null, $cp_attr[\"ra\"], $post_vars[\"state\"], $post_vars[\"country\"], $post_vars[\"zip\"], $cp_attr[\"cc\"], $cp_attr[\"desc\"]);\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (!($authnet = array())) // Direct payments.\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_type\"] = \"AUTH_CAPTURE\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_method\"] = \"CC\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_email\"] = $post_vars[\"email\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_first_name\"] = $post_vars[\"first_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_last_name\"] = $post_vars[\"last_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_customer_ip\"] = c_ws_plugin__s2member_utils_ip::current();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_invoice_num\"] = \"s2-\" . uniqid ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_description\"] = $cost_calculations[\"desc\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"s2_invoice\"] = $post_vars[\"attr\"][\"sp_ids_exp\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"s2_custom\"] = $post_vars[\"attr\"][\"custom\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_tax\"] = $cost_calculations[\"tax\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_amount\"] = $cost_calculations[\"total\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_currency_code\"] = $cost_calculations[\"cur\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_card_num\"] = preg_replace (\"/[^0-9]/\", \"\", $post_vars[\"card_number\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_exp_date\"] = c_ws_plugin__s2member_pro_authnet_utilities::authnet_exp_date ($post_vars[\"card_expiration\"], 'aim');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_card_code\"] = $post_vars[\"card_verification\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#if (in_array($post_vars[\"card_type\"], array(\"Maestro\", \"Solo\")))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\tif (preg_match (\"/^[0-9]{2}\\/[0-9]{4}$/\", $post_vars[\"card_start_date_issue_number\"]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\t\t$authnet[\"x_card_start_date\"] = preg_replace (\"/[^0-9]/\", \"\", $post_vars[\"card_start_date_issue_number\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\telse // Otherwise, we assume they provided an issue number instead.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\t\t$authnet[\"x_card_issue_number\"] = $post_vars[\"card_start_date_issue_number\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_address\"] = $post_vars[\"street\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_city\"] = $post_vars[\"city\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_state\"] = $post_vars[\"state\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_country\"] = $post_vars[\"country\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$authnet[\"x_zip\"] = $post_vars[\"zip\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif ($cost_calculations[\"total\"] <= 0 || (($authnet = c_ws_plugin__s2member_pro_authnet_utilities::authnet_aim_response ($authnet)) && empty($authnet[\"__error\"])))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($cost_calculations[\"total\"] <= 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new__txn_id = strtoupper('free-'.uniqid()); // Auto-generated value in this case.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $new__txn_id = $authnet[\"transaction_id\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!($ipn = array())) // Simulated PayPal IPN.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"txn_type\"] = \"web_accept\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"txn_id\"] = $new__txn_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"custom\"] = $post_vars[\"attr\"][\"custom\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"mc_gross\"] = $cost_calculations[\"total\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"mc_currency\"] = $cost_calculations[\"cur\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"tax\"] = $cost_calculations[\"tax\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"payer_email\"] = $post_vars[\"email\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"first_name\"] = $post_vars[\"first_name\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"last_name\"] = $post_vars[\"last_name\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_user_logged_in () && // Reference a User/Member?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id ()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name1\"] = \"Referencing Customer ID\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection1\"] = $referencing;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse // Otherwise, default to the originating domain.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name1\"] = \"Originating Domain\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection1\"] = $_SERVER[\"HTTP_HOST\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_name2\"] = \"Customer IP Address\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"option_selection2\"] = c_ws_plugin__s2member_utils_ip::current();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"item_name\"] = $cost_calculations[\"desc\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"item_number\"] = $post_vars[\"attr\"][\"sp_ids_exp\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy\"] = \"authnet\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_use\"] = \"pro-emails\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_coupon\"] = array(\"coupon_code\" => $cp_attr[\"_coupon_code\"], \"full_coupon_code\" => $cp_attr[\"_full_coupon_code\"], \"affiliate_id\" => $cp_attr[\"_coupon_affiliate_id\"]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_verification\"] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_paypal_proxy_return_url\"] = $post_vars[\"attr\"][\"success\"];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ipn[\"s2member_authnet_proxy_return_url\"] = trim (c_ws_plugin__s2member_utils_urls::remote (home_url (\"/?s2member_paypal_notify=1\"), $ipn, array(\"timeout\" => 20)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (($sp_access_url = c_ws_plugin__s2member_sp_access::sp_access_link_gen ($post_vars[\"attr\"][\"ids\"], $post_vars[\"attr\"][\"exp\"])))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetcookie (\"s2member_sp_tracking\", ($s2member_sp_tracking = c_ws_plugin__s2member_utils_encryption::encrypt ($new__txn_id)), time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie (\"s2member_sp_tracking\", $s2member_sp_tracking, time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN) . ($_COOKIE[\"s2member_sp_tracking\"] = $s2member_sp_tracking);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => sprintf (_x ('<strong>Thank you.</strong> Your purchase has been approved.<br />&mdash; Please <a href=\"%s\" rel=\"nofollow\">click here</a> to proceed.', \"s2member-front\", \"s2member\"), esc_attr ($sp_access_url)));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($post_vars[\"attr\"][\"success\"]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& (substr($ipn['s2member_authnet_proxy_return_url'], 0, 2) === substr($post_vars['attr']['success'], 0, 2) || stripos($ipn['s2member_authnet_proxy_return_url'], 'http') === 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& ($custom_success_url = str_ireplace (array(\"%%s_response%%\", /* Deprecated in v111106 ». */ \"%%response%%\"), array(urlencode (c_ws_plugin__s2member_utils_encryption::encrypt ($global_response[\"response\"])), urlencode ($global_response[\"response\"])), $ipn[\"s2member_authnet_proxy_return_url\"]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& ($custom_success_url = trim (preg_replace (\"/%%(.+?)%%/i\", \"\", $custom_success_url)))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_redirect($post_vars['attr']['success'] === '%%sp_access_url%%' ? $custom_success_url : c_ws_plugin__s2member_utils_urls::add_s2member_sig ($custom_success_url, \"s2p-v\")) . exit ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse // Else, unable to generate Access Link.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => _x ('<strong>Oops.</strong> Unable to generate Access Link. Please contact Support for assistance.', \"s2member-front\", \"s2member\"), \"error\" => true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse // Else, an error.\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$global_response = array(\"response\" => $authnet[\"__error\"], \"error\" => true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse // Else, an error.\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$global_response = $error;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}", "public function callback_return(){\r\n\r\n $this->log('Entering callback_return', 'info');\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n\r\n try {\r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n\r\n $this->log('Flow result: '.json_encode($result));\r\n\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $status = $result['status'];\r\n\r\n $order = $this->getOrder($order_id);\r\n\r\n $order_status = $order->get_status();\r\n\r\n if ($this->userCanceledPayment($status, $result)) {\r\n $this->log('User canceled the payment. Redirecting to checkout...', 'info');\r\n $this->redirectToCheckout();\r\n }\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n \r\n /*if($this->isTesting($result)){\r\n $this->log('Setting up the production simulation...');\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n \r\n if ($this->isPendingInFlow($status)) {\r\n\r\n $this->clearCart();\r\n\r\n if($this->userGeneratedCoupon($status, $result)){\r\n\r\n if(!empty( $this->get_option('return_url'))){\r\n $this->redirectTo($this->get_option('return_url'));\r\n }\r\n }\r\n\r\n $this->redirectToCouponGenerated($order);\r\n } elseif($this->isPaidInFlow($status)) {\r\n\r\n if($this->isPendingInStore($order_status)){\r\n\r\n $this->payOrder($order);\r\n }\r\n\r\n $this->redirectToSuccess($order);\r\n } else {\r\n\r\n if($this->isRejectedInFlow($status)){\r\n if($this->isPendingInStore($order_status)){\r\n $this->rejectOrder($order);\r\n }\r\n }\r\n\r\n if($this->isCancelledInFlow($status)){\r\n\r\n if($this->isPendingInStore($order_status)){\r\n $this->cancelOrder($order);\r\n }\r\n }\r\n\r\n $this->redirectToFailure($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n $this->redirectToError();\r\n }\r\n \r\n wp_die();\r\n }", "public function paypal_payouts($data=false)\n {\n global $environment;\n $paypal_credentials = PaymentGateway::where('site','PayPal')->get();\n $api_user = $paypal_credentials[1]->value;\n $api_pwd = $paypal_credentials[2]->value;\n $api_key = $paypal_credentials[3]->value;\n $paymode = $paypal_credentials[4]->value;\n \n $client = $paypal_credentials[6]->value;\n $secret = $paypal_credentials[7]->value;\n \n if($paymode == 'sandbox')\n $environment = 'sandbox';\n else\n $environment = '';\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/oauth2/token\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($ch, CURLOPT_USERPWD, $client.\":\".$secret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n\n $result = curl_exec($ch);\n $json = json_decode($result);\n if(!isset($json->error))\n {\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/payments/payouts?sync_mode=true\");\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\",\"Authorization: Bearer \".$json->access_token,\"\"));\n\n $result = curl_exec($ch);\n\n if(empty($result))\n {\n $json =\"error\";\n }\n else\n {\n $json = json_decode($result);\n }\n curl_close($ch);\n \n }\n else\n {\n $json =\"error\";\n \n }\n\n $payout_response = $json;\n $data = array();\n\n if($payout_response != \"error\") {\n if($payout_response->batch_header->batch_status==\"SUCCESS\") {\n if($payout_response->items[0]->transaction_status == 'SUCCESS') {\n $correlation_id = $payout_response->items[0]->transaction_id;\n $data['success'] = true;\n $data['transaction_id'] = $correlation_id;\n } \n else {\n $data['success'] = false;\n $data['message'] = $payout_response->items[0]->errors->name;\n }\n \n }\n else {\n $data['success'] = false;\n $data['message'] = $payout_response->name;\n }\n }\n else {\n $data['success'] = false;\n $data['message'] = 'Unknown error';\n }\n\n return $data;\n }", "public function token()\n {\n\n\t\t$this->server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send();\n }", "public function getToken()\n\t{\n\n\t}", "public function getPaymentStatus()\n {\n $paymentId = \\Request::get('paymentId');\n // clear the session payment ID\n \\Session::forget('paypal_payment_id');\n $payerId = \\Request::get('PayerID');\n $token = \\Request::get('token');\n //if (empty(\\Request::get('PayerID')) || empty(\\Request::get('token'))) {\n if (empty($payerId) || empty($token)) {\n Session::flash('panel', 1);\n return \\Redirect::to('/')\n ->with('message', 'Hubo un problema al intentar pagar con Paypal');\n }\n\n try {\n $payment = Payment::get($paymentId, $this->_api_context);\n } catch (Exception $ex) {\n if (\\Config::get('app.debug')) {\n echo \"Exception: \" . $ex->getMessage() . PHP_EOL;\n $err_data = json_decode($ex->getData(), true);\n exit;\n } else {\n die('Ups! Algo salió mal');\n }\n }\n\n // PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n try {\n $execution = new PaymentExecution();\n $execution->setPayerId(\\Request::get('PayerID'));\n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n echo \"Exception: \" . $ex->getMessage() . PHP_EOL;\n $err_data = json_decode($ex->getData(), true);\n exit;\n } else {\n die('Ups! Algo salió mal');\n }\n }\n\n //echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n // Registrar el pedido --- ok\n // Registrar el Detalle del pedido --- ok\n // Eliminar carrito\n // Enviar correo a user\n // Enviar correo a admin\n // Redireccionar\n $this->saveOrder(\\Session::get('cart'), \\Session::get('itemsCheck'));\n \\Session::forget('cart');\n Session::flash('panel', 1);\n return \\Redirect::to('/')->with('message', 'Payment Registred');\n }\n return \\Redirect::to('/')->with('message', 'Error!');\n }", "private function _getToken()\n {\n $postData = array(\n 'UserApiKey' => $this->username,\n 'SecretKey' => $this->password,\n 'System' => 'joomla_acy_3_5_v_3_0'\n );\n $postString = json_encode($postData);\n\n $ch = curl_init($this->apidomain.$this->getApiTokenUrl());\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n )\n );\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($result);\n $resp = false;\n if (is_object($response)) {\n @$IsSuccessful = $response->IsSuccessful;\n if ($IsSuccessful == true) {\n @$TokenKey = $response->TokenKey;\n $resp = $TokenKey;\n } else {\n $resp = false;\n }\n }\n return $resp;\n }", "public function success(){\n\n\t\tif ( !empty( $_GET['token'] ) ) {\n\n\t\t $token = $_GET['token'];\n\t\t $this->paypal->execute_agreement( $token );\n\t\t $this->index();\n\n\t\t}\n\n\t\treturn;\n\n\t}", "public function execute() {\n\t\t/**\n\t\t * @var PaymentProvider\n\t\t */\n\t\t$adyen = PaymentProviderFactory::getProviderForMethod( $this->getOption( 'method' ) );\n\n\t\t$savedDetailsResponse = $adyen->getSavedPaymentDetails( $this->getOption( 'pcid' ) );\n\t\tLogger::info( \"Tokenize result: \" . print_r( $savedDetailsResponse, true ) );\n\t}", "public function getPaymethodToken()\n\t{\n\t return $this->paymethod_token;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "private function getToken()\r\n\t{\r\n\t\treturn $this->app['config']->get('hipsupport::config.token');\r\n\t}", "public function paypalBillingAgreementAction() {\n $requestValues = $this->getRequest()->query->all() + $this->getRequest()->request->all();\n $paymentService = $this->get('e2w_payment_service');\n // Token may need to be rawurldecoded:\n $paymentAccount = $paymentService->addBillingAgreement(array(\n 'token'=>isset($requestValues['token']) ? $requestValues['token'] : $requestValues['TOKEN']\n ));\n\n return ($paymentAccount) ? $this->redirect($this->generateUrl('_payment_address', array(), true)) : $this->redirect($this->generateUrl('_dashboard_payment_account', array(), true));\n }", "private function tokenInit()\n {\n $tempSession = uniqid();\n echo \"************************************************* MONZO AUTHENTICATION WORKFLOW ***********************************************************\\n\";\n echo \"Please visit the following URL in your browser and follow instructions \\n\";\n echo \"###########\\n\";\n echo \"\\n\";\n echo \"https://auth.monzo.com/?client_id=$this->clientId&redirect_uri=$this->redirectUri&response_type=code&state=$tempSession \\n\";\n echo \"\\n\";\n echo \"###########\\n\";\n echo \"When you get email from Monzo, copy the link button (Right click -> Copy link Location) from the email and paste here. Do not click it. \\n\";\n echo \"*********************************************************************************************************************************************\\n\";\n $verificationUrl = readline(\"Email link: \");\n parse_str(parse_url($verificationUrl, PHP_URL_QUERY) , $urlParams);\n if (array_key_exists('code', $urlParams) && array_key_exists('state', $urlParams))\n {\n if ($urlParams['state'] === $tempSession)\n {\n $data = array(\n 'grant_type' => 'authorization_code',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'code' => $urlParams['code']\n );\n $tokenData = $this->getJson('/oauth2/token', $data, false);\n if (isset($tokenData['access_token']) && isset($tokenData['refresh_token']))\n {\n $this->bearerToken = $tokenData['access_token'];\n $this->refreshToken = $tokenData['refresh_token'];\n if ($this->validateTokens())\n {\n $this->storeTokens($tokenData['access_token'], $tokenData['refresh_token']);\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Newly created tokens not valid\");\n throw new Exception('Monzo: Newly created Tokens not valid');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Tokens not found\");\n throw new Exception('Monzo: Tokens not found');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: State does not match the one that was sent to Monzo.\");\n throw new Exception('Monzo: State does not match the one that was sent to Monzo.');\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Code and State ids not found in the email URL\");\n throw new Exception('Monzo: Code and State ids not found in the email URL');\n }\n }", "protected function generate_payment_request( $order, $xendit_token ) {\n\n\t\t// $this->log(\"=== generate_payment_request === with token -> \" . print_r($xendit_token, true) . PHP_EOL);\n\n\t\t$amount = $this->get_xendit_amount( $order->get_total() , 'IDR');\n\t\t$token_id = wc_clean( $_POST['xendit_token'] ? $_POST['xendit_token'] : $xendit_token->source );\n\t\t$auth_id = wc_clean( $_POST['xendit_authentication'] ? $_POST['xendit_authentication'] : false);\n\n\t\t$this->log('generate_payment_request -> ' . print_r($_POST, true) . PHP_EOL);\n\n\t\tif ( isset($_POST['3ds']) ) {\n\t\t\t$this->log('isset 3ds');\n\n\t\t\t$this->three_ds_popup(wc_clean($_POST['3ds']));\n\t\t}\n\n\n\n\t\tif (! $auth_id ) {\n\t\t\t$auth_data = array('amount' => $amount, 'token_id' => $token_id);\n\t\t\t$auth_id = $this->xendit_authentication($auth_data);\n\t\t}\n\n\n\t\t$post_data = array();\n\t\t$post_data['amount'] = $amount;\n\t\t$post_data['token_id'] = $token_id;\n\t\t$post_data['authentication_id'] = $auth_id;\n\t\t$post_data['external_id'] = \"WC_Order_\" . $order->get_id();\n\n\t\treturn $post_data;\n\t}", "public function receivingPayment()\n {\n $response = $this->client->request($this->methods['post'], \"sandbox\", [\n 'json' => [\n 'ENVIRONMENT' => $this->environment['sandbox'],\n 'VENDOR_ID' => $this->vendor_id,\n 'PAYMENT_ID' => $this->payment_id,\n 'PAYMENT_NAME' => $this->payment_name,\n 'AGR_TRANS_ID' => $this->agr_trans_id,\n 'MERCHANT_TRANS_ID' => $this->merchant_trans_id,\n 'MERCHANT_TRANS_AMOUNT' => $this->merchant_trans_amount,\n 'MERCHANT_TRANS_DATA' => $this->merchant_trans_data,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY .$this->agr_trans_id . $this->vendor_id.$this->payment_id. $this->payment_name. $this->merchant_trans_id. $this->merchant_trans_amount. $this->environment['live']. $this->sign_time),\n ]\n ]);\n\n return $response;\n }", "public function capture(Token $token, int $amount): Payment;", "function verify_and_retrieve_payment()\r\n\t{\r\n\t\t$email = $_GET['ipn_email']; \r\n\t\t$header = \"\"; \r\n\t\t$emailtext = \"\"; \r\n\t\t// Read the post from PayPal and add 'cmd' \r\n\t\t$req = 'cmd=_notify-validate';\r\n\r\n\t\tif(function_exists('get_magic_quotes_gpc')) \r\n\t\t{ \r\n\t\t\t$get_magic_quotes_exits = true;\r\n\t\t}\r\n\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t// Handle escape characters, which depends on setting of magic quotes \r\n\t\t{ \r\n\t\t\tif($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode(stripslashes($value)); \r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode($value); \r\n\t\t\t} \r\n\t\t \r\n\t\t\t$req .= \"&$key=$value\"; \r\n\t\t} // Post back to PayPal to validate \r\n\t\t \r\n\t\t$header .= \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\"; \r\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\"; \r\n\t\t$header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\"; \r\n\r\n\t\t$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); \r\n\r\n\t\t // Process validation from PayPal\r\n\t\tif (!$fp) \r\n\t\t{ // HTTP ERROR \r\n\t\t} \r\n\t\telse \r\n\t\t{ // NO HTTP ERROR \r\n\t\t\tfputs ($fp, $header . $req); \r\n\t\t \r\n\t\t\twhile (!feof($fp)) \r\n\t\t\t{ \r\n\t\t\t\t$res = fgets ($fp, 1024); \r\n\t\t\t\tif (strcmp ($res, \"VERIFIED\") == 0) \r\n\t\t\t\t{ \r\n\t\t\t\t\t// TODO: // Check the payment_status is Completed \r\n\t\t\t\t\t// Check that txn_id has not been previously processed \r\n\t\t\t\t\t// Check that receiver_email is your Primary PayPal email \r\n\t\t\t\t\t// Check that payment_amount/payment_currency are correct \r\n\t\t\t\t\t// Process payment \r\n\t\t\t\t\t// If 'VERIFIED', send an email of IPN variables and values to the \r\n\t\t\t\t\t// specified email address \r\n\t\t \r\n\t\t\t\t\t$f_result = array( true, $_POST );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t\t//$emailtext .= $key . \" = \" .$value .\"\\n\\n\";\r\n\t\t\t\t\t//} \r\n\t\t\t \r\n\t\t\t\t\t//mail($email, \"Live-VERIFIED IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t} \r\n\t\t\t\telse if (strcmp ($res, \"INVALID\") == 0) \r\n\t\t\t\t{ // If 'INVALID', send an email. TODO: Log for manual investigation. \r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t//\t$emailtext .= $key . \" = \" .$value .\"\\n\\n\"; \r\n\t\t\t\t\t//} \r\n\t\t\t\t\t\r\n\t\t\t\t\t//mail($email, \"Live-INVALID IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t\t$f_result = array( false, $_POST );\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t \r\n\t\t\tfclose ($fp); \r\n\t\t}\r\n\t\r\n\t\treturn $f_result;\r\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "public function get_payment_token() {\n\n\t\tif ( ! $token = $this->get_transarmor_token() ) {\n\t\t\tthrow new SV_WC_Payment_Gateway_Exception( __( 'Required TransArmor token not received. Please double-check your Payeezy Gateway configuration.', 'woocommerce-gateway-firstdata' ) );\n\t\t}\n\n\t\treturn new SV_WC_Payment_Gateway_Payment_Token( $this->get_transarmor_token(), array(\n\t\t\t'type' => 'credit_card',\n\t\t\t'last_four' => $this->get_request()->get_order()->payment->last_four,\n\t\t\t'card_type' => $this->get_request()->get_order()->payment->card_type,\n\t\t\t'exp_month' => $this->get_request()->get_order()->payment->exp_month,\n\t\t\t'exp_year' => $this->get_request()->get_order()->payment->exp_year,\n\t\t) );\n\t}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\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?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\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\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\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\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\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}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function processToken(Mage_Sales_Model_Quote $quote)\r\n {\r\n try {\r\n $billing = $quote->getBillingAddress();\r\n $payment = $quote->getPayment();\r\n\r\n /** @var Eway_Rapid31_Model_Method_Saved $ewaySave */\r\n $ewaySave = Mage::getModel('ewayrapid/method_saved');\r\n $ewaySave->setData('info_instance', $payment);\r\n\r\n /** @var Mage_Sales_Model_Order $order */\r\n $order = Mage::getModel('sales/order');\r\n /*$order->setBillingAddress($billing);*/\r\n\r\n /** @var Mage_Sales_Model_Order_Payment $paymentObj */\r\n $paymentObj = Mage::getModel('sales/order_payment');\r\n $paymentObj->setOrder($order);\r\n\r\n $request = Mage::getModel('ewayrapid/request_token');\r\n\r\n $ewaySave->_setBilling($billing);\r\n $ewaySave->_shouldCreateOrUpdateToken($paymentObj, $request);\r\n return $payment->getAdditionalData();\r\n } catch (Exception $e) {\r\n throw $e;\r\n }\r\n }", "function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }", "function apiContext(){\r\n\t$apiContext = new PayPal\\Rest\\ApiContext(new PayPal\\Auth\\OAuthTokenCredential(CLIENT_ID, CLIENT_SECRET));\r\n\treturn $apiContext;\r\n}", "public function testGetTokenWithOutTokenId(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parameters = array(PayUParameters::TOKEN_ID=>'');\n\t\t\t\n\t\t$response = PayUTokens::find($parameters);\n\t\n\t}", "public function getTokenDetails($url, $token);", "public function redirect($token) {\n\n\t\tif ($this->_sandbox) $url = self::SANDBOX_LOGIN_URL;\n\t\telse $url = self::LIVE_LOGIN_URL;\n\n\t\t$url .= '?cmd=_express-checkout&token=' . $token;\n\n\t\theader('Location:' . $url);\n\t\tdie();\n\n\t}", "public function getAuthURL(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$data['title'] = 'Make Payment';\n\t\t\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->load->library('session');\n \n $this->load->library('email');\n $this->load->helper('url');\n $this->load->database();\n \n\t\t\n\n\t\t$this->form_validation->set_rules('name','Name', 'required');\n $this->form_validation->set_rules('phone','Phone', 'trim|required');\n $this->form_validation->set_rules('email','Email', 'trim|required');\n $this->form_validation->set_rules('location','Location', 'required');\n \n\n\t\t\n\t\t\n\t\t\t\n if($this->form_validation->run() == false){\n \t\t$this->load->view('templates/header', $data);\n\t\t\t\t\t$this->load->view('templates/nav');\n $this->load->view('billing');\n $this->load->view('templates/footer');\n \n }else{\n\t\t\n\t\n \n \n \n \n//get customer email\n$email = $this->input->post('email'); \n$amount = $this->input->post('location'); \n$name = $this->input->post('name');\n$phone = $this->input->post('phone');\n\n\n\n$length = 10;\n\n$order_id = substr(str_shuffle(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, $length);\n\n\n\t\t\t$this->Page_Model->payment($name,$phone,$email,$order_id);\n\t\t\t\t\t\n\t\t\t\t\t \n \n \n\n$amount2 = $amount * 100;\n \n\t\t\t\n //init($ref, $amount_in_kobo, $email, $metadata_arr=[], $callback_url=\"\", $return_obj=false)\n $url = $this->paystack->init($order_id, $amount2, $email, base_url('pay/callback'), FALSE);\n \n //$url ? header(\"Location: {$url}\") : \"\";\n $url ? redirect($url) : \"\"; \n \n \n}\n\t\t\n }", "public function ajax_make_token() {\n $invoice = $this->charge->fetch($_POST['invoice_id']);\n\n if (!$invoice) return status_header(404);\n if ($invoice->status !== 'paid') return status_header(402);\n if (!$invoice->metadata->post_id) return status_header(500); // should never actually happen\n\n $post_id = $invoice->metadata->post_id;\n $token = self::make_token($post_id);\n $url = add_query_arg('publisher_access', $token, get_permalink($post_id));\n\n wp_send_json([ 'post_id' => $post_id, 'token' => $token, 'url' => $url ]);\n }", "function makePayment($arr) {\n\t$accessToken = \"eYgzn2wfvScb1aIf3QLs\";\n\t$merchantNumber = \"T511564901\";\n\t$secretToken = \"1qcvgmCNmSvP1ikAG38uSoAPr7ePByuMcWuMWKsa\";\n\n\t$apiKey = base64_encode(\n\t\t$accessToken . \"@\" . $merchantNumber . \":\" . $secretToken\n\t);\n\n\t$checkoutUrl = \"https://api.v1.checkout.bambora.com/sessions\";\n\n\t$request = array();\n\t$request[\"order\"] = array();\n\t$request[\"order\"][\"id\"] = $arr['orderID'];\n\t$request[\"order\"][\"amount\"] = $arr['amount'];\n\t$request[\"order\"][\"currency\"] = \"NOK\";\n\n\t$request[\"url\"] = array();\n\t$request[\"url\"][\"accept\"] = $arr['acceptURL'];\n\t$request[\"url\"][\"cancel\"] = $arr['cancelURL'];\n\t$request[\"url\"][\"callbacks\"] = array();\n\t$request[\"url\"][\"callbacks\"][] = array(\"url\" => $arr['callbackURL']);\n\n\t$requestJson = json_encode($request);\n\n\t$contentLength = isset($requestJson) ? strlen($requestJson) : 0;\n\n\t$headers = array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . $contentLength,\n\t\t'Accept: application/json',\n\t\t'Authorization: Basic ' . $apiKey\n\t);\n\n\t$curl = curl_init();\n\n\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $requestJson);\n\tcurl_setopt($curl, CURLOPT_URL, $checkoutUrl);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($curl, CURLOPT_FAILONERROR, false);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$rawResponse = curl_exec($curl);\n\t$response = json_decode($rawResponse);\n\t\n\treturn $response;\n}", "public function after_payment_method_details() {\n\n\t\t$key = isset( $_GET['order'] ) ? $_GET['order'] : '';\n\n\t\t$order = llms_get_order_by_key( $key );\n\t\tif ( ! $order ) {\n\t\t\treturn;\n\t\t} elseif ( 'paypal' !== $order->get( 'payment_gateway' ) ) {\n\t\t\tif ( ! isset( $_GET['confirm-switch'] ) || 'paypal' !== $_GET['confirm-switch'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$req = new LLMS_PayPal_Request( $this );\n\t\t$r = $req->get_express_checkout_details( $_GET['token'] );\n\n\t\techo '<input name=\"llms_paypal_token\" type=\"hidden\" value=\"' . $_GET['token'] . '\">';\n\t\techo '<input name=\"llms_paypal_payer_id\" type=\"hidden\" value=\"' . $_GET['PayerID'] . '\">';\n\n\t\tif ( isset( $r['EMAIL'] ) ) {\n\t\t\techo '<div class=\"\"><span class=\"llms-label\">' . __( 'PayPal Email:', 'lifterlms-paypal' ) . '</span> ' . $r['EMAIL'] . '</div>';\n\t\t}\n\n\t}", "public function sendPaymentRequest(array $data){\n //start variables preparation\n $client_id = Mage::helper('sign2pay')->getSign2payClientId();\n $client_secret = Mage::helper('sign2pay')->getSign2payClientSecret();\n\n $quote = Mage::helper('sign2pay')->getQuote();\n\n $ref_id = Mage::getSingleton('checkout/session')->getSign2PayCheckoutHash();\n\n $request_body = array(\n 'client_id' => $client_id,\n 'amount' => Mage::helper('sign2pay')->getPaymentAmount(),\n 'ref_id' => $ref_id,\n 'token' => $data['access_token']['token']\n );\n //end variables preparation\n\n /*==========================================start request preparation==========================*/\n $client = new Varien_Http_Client('https://app.sign2pay.com/api/v2/payment/authorize/capture');\n $client->setMethod(Varien_Http_Client::POST);\n\n $client->setAuth($client_id,$client_secret);\n $client->setParameterPost($request_body);\n try {\n $response = $client->request();\n return $response->getBody();\n } catch (Zend_Http_Client_Exception $e) {\n Mage::logException($e);\n }\n }", "public function return_url(Request $request){\n\t\t // Get the payment ID before session clear\n //echo 'pppp'.$payment_id = Session::get('paypal_payment_id');\n\t\t//echo '<br><pre>'; print_r($request['PayerID']); echo '</pre>'; die;\n // clear the session payment ID\n //Session::forget('paypal_payment_id');\n\n\t\tif (empty($request['PayerID']) || empty($request['token'])) {\n\t\t\treturn redirect('service/payment/status')->with('error', 'Payment failed');\n }\n\t\t$payment_id = $request['paymentId'];\n\t\t$payment = Payment::get($payment_id, $this->_api_context);\n\t\t// PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n\t\t$execution = new PaymentExecution();\n $execution->setPayerId($request['PayerID']);\n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n //echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n //update database\n\t\t\t$user=Auth::user();\n\t\t\t$user_id=$user->id;\n\t\t\t$service_id=$request['service_id'];\n\t\t\t$service=Service::find($service_id,['name','price']);\n\t\t\t$user_order_data=[\n\t\t\t\t\t\t\t'user_id'=>$user_id,\n\t\t\t\t\t\t\t'item_id'=>$service_id,\n\t\t\t\t\t\t\t'item_name'=>$service->name,\n\t\t\t\t\t\t\t'item_type'=>'service',\n\t\t\t\t\t\t\t'item_amount'=> $service->price,\n\t\t\t\t\t\t\t'approved'=>1\n\t\t\t\t\t\t\t];\n\t\t\t$order_obj=Order::create($user_order_data);\n\t\t\t$order_id=$order_obj->id;\n\t\t\t$transaction_data=[\n\t\t\t\t\t\t\t 'order_id'=>$order_id,\n\t\t\t\t\t\t\t 'transaction_id'=>$result->getId(),\n\t\t\t\t\t\t\t 'amount'=>$service->price,\n\t\t\t\t\t\t\t 'transaction_type'=>'credit',\n\t\t\t\t\t\t\t 'payment_gateway_id' => 1,\n\t\t\t\t\t\t\t 'payment_method_id' => 2,\n\t\t\t\t\t\t\t 'order_status'=>1\n\t\t\t\t\t\t\t ];\n\t\t\tOrderTransaction::create($transaction_data);\n\t\t\t// forget the session of the service used to get service info for payment\n\t\t\tSession::forget('payment_service_id');\n\t\t\treturn redirect('service/payment/status')->with('success', 'Payment has been completed successfully!');\n }\n\n\t}", "function create_payment( $access_token, $c_transactions ) {\n\n global $host;\n\n $postdata = get_json_payment( $c_transactions );\n\n $url = $host.'/v1/payments/payment';\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true); // TRUE to do a regular HTTP POST.\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt($curl, CURLOPT_HEADER, false); // TRUE to include the header in the output.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Accept: application/json',\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n\n $info = curl_getinfo($curl);\n curl_close($curl); // close cURL handler\n \n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n echo \"Received error: \" . $info['http_code']. \"\\n\";\n echo \"Raw response:\".$response.\"\\n\";\n die();\n }\n\n }\n\n // Convert the result from JSON format to a PHP array\n $jsonResponse = json_decode($response, TRUE);\n return $jsonResponse;\n\n}", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "public function obtenerAuthToken()\n {\n $controller = new SignaBlockController;\n $response = $controller->auth();\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->token;\n }\n }\n return response()->json($this->jsonError);\n }", "public function getIdToken()\n {\n $clientId = $this->scopeConfig->getValue('transiteo_activation/general/client_id', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $refreshToken = $this->scopeConfig->getValue('transiteo_activation/general/refresh_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $response = $this->doRequest(\n self::API_AUTH_REQUEST_URI . \"oauth2/token\",\n [\n 'headers' => [\n 'Content-type' => 'application/x-www-form-urlencoded',\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n 'client_id' => $clientId,\n 'refresh_token' => $refreshToken\n ],\n 'http_errors' => false\n ],\n Request::HTTP_METHOD_POST\n );\n\n $status = $response->getStatusCode(); // 200 status code\n $responseBody = $response->getBody();\n $responseContent = $responseBody->getContents(); // here you will have the API response in JSON format\n\n if ($status == 200) {\n $responseArray = $this->serializer->unserialize($responseContent);\n\n $this->idToken = $responseArray['id_token'];\n //$this->cookie->set(self::COOKIE_NAME, $this->idToken, 3500);\n $this->flagManager->saveFlag(self::ID_TOKEN_FLAG_NAME, $this->idToken);\n $accessToken = $responseArray['access_token'];\n $this->flagManager->saveFlag(self::ACCESS_TOKEN_FLAG_NAME, $accessToken);\n $expires_in = $responseArray['expires_in'];\n $this->flagManager->saveFlag(self::TOKEN_EXPIRES_IN_FLAG_NAME, $expires_in);\n $token_type = $responseArray['token_type'];\n $this->flagManager->saveFlag(self::TOKEN_TYPE_FLAG_NAME, $token_type);\n $date = new \\DateTime();\n $this->flagManager->saveFlag(self::TOKEN_RECEIVED_TIMESTAMP, $date->getTimestamp());\n }\n\n return $responseContent;\n }", "public static function chooseTokensProcess()\n {\n\n $cart = geoCart::getInstance();\n $item = $cart->item;\n\n $util = geoAddon::getUtil('tokens');\n $token = $util->getTokenInfo($item->getPricePlan(), $_POST['token_choice']);\n\n if (!$token) {\n //should not get here, should be caught in checkVars, this is just\n //extra failsafe\n $cart->addError();\n return;\n }\n $item->setCost($token['price']);\n $item->set('tokens', (int)$token['tokens']);\n }", "function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}", "public static function chooseTokensCheckVars()\n {\n $cart = geoCart::getInstance();\n //check the settings!\n\n if (!$_POST['token_choice']) {\n $msgs = self::_getText();\n\n $cart->addError()\n ->addErrorMsg('tokens_purchase', $msgs['error_choose_tokens']);\n return;\n }\n\n $util = geoAddon::getUtil('tokens');\n $token = $util->getTokenInfo($cart->item->getPricePlan(), $_POST['token_choice']);\n\n if (!$token) {\n $msgs = self::_getText();\n\n $cart->addError()\n ->addErrorMsg('tokens_purchase', $msgs['error_invalid_selection']);\n }\n //if it got this far, everything is AOK!\n }", "public static function paymentMethodToken()\n {\n return new TextNode('payment_method_token');\n }", "public function getExpressCheckoutDetails($token) {\n\t\t$nvpstr = '&TOKEN=' . $token;\n\n\t\treturn $this->hash_call('GetExpressCheckoutDetails', $nvpstr);\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "public function process()\n {\n // Check for required fields\n if (in_array(false, $this->required_fields)) {\n $fields = array();\n foreach ($this->required_fields as $key => $field) {\n if (!$field) {\n $fields[] = $key;\n }\n }\n throw new Kohana_Exception('payment.required', implode(', ', $fields));\n }\n\n $fields = '';\n foreach ($this->authnet_values as $key => $value) {\n $fields .= $key.'='.urlencode($value).'&';\n }\n\n $post_url = ($this->test_mode) ?\n 'https://certification.authorize.net/gateway/transact.dll' : // Test mode URL\n 'https://secure.authorize.net/gateway/transact.dll'; // Live URL\n\n $ch = curl_init($post_url);\n\n // Set custom curl options\n curl_setopt_array($ch, $this->curl_config);\n\n // Set the curl POST fields\n curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, '& '));\n\n //execute post and get results\n $response = curl_exec($ch);\n \n curl_close($ch);\n \n if (!$response) {\n throw new Kohana_Exception('payment.gateway_connection_error');\n }\n\n // This could probably be done better, but it's taken right from the Authorize.net manual\n // Need testing to opimize probably\n $heading = substr_count($response, '|');\n\n for ($i=1; $i <= $heading; $i++) {\n $delimiter_position = strpos($response, '|');\n\n if ($delimiter_position !== false) {\n $response_code = substr($response, 0, $delimiter_position);\n \n $response_code = rtrim($response_code, '|');\n \n if ($response_code == '') {\n throw new Kohana_Exception('payment.gateway_connection_error');\n }\n\n switch ($i) {\n case 1:\n $this->response = (($response_code == '1') ? explode('|', $response) : false); // Approved\n\n $this->transaction = true;\n \n return $this->transaction;\n default:\n $this->transaction = false;\n \n return $this->transaction;\n }\n }\n }\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 }", "function responseReturn()\n{\n global $config;\n $error = '';\n $access_token = $_GET[\"access_token\"];\n\n if ($_POST[\"RESPCODE\"] == 01 && isset($_GET[\"access_token\"])) {\n $working_key='B5FF824CA9E4232ED185D9B05D2E2CCB';\t\t//Working Key should be provided here.\n $encResponse=$_POST[\"encResp\"];\t\t\t//This is the response sent by the CCAvenue Server\n $rcvdString=decrypt($encResponse,$working_key);\t\t//Crypto Decryption used as per the specified working key.\n $order_status=\"\";\n $decryptValues=explode('&', $rcvdString);\n $dataSize=sizeof($decryptValues);\n echo \"<center>\";\n\n for($i = 0; $i < $dataSize; $i++)\n {\n $information=explode('=',$decryptValues[$i]);\n if($i==3)\t$order_status=$information[1];\n }\n\n if($order_status===\"Success\")\n {\n echo \"<br>Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.\";\n\n }\n else if($order_status===\"Aborted\")\n {\n echo \"<br>Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail\";\n\n }\n else if($order_status===\"Failure\")\n {\n echo \"<br>Thank you for shopping with us.However,the transaction has been declined.\";\n }\n else\n {\n echo \"<br>Security Error. Illegal access detected\";\n\n }\n\n echo \"<br><br>\";\n\n echo \"<table cellspacing=4 cellpadding=4>\";\n for($i = 0; $i < $dataSize; $i++)\n {\n $information=explode('=',$decryptValues[$i]);\n echo '<tr><td>'.$information[0].'</td><td>'.$information[1].'</td></tr>';\n }\n\n echo \"</table><br>\";\n echo \"</center>\";\n exit();\n } else {\n // the transaction was not successful, do not deliver value'\n // print_r($result); //uncomment this line to inspect the result, to check why it failed.\n\n payment_fail_save_detail($access_token);\n mail($config['admin_email'],'Paystack error in '.$config['site_title'],'Paystack error in '.$config['site_title'].', status from Paystack');\n\n $error_msg = \"Transaction was not successful: Last gateway response was: \".$_POST[\"RESPMSG\"];\n payment_error(\"error\",$error_msg,$access_token);\n exit();\n }\n}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "function redirect_form()\n{\n global $pxpay;\n \n $request = new PxPayRequest();\n \n $http_host = getenv(\"HTTP_HOST\");\n $request_uri = getenv(\"SCRIPT_NAME\");\n $server_url = \"http://$http_host\";\n #$script_url = \"$server_url/$request_uri\"; //using this code before PHP version 4.3.4\n #$script_url = \"$server_url$request_uri\"; //Using this code after PHP version 4.3.4\n $script_url = (version_compare(PHP_VERSION, \"4.3.4\", \">=\")) ?\"$server_url$request_uri\" : \"$server_url/$request_uri\";\n $EnableAddBillCard = 1;\n \n # the following variables are read from the form\n $Quantity = $_REQUEST[\"Quantity\"];\n $MerchantReference = sprintf('%04x%04x-%04x-%04x',mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0x0fff) | 0x4000);\n $Address1 = $_REQUEST[\"Address1\"];\n $Address2 = $_REQUEST[\"Address2\"];\n $Address3 = $_REQUEST[\"Address3\"];\n \n #Calculate AmountInput\n $AmountInput = 21.50;\n \n #Generate a unique identifier for the transaction\n $TxnId = uniqid(\"ID\");\n \n #Set PxPay properties\n $request->setMerchantReference($MerchantReference);\n $request->setAmountInput($AmountInput);\n $request->setTxnData1($Address1);\n $request->setTxnData2($Address2);\n $request->setTxnData3($Address3);\n $request->setTxnType(\"Purchase\");\n $request->setCurrencyInput(\"NZD\");\n $request->setEmailAddress(\"[email protected]\");\n $request->setUrlFail($script_url);\t\t\t# can be a dedicated failure page\n $request->setUrlSuccess($script_url);\t\t\t# can be a dedicated success page\n $request->setTxnId($TxnId);\n $request->setRecurringMode(\"recurringinitial\");\n #The following properties are not used in this case\n $request->setEnableAddBillCard($EnableAddBillCard);\n # $request->setBillingId($BillingId);\n # $request->setOpt($Opt);\n\n \n #Call makeRequest function to obtain input XML\n $request_string = $pxpay->makeRequest($request);\n #Obtain output XML\n $response = new MifMessage($request_string);\n \n #Parse output XML\n $url = $response->get_element_text(\"URI\");\n $valid = $response->get_attribute(\"valid\");\n \n #Redirect to payment page\n header(\"Location: \".$url);\n}", "public function index(){\n\n $token_is = $_POST['accessToken'];\n $paymentIDis = $_POST['paymentId'];\n $token_is;\n $paymentIDis;\n $executeURL= \"https://checkout.sandbox.bka.sh/v1.2.0-beta/checkout/payment/execute/\";\n $proxy = \"1vggbqd4hqk9g96o9rrrp2jftvek578v7d2bnerim12a87dbrrka\";\n //echo $proxy;\n $url22 = curl_init($executeURL.$paymentIDis);\n\n $header=array(\n 'Content-Type:application/json',\n 'authorization:'.$token_is, \n 'x-app-key:5tunt4masn6pv2hnvte1sb5n3j' \n ); \n \n curl_setopt($url22,CURLOPT_HTTPHEADER, $header);\n curl_setopt($url22, CURLOPT_TIMEOUT, 30);\n curl_setopt($url22, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($url22, CURLOPT_POST, 1 );\n curl_setopt($url22,CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($url22,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($url22, CURLOPT_VERBOSE, true);\n curl_setopt($url22,CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($url22, CURLOPT_SSL_VERIFYPEER, true); # KEEP IT FALSE IF YOU RUN FROM LOCAL PC\n // curl_setopt($url22, CURLOPT_PROXY, $proxy);\n\n $resultdatax=curl_exec($url22);\n\n\n $code = curl_getinfo($url22, CURLINFO_HTTP_CODE);\n $info = curl_getinfo($url22);\n var_dump($info);\n\n\n curl_close($url22);\n $data2 = json_decode($resultdatax);\n // print_r($code);\n \n\n }", "public function paypalAction()\n {\n $adaptor = new \\Phalcon\\Logger\\Adapter\\File(APPLICATION_LOG_DIR . '/payment-paypal-ipn-' . date('Y-m-d') . '.log');\n $adaptor->info(var_export($_REQUEST, true));\n $response = new Response();\n $response->setStatusCode(200, 'OK');\n return $response;\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 }" ]
[ "0.67716926", "0.6770662", "0.6334543", "0.6192691", "0.61669415", "0.613896", "0.6076916", "0.6036614", "0.6036614", "0.6036614", "0.6036614", "0.6031266", "0.6021265", "0.5995351", "0.59666646", "0.5944641", "0.5943251", "0.59385884", "0.5894516", "0.5865951", "0.5832242", "0.5794325", "0.578971", "0.5771057", "0.5758022", "0.5726806", "0.57259446", "0.56906193", "0.5673111", "0.56717396", "0.5670614", "0.566852", "0.5661458", "0.5649487", "0.563274", "0.5630479", "0.56248665", "0.5607491", "0.5594458", "0.5590894", "0.5589547", "0.5586652", "0.55804086", "0.55719006", "0.55719006", "0.55719006", "0.55719006", "0.5559716", "0.5553507", "0.55501544", "0.55479515", "0.5543293", "0.55098104", "0.5504831", "0.54933894", "0.5486546", "0.54846704", "0.5484571", "0.5470797", "0.5460721", "0.5457826", "0.54522425", "0.544922", "0.54483557", "0.544753", "0.5443001", "0.54364187", "0.54329026", "0.5425487", "0.5419638", "0.54134834", "0.54122084", "0.5407829", "0.5407516", "0.5406889", "0.540609", "0.54040885", "0.5399018", "0.53971887", "0.5397104", "0.5394965", "0.53852737", "0.5380236", "0.53799766", "0.536752", "0.53619915", "0.5360858", "0.535663", "0.53487116", "0.5348595", "0.5346331", "0.5346196", "0.5344627", "0.53428864", "0.53428864", "0.534045", "0.534045", "0.5335933", "0.5334496", "0.53323275", "0.53267276" ]
0.0
-1
Get order and customer information from PayPal 2nd Step
public function getExpressCheckoutDetails($token) { $nvpstr = '&TOKEN=' . $token; return $this->hash_call('GetExpressCheckoutDetails', $nvpstr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\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?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\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\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\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\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\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}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function successAction() {\n\t\t\n\t\t//echo \"in b2b\";die;\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t\n\t\t$logFileName = 'magentoorder.log';\n\t\t\n\t\tMage::log('----------------- START ------------------------------- ', null, $logFileName);\t\n\t\t\n\t\t$quote = $session->getQuote();\n\t\t$quoteId = $quote->getEntityId();\n\t\t$privateId = $session->getPrivateId();\n\t\t\n\t\t\n\t\t\n\t\tif($privateId){\n\t\t\t$orderData = Mage::getModel('collectorbank/api')->getOrderResponse();\t\n\t\t\t\n\t\t\tif(isset($orderData['error'])){\n\t\t\t\t$session->addError($orderData['error']['message']);\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$orderDetails = $orderData['data'];\t\t\n\t\t\n\t\t\n\t\tif($orderDetails){\t\t\n\t\t\t$email = $orderDetails['customer']['email'];\n\t\t\t$mobile = $orderDetails['customer']['mobilePhoneNumber'];\n\t\t\t$firstName = $orderDetails['customer']['deliveryAddress']['firstName'];\n\t\t\t$lastName = $orderDetails['customer']['deliveryAddress']['lastName'];\n\t\t\t\n\t\t\t\n\t\t\t$store = Mage::app()->getStore();\n\t\t\t$website = Mage::app()->getWebsite();\n\t\t\t$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getId())->loadByEmail($email);\n\t\t\t\t// if the customer is not already registered\n\t\t\t\tif (!$customer->getId()) {\n\t\t\t\t\t$customer = Mage::getModel('customer/customer');\t\t\t\n\t\t\t\t\t$customer->setWebsiteId($website->getId())\n\t\t\t\t\t\t\t ->setStore($store)\n\t\t\t\t\t\t\t ->setFirstname($firstName)\n\t\t\t\t\t\t\t ->setLastname($lastName)\n\t\t\t\t\t\t\t ->setEmail($email); \n\t\t\t\t\ttry {\n\t\t\t\t\t \n\t\t\t\t\t\t$password = $customer->generatePassword(); \n\t\t\t\t\t\t$customer->setPassword($password); \n\t\t\t\t\t\t// set the customer as confirmed\n\t\t\t\t\t\t$customer->setForceConfirmed(true); \n\t\t\t\t\t\t// save customer\n\t\t\t\t\t\t$customer->save(); \n\t\t\t\t\t\t$customer->setConfirmation(null);\n\t\t\t\t\t\t$customer->save();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set customer address\n\t\t\t\t\t\t$customerId = $customer->getId(); \n\t\t\t\t\t\t$customAddress = Mage::getModel('customer/address'); \n\t\t\t\t\t\t$customAddress->setData($billingAddress)\n\t\t\t\t\t\t\t\t\t ->setCustomerId($customerId)\n\t\t\t\t\t\t\t\t\t ->setIsDefaultBilling('1')\n\t\t\t\t\t\t\t\t\t ->setIsDefaultShipping('1')\n\t\t\t\t\t\t\t\t\t ->setSaveInAddressBook('1');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// save customer address\n\t\t\t\t\t\t$customAddress->save();\n\t\t\t\t\t\t// send new account email to customer \n\t\t\t\t\t\t\n\t\t\t\t\t\t$storeId = $customer->getSendemailStoreId();\n\t\t\t\t\t\t$customer->sendNewAccountEmail('registered', '', $storeId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Customer with email '.$email.' is successfully created.', null, $logFileName);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Mage_Core_Exception $e) {\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$e->getMessage(), null, $logFileName);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$email, null, $logFileName);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t// Assign Customer To Sales Order Quote\n\t\t\t$quote->assignCustomer($customer);\n\t\t\t\n\t\t\tif($orderDetails['customer']['deliveryAddress']['country'] == 'Sverige'){\t$scountry_id = \"SE\";\t}\n\t\t\tif($orderDetails['customer']['billingAddress']['country'] == 'Sverige'){ $bcountry_id = \"SE\";\t}\n\t\t\t\n\t\t\t$billingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['billingAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['billingAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['billingAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['billingAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['billingAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\t$shippingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['deliveryAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['deliveryAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['deliveryAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['deliveryAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['deliveryAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\n\t\t\t// Add billing address to quote\n\t\t\t$billingAddressData = $quote->getBillingAddress()->addData($billingAddress);\n\t\t \n\t\t\t// Add shipping address to quote\n\t\t\t$shippingAddressData = $quote->getShippingAddress()->addData($shippingAddress);\n\t\t\t\n\t\t\t//check for selected shipping method\n\t\t\t$shippingMethod = $session->getSelectedShippingmethod();\n\t\t\tif(empty($shippingMethod)){\n\t\t\t\t$allShippingData = Mage::getModel('collectorbank/config')->getActiveShppingMethods();\n\t\t\t\t$orderItems = $orderDetails['order']['items'];\n\t\t\t\tforeach($orderItems as $oitem){\n\t\t\t\t\t//echo \"<pre>\";print_r($oitem);\n\t\t\t\t\tif(in_array($oitem['id'], $allShippingData)) {\n\t\t\t\t\t\t$shippingMethod = $oitem['id'];\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collect shipping rates on quote shipping address data\n\t\t\t$shippingAddressData->setCollectShippingRates(true)->collectShippingRates();\n\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setShippingMethod($shippingMethod);\t\t\t\n\t\t\t\n\t\t\t//$paymentMethod = 'collectorpay';\n\t\t\t$paymentMethod = 'collectorbank_invoice';\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setPaymentMethod($paymentMethod);\t\t\t\n\t\t\t\n\t\t\t$colpayment_method = $orderDetails['purchase']['paymentMethod'];\n\t\t\t$colpayment_details = json_encode($orderDetails['purchase']);\n\t\t\t\n\t\t\t// Set payment method for the quote\n\t\t\t$quote->getPayment()->importData(array('method' => $paymentMethod,'coll_payment_method' => $colpayment_method,'coll_payment_details' => $colpayment_details));\n\t\t\t\n\n\t\t\ttry{\n\t\t\t\t$orderReservedId = $session->getReference();\n\t\t\t\t$quote->setResponse($orderDetails);\n\t\t\t\t$quote->setCollCustomerType($orderDetails['customerType']);\n\t\t\t\t$quote->setCollBusinessCustomer($orderDetails['businessCustomer']);\n\t\t\t\t$quote->setCollStatus($orderDetails['status']);\n\t\t\t\t$quote->setCollPurchaseIdentifier($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t$quote->setCollTotalAmount($orderDetails['order']['totalAmount']);\n\t\t\t\tif($orderDetails['reference'] == $orderReservedId){\n\t\t\t\t\t$quote->setReservedOrderId($orderReservedId);\n\t\t\t\t} else {\n\t\t\t\t\t$quote->setReservedOrderId($orderDetails['reference']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t \t// Collect totals of the quote\n\t\t\t\t$quote->collectTotals();\n\t\t\t\t$quote->save();\n\t\t\t\t\n\t\t\t\t$service = Mage::getModel('sales/service_quote', $quote);\n\t\t\t\t$service->submitAll();\n\t\t\t\t$incrementId = $service->getOrder()->getRealOrderId();\n\t\t\t\t\n\t\t\t\tif($session->getIsSubscribed() == 1){\n\t\t\t\t\tMage::getModel('newsletter/subscriber')->subscribe($email);\n\t\t\t\t} \t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->setLastQuoteId($quote->getId())\n\t\t\t\t\t->setLastSuccessQuoteId($quote->getId())\n\t\t\t\t\t->clearHelperData();\n\t\t\t\t\t\n\t\t\t\tMage::getSingleton('checkout/session')->clear();\n\t\t\t\tMage::getSingleton('checkout/cart')->truncate()->save();\n\t\t\t\t\n\t\t\t\t$session->unsPrivateId();\n\t\t\t\t$session->unsReference();\n\t\t\t\t\n\t\t\t\t // Log order created message\n\t\t\t\tMage::log('Order created with increment id: '.$incrementId, null, $logFileName);\t\t\t\t\t\t\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$result['error'] = false;\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);\n\t\t\t\t\n\t\t\t\t$this->loadLayout();\n\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\tif ($block){//check if block actually exists\t\t\t\t\t\n\t\t\t\t\t\tif ($order->getId()) {\n\t\t\t\t\t\t\t$orderId = $order->getId();\n\t\t\t\t\t\t\t$isVisible = !in_array($order->getState(),Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());\n\t\t\t\t\t\t\t$block->setOrderId($incrementId);\n\t\t\t\t\t\t\t$block->setIsOrderVisible($isVisible);\n\t\t\t\t\t\t\t$block->setViewOrderId($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setViewOrderUrl($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setPrintUrl($block->getUrl('sales/order/print', array('order_id'=> $orderId)));\n\t\t\t\t\t\t\t$block->setCanPrintOrder($isVisible);\n\t\t\t\t\t\t\t$block->setCanViewOrder(Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->renderLayout();\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (Mage_Core_Exception $e) {\n\t\t\t\t\t$result['success'] = false;\n\t\t\t\t\t$result['error'] = true;\n\t\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t\t\tMage::log('Order creation is failed for invoice no '.$orderDetails['purchase']['purchaseIdentifier'] .\"Error is --> \".Mage::helper('core')->jsonEncode($result), null, $logFileName);\t\t\n\t\t\t\t\t//Mage::app()->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n\t\t\t\t\t$this->loadLayout();\n\t\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\t\tif ($block){\n\t\t\t\t\t\tif($orderDetails['purchase']['purchaseIdentifier']){\n\t\t\t\t\t\t\t$block->setInvoiceNo($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$block->setCode(222);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->renderLayout();\t\t\t\t\t\n\t\t\t} \t\t\t\n\t\t} \n\t\t\n\t\t} else {\n\t\t\tMage::log('Order is already generated.', null, $logFileName);\t\t\n\t\t\t$this->loadLayout(); \n\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\tif ($block){\n\t\t\t\t$block->setCode(111);\n\t\t\t}\n\t\t\t$this->renderLayout();\n\t\t}\n\n\t\tMage::log('----------------- END ------------------------------- ', null, $logFileName);\t\t\n\t}", "public function after_payment_method_details() {\n\n\t\t$key = isset( $_GET['order'] ) ? $_GET['order'] : '';\n\n\t\t$order = llms_get_order_by_key( $key );\n\t\tif ( ! $order ) {\n\t\t\treturn;\n\t\t} elseif ( 'paypal' !== $order->get( 'payment_gateway' ) ) {\n\t\t\tif ( ! isset( $_GET['confirm-switch'] ) || 'paypal' !== $_GET['confirm-switch'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$req = new LLMS_PayPal_Request( $this );\n\t\t$r = $req->get_express_checkout_details( $_GET['token'] );\n\n\t\techo '<input name=\"llms_paypal_token\" type=\"hidden\" value=\"' . $_GET['token'] . '\">';\n\t\techo '<input name=\"llms_paypal_payer_id\" type=\"hidden\" value=\"' . $_GET['PayerID'] . '\">';\n\n\t\tif ( isset( $r['EMAIL'] ) ) {\n\t\t\techo '<div class=\"\"><span class=\"llms-label\">' . __( 'PayPal Email:', 'lifterlms-paypal' ) . '</span> ' . $r['EMAIL'] . '</div>';\n\t\t}\n\n\t}", "public function bsuccessAction() {\n\t\t\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t\n\t\t$logFileName = 'magentoorder.log';\n\t\t\n\t\tMage::log('----------------- START ------------------------------- ', null, $logFileName);\t\n\t\t\n\t\t$quote = $session->getQuote();\n\t\t$quoteId = $quote->getEntityId();\n\t\t\n\t\t\n\t\t$typeData = $session->getTypeData();\n\t\t\n\t\t$privateId = $session->getBusinessPrivateId();\n\t\tif($privateId){\n\t\t\t$orderData = Mage::getModel('collectorbank/api')->getOrderResponse();\t\n\t\t\t//echo \"<pre>business \";print_r($orderData);die;\n\t\t\tif(isset($orderData['error'])){\n\t\t\t\t$session->addError($orderData['error']['message']);\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$orderDetails = $orderData['data'];\t\t\n\t\t\n\t\t\n\t\tif($orderDetails){\t\t\n\t\t\t$email = $orderDetails['businessCustomer']['email'];\n\t\t\t$mobile = $orderDetails['businessCustomer']['mobilePhoneNumber'];\n\t\t\t$firstName = $orderDetails['businessCustomer']['deliveryAddress']['companyName'];\n\t\t\t$lastName = $orderDetails['businessCustomer']['referencePerson'];\n\t\t\t\n\t\t\t\n\t\t\t$store = Mage::app()->getStore();\n\t\t\t$website = Mage::app()->getWebsite();\n\t\t\t$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getId())->loadByEmail($email);\n\t\t\t\t// if the customer is not already registered\n\t\t\t\tif (!$customer->getId()) {\n\t\t\t\t\t$customer = Mage::getModel('customer/customer');\t\t\t\n\t\t\t\t\t$customer->setWebsiteId($website->getId())\n\t\t\t\t\t\t\t ->setStore($store)\n\t\t\t\t\t\t\t ->setFirstname($firstName)\n\t\t\t\t\t\t\t ->setLastname($lastName)\n\t\t\t\t\t\t\t ->setEmail($email); \n\t\t\t\t\ttry {\n\t\t\t\t\t \n\t\t\t\t\t\t$password = $customer->generatePassword(); \n\t\t\t\t\t\t$customer->setPassword($password); \n\t\t\t\t\t\t// set the customer as confirmed\n\t\t\t\t\t\t$customer->setForceConfirmed(true); \n\t\t\t\t\t\t// save customer\n\t\t\t\t\t\t$customer->save(); \n\t\t\t\t\t\t$customer->setConfirmation(null);\n\t\t\t\t\t\t$customer->save();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set customer address\n\t\t\t\t\t\t$customerId = $customer->getId(); \n\t\t\t\t\t\t$customAddress = Mage::getModel('customer/address'); \n\t\t\t\t\t\t$customAddress->setData($billingAddress)\n\t\t\t\t\t\t\t\t\t ->setCustomerId($customerId)\n\t\t\t\t\t\t\t\t\t ->setIsDefaultBilling('1')\n\t\t\t\t\t\t\t\t\t ->setIsDefaultShipping('1')\n\t\t\t\t\t\t\t\t\t ->setSaveInAddressBook('1');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// save customer address\n\t\t\t\t\t\t$customAddress->save();\n\t\t\t\t\t\t// send new account email to customer \n\t\t\t\t\t\t\n\t\t\t\t\t\t$storeId = $customer->getSendemailStoreId();\n\t\t\t\t\t\t$customer->sendNewAccountEmail('registered', '', $storeId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Customer with email '.$email.' is successfully created.', null, $logFileName);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Mage_Core_Exception $e) {\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$e->getMessage(), null, $logFileName);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$email, null, $logFileName);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t// Assign Customer To Sales Order Quote\n\t\t\t$quote->assignCustomer($customer);\n\t\t\t\n\t\t\tif($orderDetails['businessCustomer']['deliveryAddress']['country'] == 'Sverige'){\t$scountry_id = \"SE\";\t}\n\t\t\tif($orderDetails['businessCustomer']['invoiceAddress']['country'] == 'Sverige'){ $bcountry_id = \"SE\";\t}\n\t\t\t\n\t\t\t$billingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['businessCustomer']['invoiceAddress']['companyName'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['businessCustomer']['invoiceAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['businessCustomer']['invoiceAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['businessCustomer']['invoiceAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['businessCustomer']['invoiceAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\t$shippingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['businessCustomer']['deliveryAddress']['companyName'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['businessCustomer']['deliveryAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['businessCustomer']['deliveryAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['businessCustomer']['deliveryAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['businessCustomer']['deliveryAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\n\t\t\t// Add billing address to quote\n\t\t\t$billingAddressData = $quote->getBillingAddress()->addData($billingAddress);\n\t\t \n\t\t\t// Add shipping address to quote\n\t\t\t$shippingAddressData = $quote->getShippingAddress()->addData($shippingAddress);\n\t\t\t\n\t\t\t//check for selected shipping method\n\t\t\t$shippingMethod = $session->getSelectedShippingmethod();\n\t\t\tif(empty($shippingMethod)){\n\t\t\t\t$allShippingData = Mage::getModel('collectorbank/config')->getActiveShppingMethods();\n\t\t\t\t$orderItems = $orderDetails['order']['items'];\n\t\t\t\tforeach($orderItems as $oitem){\n\t\t\t\t\t//echo \"<pre>\";print_r($oitem);\n\t\t\t\t\tif(in_array($oitem['id'], $allShippingData)) {\n\t\t\t\t\t\t$shippingMethod = $oitem['id'];\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collect shipping rates on quote shipping address data\n\t\t\t$shippingAddressData->setCollectShippingRates(true)->collectShippingRates();\n\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setShippingMethod($shippingMethod);\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$paymentMethod = 'collectorbank_invoice';\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setPaymentMethod($paymentMethod);\t\t\t\n\t\t\t\n\t\t\t$colpayment_method = $orderDetails['purchase']['paymentMethod'];\n\t\t\t$colpayment_details = json_encode($orderDetails['purchase']);\n\t\t\t\n\t\t\t\n\t\t\t// Set payment method for the quote\n\t\t\t$quote->getPayment()->importData(array('method' => $paymentMethod,'coll_payment_method' => $colpayment_method,'coll_payment_details' => $colpayment_details));\n\t\t\t\n\t\t\t//die;\n\t\t\ttry{\n\t\t\t\t$orderReservedId = $session->getReference();\n\t\t\t\t$quote->setResponse($orderDetails);\n\t\t\t\t$quote->setCollCustomerType($orderDetails['customerType']);\n\t\t\t\t$quote->setCollBusinessCustomer($orderDetails['businessCustomer']);\n\t\t\t\t$quote->setCollStatus($orderDetails['status']);\n\t\t\t\t$quote->setCollPurchaseIdentifier($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t$quote->setCollTotalAmount($orderDetails['order']['totalAmount']);\n\t\t\t\tif($orderDetails['reference'] == $orderReservedId){\n\t\t\t\t\t$quote->setReservedOrderId($orderReservedId);\n\t\t\t\t} else {\n\t\t\t\t\t$quote->setReservedOrderId($orderDetails['reference']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t \t// Collect totals of the quote\n\t\t\t\t$quote->collectTotals();\n\t\t\t\t$quote->save();\n\t\t\t\t\n\t\t\t\t$service = Mage::getModel('sales/service_quote', $quote);\n\t\t\t\t$service->submitAll();\n\t\t\t\t$incrementId = $service->getOrder()->getRealOrderId();\n\t\t\t\t\n\t\t\t\tif($session->getIsSubscribed() == 1){\n\t\t\t\t\tMage::getModel('newsletter/subscriber')->subscribe($email);\n\t\t\t\t} \t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->setLastQuoteId($quote->getId())\n\t\t\t\t\t->setLastSuccessQuoteId($quote->getId())\n\t\t\t\t\t->clearHelperData();\n\t\t\t\t\t\n\t\t\t\tMage::getSingleton('checkout/session')->clear();\n\t\t\t\tMage::getSingleton('checkout/cart')->truncate()->save();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->unsBusinessPrivateId();\n\t\t\t\t$session->unsReference();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t // Log order created message\n\t\t\t\tMage::log('Order created with increment id: '.$incrementId, null, $logFileName);\t\t\t\t\t\t\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$result['error'] = false;\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);\n\t\t\t\t\n\t\t\t\t$this->loadLayout();\n\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\tif ($block){//check if block actually exists\t\t\t\t\t\n\t\t\t\t\t\tif ($order->getId()) {\n\t\t\t\t\t\t\t$orderId = $order->getId();\n\t\t\t\t\t\t\t$isVisible = !in_array($order->getState(),Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());\n\t\t\t\t\t\t\t$block->setOrderId($incrementId);\n\t\t\t\t\t\t\t$block->setIsOrderVisible($isVisible);\n\t\t\t\t\t\t\t$block->setViewOrderId($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setViewOrderUrl($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setPrintUrl($block->getUrl('sales/order/print', array('order_id'=> $orderId)));\n\t\t\t\t\t\t\t$block->setCanPrintOrder($isVisible);\n\t\t\t\t\t\t\t$block->setCanViewOrder(Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->renderLayout();\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (Mage_Core_Exception $e) {\n\t\t\t\t\t$result['success'] = false;\n\t\t\t\t\t$result['error'] = true;\n\t\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t\t\tMage::log('Order creation is failed for invoice no '.$orderDetails['purchase']['purchaseIdentifier'] .\"Error is --> \".Mage::helper('core')->jsonEncode($result), null, $logFileName);\t\t\n\t\t\t\t\t$this->loadLayout();\n\t\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\t\tif ($block){\n\t\t\t\t\t\tif($orderDetails['purchase']['purchaseIdentifier']){\n\t\t\t\t\t\t\t$block->setInvoiceNo($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$block->setCode(222);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->renderLayout();\t\t\t\t\t\n\t\t\t} \t\t\t\n\t\t} \n\t\t\n\t\t} else {\n\t\t\tMage::log('Order is already generated.', null, $logFileName);\t\t\n\t\t\t$this->loadLayout(); \n\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\tif ($block){\n\t\t\t\t$block->setCode(111);\n\t\t\t}\n\t\t\t$this->renderLayout();\n\t\t}\n\n\t\tMage::log('----------------- END ------------------------------- ', null, $logFileName);\t\t\n\t}", "private function _expressCheckout()\r\n\t{\r\n\t\t/* We need to double-check that the token provided by PayPal is the one expected */\r\n\t\t$result = $this->paypal_usa->postToPayPal('GetExpressCheckoutDetails', '&TOKEN='.urlencode(Tools::getValue('token')));\r\n\t\tif ((strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING') && $result['TOKEN'] == Tools::getValue('token') && $result['PAYERID'] == Tools::getValue('PayerID'))\r\n\t\t{\r\n\t\t\t/* Checks if a customer already exists for this e-mail address */\r\n\t\t\tif (Validate::isEmail($result['EMAIL']))\r\n\t\t\t{\r\n\t\t\t\t$customer = new Customer();\r\n\t\t\t\t$customer->getByEmail($result['EMAIL']);\r\n\t\t\t}\r\n\r\n\t\t\t/* If the customer does not exist yet, create a new one */\r\n\t\t\tif (!Validate::isLoadedObject($customer))\r\n\t\t\t{\r\n\t\t\t\t$customer = new Customer();\r\n\t\t\t\t$customer->email = $result['EMAIL'];\r\n\t\t\t\t$customer->firstname = $result['FIRSTNAME'];\r\n\t\t\t\t$customer->lastname = $result['LASTNAME'];\r\n\t\t\t\t$customer->passwd = Tools::encrypt(Tools::passwdGen());\r\n\t\t\t\t$customer->add();\r\n\t\t\t}\r\n\r\n\t\t\t/* Look for an existing PayPal address for this customer */\r\n\t\t\t$addresses = $customer->getAddresses((int)Configuration::get('PS_LANG_DEFAULT'));\r\n\t\t\tforeach ($addresses as $address)\r\n\t\t\t\tif ($address['alias'] == 'PayPal')\r\n\t\t\t\t{\r\n\t\t\t\t\t$id_address = (int)$address['id_address'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t/* Create or update a PayPal address for this customer */\r\n\t\t\t$address = new Address(isset($id_address) ? (int)$id_address : 0);\r\n\t\t\t$address->id_customer = (int)$customer->id;\r\n\t\t\t$address->id_country = (int)Country::getByIso($result['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE']);\r\n\t\t\t$address->id_state = (int)State::getIdByIso($result['PAYMENTREQUEST_0_SHIPTOSTATE'], (int)$address->id_country);\r\n\t\t\t$address->alias = 'PayPal';\r\n\t\t\t$address->lastname = substr($result['PAYMENTREQUEST_0_SHIPTONAME'], 0, strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '));\r\n\t\t\t$address->firstname = substr($result['PAYMENTREQUEST_0_SHIPTONAME'], strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '), strlen($result['PAYMENTREQUEST_0_SHIPTONAME']) - strlen($address->lastname));\r\n\t\t\t$address->address1 = $result['PAYMENTREQUEST_0_SHIPTOSTREET'];\r\n\t\t\tif ($result['PAYMENTREQUEST_0_SHIPTOSTREET2'] != '')\r\n\t\t\t\t$address->address2 = $result['PAYMENTREQUEST_0_SHIPTOSTREET2'];\r\n\t\t\t$address->city = $result['PAYMENTREQUEST_0_SHIPTOCITY'];\r\n\t\t\t$address->postcode = $result['PAYMENTREQUEST_0_SHIPTOZIP'];\r\n\t\t\t$address->save();\r\n\r\n\t\t\t/* Update the cart billing and delivery addresses */\r\n\t\t\t$this->context->cart->id_address_delivery = (int)$address->id;\r\n\t\t\t$this->context->cart->id_address_invoice = (int)$address->id;\r\n\t\t\t$this->context->cart->update();\r\n\r\n\t\t\t/* Update the customer cookie to simulate a logged-in session */\r\n\t\t\t$this->context->cookie->id_customer = (int)$customer->id;\r\n\t\t\t$this->context->cookie->customer_lastname = $customer->lastname;\r\n\t\t\t$this->context->cookie->customer_firstname = $customer->firstname;\r\n\t\t\t$this->context->cookie->passwd = $customer->passwd;\r\n\t\t\t$this->context->cookie->email = $customer->email;\r\n\t\t\t$this->context->cookie->is_guest = $customer->isGuest();\r\n\t\t\t$this->context->cookie->logged = 1;\r\n\r\n\t\t\t/* Save the Payer ID and Checkout token for later use (during the payment step/page) */\r\n\t\t\t$this->context->cookie->paypal_express_checkout_token = $result['TOKEN'];\r\n\t\t\t$this->context->cookie->paypal_express_checkout_payer_id = $result['PAYERID'];\r\n\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tModule::hookExec('authentication');\r\n\t\t\telse\r\n\t\t\t\tHook::exec('authentication');\r\n\r\n\t\t\t/* Redirect the use to the \"Shipping\" step/page of the order process */\r\n\t\t\tTools::redirectLink($this->context->link->getPageLink('order.php', false, null, array('step' => '3')));\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t}\r\n\t}", "public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }", "public function orderInfo($increment_id){\n $result = $this->data['client']->salesOrderInfo($this->data['session'], $increment_id);\n \n return $result;\n}", "public function actionWalmartorderinfo()\n {\n $status = false;\n if (isset($_GET['status'])) {\n $status = $_GET['status'];\n }\n $merchant_id = MERCHANT_ID;\n $test = false;\n $prev_date = date('Y-m-d', strtotime(date('Y-m-d') . ' -2 month'));\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($status) {\n $orderdata = $walmartHelper->getOrders(['status' => $status, 'limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n } else {\n $orderdata = $walmartHelper->getOrders(['limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n }\n\n print_r($orderdata);\n die;\n }", "public function getPaymentRequestData( $order_id ) {\n $order = new WC_Order( $order_id );\n $params = array(\n 'transaction_details' => array(\n 'order_id' => $order_id,\n 'gross_amount' => 0,\n ));\n\n $customer_details = array();\n $customer_details['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $customer_details['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $customer_details['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_last_name');\n $customer_details['email'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_email');\n $customer_details['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n\n $billing_address = array();\n $billing_address['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $billing_address['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_last_name');\n $billing_address['address'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_address_1');\n $billing_address['city'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_city');\n $billing_address['postal_code'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_postcode');\n $billing_address['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n $converted_country_code = WC_Midtrans_Utils::convert_country_code(WC_Midtrans_Utils::getOrderProperty($order,'billing_country'));\n $billing_address['country_code'] = (strlen($converted_country_code) != 3 ) ? 'IDN' : $converted_country_code ;\n\n $customer_details['billing_address'] = $billing_address;\n $customer_details['shipping_address'] = $billing_address;\n\n if ( isset ( $_POST['ship_to_different_address'] ) ) {\n $shipping_address = array();\n $shipping_address['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_first_name');\n $shipping_address['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_last_name');\n $shipping_address['address'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_address_1');\n $shipping_address['city'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_city');\n $shipping_address['postal_code'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_postcode');\n $shipping_address['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n $converted_country_code = WC_Midtrans_Utils::convert_country_code(WC_Midtrans_Utils::getOrderProperty($order,'shipping_country'));\n $shipping_address['country_code'] = (strlen($converted_country_code) != 3 ) ? 'IDN' : $converted_country_code;\n $customer_details['shipping_address'] = $shipping_address;\n }\n \n $params['customer_details'] = $customer_details;\n $items = array();\n // Build item_details API params from $Order items\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n if ( $item['qty'] ) {\n // $product = $order->get_product_from_item( $item );\n $midtrans_item = array();\n $midtrans_item['id'] = $item['product_id'];\n $midtrans_item['price'] = ceil($order->get_item_subtotal( $item, false ));\n $midtrans_item['quantity'] = $item['qty'];\n $midtrans_item['name'] = $item['name'];\n $items[] = $midtrans_item;\n }\n }\n }\n\n // Shipping fee as item_details\n if( $order->get_total_shipping() > 0 ) {\n $items[] = array(\n 'id' => 'shippingfee',\n 'price' => ceil($order->get_total_shipping()),\n 'quantity' => 1,\n 'name' => 'Shipping Fee',\n );\n }\n\n // Tax as item_details\n if( $order->get_total_tax() > 0 ) {\n $items[] = array(\n 'id' => 'taxfee',\n 'price' => ceil($order->get_total_tax()),\n 'quantity' => 1,\n 'name' => 'Tax',\n );\n }\n\n // Discount as item_details\n if ( $order->get_total_discount() > 0) {\n $items[] = array(\n 'id' => 'totaldiscount',\n 'price' => ceil($order->get_total_discount()) * -1,\n 'quantity' => 1,\n 'name' => 'Total Discount'\n );\n }\n\n // Fees as item_details\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fees = $order->get_fees();\n $i = 0;\n foreach( $fees as $item ) {\n $items[] = array(\n 'id' => 'itemfee' . $i,\n 'price' => ceil($item['line_total']),\n 'quantity' => 1,\n 'name' => $item['name'],\n );\n $i++;\n }\n }\n\n // Iterate through the entire item to ensure that currency conversion is applied\n if (get_woocommerce_currency() != 'IDR'){\n foreach ($items as &$item) {\n $item['price'] = $item['price'] * $this->to_idr_rate;\n $item['price'] = intval($item['price']);\n }\n unset($item);\n $params['transaction_details']['gross_amount'] *= $this->to_idr_rate;\n }\n\n $total_amount=0;\n // error_log('print r items[]' . print_r($items,true)); //debugan\n // Sum item details prices as gross_amount\n foreach ($items as $item) {\n $total_amount+=($item['price']*$item['quantity']);\n }\n $params['transaction_details']['gross_amount'] = $total_amount;\n $params['item_details'] = $items;\n $params['credit_card']['secure'] = ($this->enable_3d_secure == 'yes') ? true : false;\n\n // add custom `expiry` API params\n $custom_expiry_params = explode(\" \",$this->custom_expiry);\n if ( !empty($custom_expiry_params[1]) && !empty($custom_expiry_params[0]) ){\n $time = time();\n $time += 30; // add 30 seconds to allow margin of error\n $params['expiry'] = array(\n 'start_time' => date(\"Y-m-d H:i:s O\",$time), \n 'unit' => $custom_expiry_params[1], \n 'duration' => (int)$custom_expiry_params[0],\n );\n }\n // add custom_fields API params\n $custom_fields_params = explode(\",\",$this->custom_fields);\n if ( !empty($custom_fields_params[0]) ){\n $params['custom_field1'] = $custom_fields_params[0];\n $params['custom_field2'] = !empty($custom_fields_params[1]) ? $custom_fields_params[1] : null;\n $params['custom_field3'] = !empty($custom_fields_params[2]) ? $custom_fields_params[2] : null;\n }\n // add savecard API params\n if ($this->enable_savecard =='yes' && is_user_logged_in()){\n $params['user_id'] = crypt( $customer_details['email'].$customer_details['phone'] , $this->server_key );\n $params['credit_card']['save_card'] = true;\n }\n // add Snap API metadata, identifier for request coming via this plugin\n try {\n $params['metadata'] = array(\n 'x_midtrans_wc_plu' => array(\n 'version' => MIDTRANS_PLUGIN_VERSION,\n 'wc' => WC_VERSION,\n 'php' => phpversion()\n )\n );\n } catch (Exception $e) { }\n\n return $params;\n }", "public function getCustomerPaymentDataAction()\n {\n $request = $this->Request()->getParams();\n $customerId = $request['customerId'];\n $paymentId = $request['paymentId'];\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $paymentModel = $createBackendOrder->getCustomerPaymentData($customerId, $paymentId);\n /** @var Shopware\\Models\\Customer\\PaymentData $payment */\n $payment = Shopware()->Models()->toArray($paymentModel);\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $payment\n ]\n );\n }", "private function _expressCheckoutPayment()\r\n\t{\r\n\t\t/* Verifying the Payer ID and Checkout tokens (stored in the customer cookie during step 2) */\r\n\t\tif (isset($this->context->cookie->paypal_express_checkout_token) && !empty($this->context->cookie->paypal_express_checkout_token))\r\n\t\t{\r\n\t\t\t/* Confirm the payment to PayPal */\r\n\t\t\t$currency = new Currency((int)$this->context->cart->id_currency);\r\n\t\t\t$result = $this->paypal_usa->postToPayPal('DoExpressCheckoutPayment', '&TOKEN='.urlencode($this->context->cookie->paypal_express_checkout_token).'&PAYERID='.urlencode($this->context->cookie->paypal_express_checkout_payer_id).'&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_AMT='.$this->context->cart->getOrderTotal(true).'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($currency->iso_code).'&IPADDRESS='.urlencode($_SERVER['SERVER_NAME']));\r\n\r\n\t\t\tif (strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING')\r\n\t\t\t{\r\n\t\t\t\t/* Prepare the order status, in accordance with the response from PayPal */\r\n\t\t\t\tif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'COMPLETED')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYMENT');\r\n\t\t\t\telseif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'PENDING')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYPAL');\r\n\t\t\t\telse\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_ERROR');\r\n\r\n\t\t\t\t/* Prepare the transaction details that will appear in the Back-office on the order details page */\r\n\t\t\t\t$message =\r\n\t\t\t\t\t\t'Transaction ID: '.$result['PAYMENTINFO_0_TRANSACTIONID'].'\r\n\t\t\t\tTransaction type: '.$result['PAYMENTINFO_0_TRANSACTIONTYPE'].'\r\n\t\t\t\tPayment type: '.$result['PAYMENTINFO_0_PAYMENTTYPE'].'\r\n\t\t\t\tOrder time: '.$result['PAYMENTINFO_0_ORDERTIME'].'\r\n\t\t\t\tFinal amount charged: '.$result['PAYMENTINFO_0_AMT'].'\r\n\t\t\t\tCurrency code: '.$result['PAYMENTINFO_0_CURRENCYCODE'].'\r\n\t\t\t\tPayPal fees: '.$result['PAYMENTINFO_0_FEEAMT'];\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_EXCHANGERATE']) && !empty($result['PAYMENTINFO_0_EXCHANGERATE']))\r\n\t\t\t\t\t$message .= 'Exchange rate: '.$result['PAYMENTINFO_0_EXCHANGERATE'].'\r\n\t\t\t\tSettled amount (after conversion): '.$result['PAYMENTINFO_0_SETTLEAMT'];\r\n\r\n\t\t\t\t$pending_reasons = array(\r\n\t\t\t\t\t'address' => 'Customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments.',\r\n\t\t\t\t\t'echeck' => 'The payment is pending because it was made by an eCheck that has not yet cleared.',\r\n\t\t\t\t\t'intl' => 'You hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.',\r\n\t\t\t\t\t'multi-currency' => 'You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.',\r\n\t\t\t\t\t'verify' => 'You are not yet verified, you have to verify your account before you can accept this payment.',\r\n\t\t\t\t\t'other' => 'Unknown, for more information, please contact PayPal customer service.');\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_PENDINGREASON']) && !empty($result['PAYMENTINFO_0_PENDINGREASON']) && isset($pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']]))\r\n\t\t\t\t\t$message .= \"\\n\".'Pending reason: '.$pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']];\r\n\r\n\t\t\t\t/* Creating the order */\r\n\t\t\t\t$customer = new Customer((int)$this->context->cart->id_customer);\r\n\t\t\t\tif ($this->paypal_usa->validateOrder((int)$this->context->cart->id, (int)$order_status, (float)$result['PAYMENTINFO_0_AMT'], $this->paypal_usa->displayName, $message, array(), null, false, $customer->secure_key))\r\n\t\t\t\t{\r\n\t\t\t\t\t/* Store transaction ID and details */\r\n\t\t\t\t\t$this->paypal_usa->addTransactionId((int)$this->paypal_usa->currentOrder, $result['PAYMENTINFO_0_TRANSACTIONID']);\r\n\t\t\t\t\t$this->paypal_usa->addTransaction('payment', array('source' => 'express', 'id_shop' => (int)$this->context->cart->id_shop, 'id_customer' => (int)$this->context->cart->id_customer, 'id_cart' => (int)$this->context->cart->id,\r\n\t\t\t\t\t\t'id_order' => (int)$this->paypal_usa->currentOrder, 'id_transaction' => $result['PAYMENTINFO_0_TRANSACTIONID'], 'amount' => $result['PAYMENTINFO_0_AMT'],\r\n\t\t\t\t\t\t'currency' => $result['PAYMENTINFO_0_CURRENCYCODE'], 'cc_type' => '', 'cc_exp' => '', 'cc_last_digits' => '', 'cvc_check' => 0,\r\n\t\t\t\t\t\t'fee' => $result['PAYMENTINFO_0_FEEAMT']));\r\n\r\n\t\t\t\t\t/* Reset the PayPal's token so the customer will be able to place a new order in the future */\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Redirect the customer to the Order confirmation page */\r\n\t\t\t\tif (_PS_VERSION_ < 1.4)\r\n\t\t\t\t\tTools::redirect('order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\telse\r\n\t\t\t\t\tTools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t\t/* If PayPal is returning an error code equal to 10486, it means either that:\r\n\t\t\t\t *\r\n\t\t\t\t * - Billing address could not be confirmed\r\n\t\t\t\t * - Transaction exceeds the card limit\r\n\t\t\t\t * - Transaction denied by the card issuer\r\n\t\t\t\t * - The funding source has no funds remaining\r\n\t\t\t\t *\r\n\t\t\t\t * Therefore, we are displaying a new PayPal Express Checkout button and a warning message to the customer\r\n\t\t\t\t * He/she will have to go back to PayPal to select another funding source or resolve the payment error\r\n\t\t\t\t */\r\n\t\t\t\tif (isset($result['L_ERRORCODE0']) && (int)$result['L_ERRORCODE0'] == 10486)\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t\t$this->context->smarty->assign('paypal_usa_action', $this->context->link->getModuleLink('paypalusa', 'expresscheckout', array('pp_exp_initial' => 1)));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function add_customer($order) {\n\n $customerData = array(\n 'name' => $order->billing_first_name,\n 'last_name' => $order->billing_last_name,\n 'email' => $order->billing_email,\n 'requires_account' => false,\n 'phone_number' => $order->billing_phone, \n );\n\n if($this->hasAddress($order)) {\n $customerData['address'] = array(\n 'line1' => substr($order->billing_address_1, 0, 200),\n 'line2' => substr($order->billing_address_2, 0, 50),\n 'line3' => '',\n 'state' => $order->billing_state,\n 'city' => $order->billing_city,\n 'postal_code' => $order->billing_postcode,\n 'country_code' => $order->billing_country\n );\n }\n \n $response = $this->openpay_request($customerData, 'customers');\n\n if (!isset($response->error_code)) {\n // Store the ID on the user account\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), '_openpay_customer_id', $response->id);\n }\n\n // Store the ID in the order\n update_post_meta($order->id, '_openpay_customer_id', $response->id);\n\n return $response->id;\n } else {\n $msg = $this->handleRequestError($response->error_code);\n return new WP_Error('error', __($response->error_code.' '.$msg, 'openpay-woosubscriptions'));\n }\n }", "public function paypalAction() {\n\n $request = $this->getRequest();\n $orderId = (integer) $request->getParam('orderId', 0);\n\n $order = null;\n //try to find according to customerId\n if ($orderId > 0) {\n try {\n $order = new Yourdelivery_Model_Order($orderId);\n $transaction = new Yourdelivery_Model_DbTable_Paypal_Transactions();\n $this->view->paypal = $transaction->getByOrder($order->getId());\n $this->view->payerId = $transaction->getPayerId($order->getId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n \n }\n }\n \n $this->view->order = $order;\n }", "public function processPayment();", "public function getCheckoutForm() {\n global $wpdb, $wpsc_cart, $current_user, $cart_data;\n\n get_currentuserinfo();\n $wpsc_checkout = new wpsc_checkout();\n\n $params = $this->getParams();\n \n $addressPrefix = ( isset( $_POST['shippingSameBilling'] ) && 'true' == $_POST['shippingSameBilling'] ) ? 'billing' : 'shipping';\n\n $values = array();\n\n // Get the values from the WPEC forms\n foreach($wpsc_checkout->checkout_items as $formData) {\n $klarnaValue = '';\n switch($formData->unique_name) {\n case $addressPrefix . 'firstname':\n $klarnaValue = 'firstName';\n break;\n case $addressPrefix . 'lastname':\n $klarnaValue = 'lastName';\n break;\n case $addressPrefix . 'address':\n $klarnaValue = 'street';\n break;\n case $addressPrefix . 'city':\n $klarnaValue = 'city';\n break;\n case $addressPrefix . 'postcode':\n $klarnaValue = 'zipcode';\n break;\n case 'billingphone':\n $klarnaValue = array('phoneNumber', 'mobilePhone');\n break;\n default:\n break;\n }\n $maybe_checkout_values = wpsc_get_customer_meta( 'checkout_details' );\n if ( $klarnaValue && ! empty( $maybe_checkout_values ) ) {\n if ( is_array( $klarnaValue ) ) {\n foreach ( $klarnaValue as $value ) {\n $values[$value] = $maybe_checkout_values[$formData->id];\n }\n } else {\n $values[$klarnaValue] = $maybe_checkout_values [$formData->id];\n }\n }\n }\n \n if ($this->getCountryCode() == 'de' || $this->getCountryCode() == 'nl') {\n $addressMatches = array();\n $values['street'] = isset( $values['street'] ) ? $values['street'] : '';\n preg_match('/(?P<street>.*?) (?P<houseno>[0-9]+.*?)( (?P<houseext>[^ ]+))?$/', $values['street'], $addressMatches);\n if(isset($addressMatches['street'])) {\n $values['street'] = $addressMatches['street'];\n if(isset($addressMatches['houseno']))\n $values['homenumber'] = $addressMatches['houseno'];\n if(isset($addressMatches['houseext'])) {\n if($this->getCountryCode() == 'nl')\n $values['house_extension'] = $addressMatches['houseext'];\n else\n $values['homenumber'] .= ' ' . $addressMatches['houseext'];\n }\n }\n }\n\n \n // Get values from previously submitted Klarna form\n $fields = array('gender', 'socialNumber', 'firstName', 'lastName', 'street', 'homenumber', 'zipcode',\n 'city', 'phoneNumber', 'mobilePhone', 'emailAddress', 'year_salary', 'invoiceType', 'companyName',\n 'house_extension', 'shipmentAddressInput_invoice', 'reference', 'paymentplan', 'birth_day',\n 'birth_month', 'birth_year', 'consent', 'paymentPlan');\n foreach($fields AS $field) {\n $fullFieldName = 'klarna_' . $this->moduleType . '_' . $field;\n if(isset($_POST[$fullFieldName]))\n $values[$field] = (trim((string)$_POST[$fullFieldName]));\n }\n \n $maybe_customer_info = wpsc_get_customer_meta( 'klarna_customer_info' );\n if ( ! empty( $maybe_customer_info ) )\n $values = array_merge( $values, $maybe_customer_info );\n\n if ( self::ENABLE_KLARNA_ILT == 1 && is_array($this->iltQuestions) && count($this->iltQuestions) >= 1)\n $this->API->setIltQuestions($this->iltQuestions);\n \n // Some things should only be output once (i.e. in the first activated module)\n if($this->moduleID == 1) {\n $balloons = $this->getBalloons();\n $this->API->addSetupValue('threatmetrix', $this->checkoutHTML());\n } else {\n $balloons = '';\n } \n\n $params['nlBanner'] = ($this->getCountryCode() == 'nl' ? '<div class=\"nlBanner\"><img src=\"' . KLARNA_URL . '/klarna_library/images/klarna/account/notice_nl.jpg\" /></div>' : '');\n\n\n return $balloons . $this->API->retrieveHTML($params, $values, null, array('name' => 'default'));\n }", "public function getdetails(){\n $data = $this->get();\n if(!empty($data)){\n $pizzalist = new pizzalist();\n $nonpizza = new ordernonpizzalist();\n $payment = new payment();\n $customer = new customer();\n\n $customer->__set('CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'OrderID', $this->__get('OrderID'));\n \n\n $data['pizza'] = $pizzalist->getorderspizza($this->__get('OrderID'));\n $data['nonpizza'] = $nonpizza->getordernonpizza($this->__get('OrderID'));\n $data['payment'] = $payment->getbyorderid();\n $data['Customer'] = $customer->get(); \n\n // $this->__set('Customer', $data[0]['CustomerID']);\n // $this->__set('TotalPrice', $data[0]['TotalPrice']);\n // $this->__set( 'Status', $data[0]['Status']);\n // $this->__set( 'OrderAddress', $data[0]['OrderAddress']);\n // $this->__set( 'OrderTime', $data[0]['OrderTime']);\n // $this->__set( 'OrderDeliverTime', $data[0]['OrderDeliverTime']);\n $this->__set( 'pizzalist', $data['pizza']);\n $this->__set( 'nonpizzalist', $data['nonpizza']);\n $this->__set( 'payment', $data['payment']);\n $this->__set( 'Customer', $data['Customer']);\n \n return $data;\n } else {\n\n return false;\n\n }\n }", "function get_params( $order) {\n\t\tglobal $woocommerce, $wc_authorize_sim;\n\t\t\n\t\t$this->add_log( 'Generating payment form for order #' . $order->id);\n\t\t\n\t\t$params = array();\n\t\t\n\t\t$params = array (\n\t\t\t'x_login'\t\t\t=> $this->login_id,\n\t\t\t'x_show_form'\t\t=> 'PAYMENT_FORM',\t\t\t\n\t\t\t'x_type' \t\t\t=> $this->type,\n\t\t\t'x_test_request' \t=> ($this->testmode == 'yes') ? 'TRUE' : 'FALSE',\t\t\t\n\t\t\t'x_relay_response'\t=> 'TRUE',\n 'x_relay_url' \t=> add_query_arg('_hdl_anet_sim', 'relay', $this->notify_url),\n \n\t\t\t//billing\n\t\t\t'x_first_name' \t\t=> $order->billing_first_name,\n\t\t\t'x_last_name' \t\t=> $order->billing_last_name,\n\t\t\t'x_address' \t\t=> $order->billing_address_1,\n\t\t\t'x_city' \t\t\t=> $order->billing_city,\n\t\t\t'x_state' \t\t\t=> $order->billing_state,\n\t\t\t'x_zip' \t\t\t=> $order->billing_postcode,\n\t\t\t'x_country' \t\t=> $order->billing_country,\n\t\t\t'x_phone' \t\t\t=> $order->billing_phone,\n\t\t\t'x_email'\t\t\t=> $order->billing_email,\n\t\t\t\n\t\t\t//shipping\n\t\t\t'x_ship_to_first_name' \t\t=> $order->shipping_first_name,\n\t\t\t'x_ship_to_last_name' \t\t=> $order->shipping_last_name,\n\t\t\t'x_ship_to_address' \t\t=> $order->shipping_address_1,\n\t\t\t'x_ship_to_city' \t\t\t=> $order->shipping_city,\n\t\t\t'x_ship_to_state' \t\t\t=> $order->shipping_state,\n\t\t\t'x_ship_to_zip' \t\t\t=> $order->shipping_postcode,\n\t\t\t'x_ship_to_country' \t\t=> $order->shipping_country,\n\t\t\t'x_ship_to_company' \t\t=> $order->shipping_company,\n\t\t\t\t\n\t\t\t'x_cust_id' \t\t=> $order->user_id,\n\t\t\t'x_customer_ip' \t=> $this->get_user_ip(),\n\t\t\t'x_invoice_num' \t=> $order->id,\n\t\t\t'x_fp_sequence'\t\t=> $order->order_key,\n\t\t\t'x_amount' \t\t\t=> $order->get_total(),\n\t\t\t\n\t\t\t'x_cancel_url'\t\t=> $order->get_cancel_order_url(),\n\t\t\t'x_cancel_url_text'\t=> __( 'Cancel', WC_Authorize_SIM::TEXT_DOMAIN ),\n\t\t);\n\t\t\n\t\t// Address 2\n\t\tif( ! empty( $order->billing_address_2 ) ) {\n\t\t\t$params['x_address'] .= ' - ' . $order->billing_address_2;\n\t\t}\n\t\tif( ! empty( $order->shipping_address_2 ) ) {\n\t\t\t$params['x_ship_to_address'] .= ' - ' . $order->shipping_address_2;\n\t\t}\n\t\t\n\t\t// Add item line\n\t\t$this->add_item_fields( $order );\n\t\t\n\t\t// Tax\n\t\tif( $order->get_total_tax() > 0 ) {\n\t\t\t// Id\n\t\t\t$item_id = 'TAX01' ;\n\t\t\t\n\t\t\t// name\n\t\t\t$item_name \t= __( 'Cart Tax', WC_Authorize_SIM::TEXT_DOMAIN );\n\t\t\t\n\t\t\t// description\n\t\t\t$item_desc \t= '';\n\t\t\t\n\t\t\t// Quantity\n\t\t\t$item_qty \t= 1;\n\t\t\t\n\t\t\t// Amount\n\t\t\t$item_amount = $order->get_total_tax();\n\t\t\t\n\t\t\t// Log point\n\t\t\t$this->add_log( $item_id . \", $item_name, $item_desc, $item_qty, $item_amount\" );\n\t\t\t\n\t\t\t// Add line item\n\t\t\t$this->add_item_field( $item_id, $item_name, $item_desc, $item_qty, $item_amount, 'N');\n\t\t}\n\n\t\t// Fees\n\t\tif ( sizeof( $order->get_fees() ) > 0 ) {\n\t\t\t$idx = 0;\n\t\t\tforeach ( $order->get_fees() as $item ) {\n\t\t\t\t$idx ++;\n\t\t\t\t\n\t\t\t\t// Id\n\t\t\t\t$item_id = sprintf( 'FEE%02d', $idx );\n\t\t\t\n\t\t\t\t// name\n\t\t\t\t$item_name \t= $this->get_item_name( $item['name'] );\n\t\t\t\t\n\t\t\t\t// description\n\t\t\t\t$item_desc \t= $item_name;\n\t\t\t\t\n\t\t\t\t// Quantity\n\t\t\t\t$item_qty \t= 1;\n\t\t\t\t\n\t\t\t\t// Amount\n\t\t\t\t$item_amount = $item['line_total'];\n\t\t\t\t\n\t\t\t\t// Log point\n\t\t\t\t$this->add_log( $item_id . \", $item_name, $item_desc, $item_qty, $item_amount\" );\n\t\t\t\t\n\t\t\t\t$this->add_item_field( $item_id, $item_name, $item_desc, $item_qty, $item_amount, 'N');\n\t\t\t}\n\t\t}\n\n\t\t// Shipping Cost item\n\t\tif ( $order->get_total_shipping() > 0 ) {\n\t\t\t// Id\n\t\t\t$item_id = 'SHP01';\n\t\t\t\t\n\t\t\t// name\n\t\t\t$item_name \t= $this->get_item_name( $order->get_shipping_method() );\n\t\t\t\n\t\t\t// description\n\t\t\t$item_desc \t= sprintf( __( 'Shipping via %s', WC_Authorize_SIM::TEXT_DOMAIN ), $order->get_shipping_method() );\n\t\t\t\n\t\t\t// Quantity\n\t\t\t$item_qty \t= 1;\n\t\t\t\n\t\t\t// Amount\n\t\t\t$item_amount = round( $order->get_total_shipping(), 2 );\n\t\t\t\n\t\t\t// Log point\n\t\t\t$this->add_log( $item_id . \", $item_name, $item_desc, $item_qty, $item_amount\" );\n\t\t\t\n\t\t\t$this->add_item_field( $item_id, $item_name, $item_desc, $item_qty, $item_amount, 'N');\n\t\t}\n\t\t\n\t\t// Discount\n\t\tif ( $order->get_cart_discount() > 0 ) {\n\t\t\t// Id\n\t\t\t$item_id = 'DIS01' ;\n\t\t\t\n\t\t\t// name\n\t\t\t$item_name \t= __( 'Cart Discount', WC_Authorize_SIM::TEXT_DOMAIN );\n\t\t\t\n\t\t\t// description\n\t\t\t$item_desc \t= '';\n\t\t\t\n\t\t\t// Quantity\n\t\t\t$item_qty \t= 1;\n\t\t\t\n\t\t\t// Amount\n\t\t\t$item_amount = round( $order->get_cart_discount(), 2 );\n\t\t\t\n\t\t\t// Log point\n\t\t\t$this->add_log( $item_id . \", $item_name, $item_desc, $item_qty, $item_amount\" );\n\t\t\t\n\t\t\t$this->add_item_field( $item_id, $item_name, $item_desc, $item_qty, $item_amount, 'N');\n\t\t}\n\t\t\n\t\treturn apply_filters( 'woocommerce_authorize_sim_args', $params, $order->id );\n\t}", "public function fields() {\n $ID = $this->order['id'];\n $BUYCODE = $this->order['code'];\n $url = (mswSSL() == 'yes' ? str_replace('http://', 'https://', BASE_HREF) : BASE_HREF);\n $order = $this->getsale($ID, $BUYCODE);\n $params = $this->params();\n $timestamp = time();\n $name = $this->firstLastName($order->name);\n $country = $this->country($_POST['country']);\n $amount = $this->saletotal($order);\n $arr = array(\n 'x_login' => $params['login-id'],\n 'x_amount' => $amount,\n 'x_description' => $this->stripchars($this->lang[2]),\n 'x_invoice_num' => $ID,\n 'x_fp_sequence' => $ID,\n 'x_fp_timestamp' => $timestamp,\n 'x_fp_hash' => mmGateway::submissionhash($timestamp, $params, $ID, $amount),\n 'x_test_request' => ($this->settings->paymode == 'live' ? 'false' : 'true'),\n 'x_show_form' => 'PAYMENT_FORM',\n 'x_type' => 'AUTH_CAPTURE',\n 'x_first_name' => $this->stripchars($name['first-name']),\n 'x_last_name' => $this->stripchars($name['last-name']),\n 'x_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_email' => $this->stripchars($order->email),\n 'x_city' => $this->stripchars($_POST['city']),\n 'x_state' => $this->stripchars($_POST['county']),\n 'x_zip' => $this->stripchars($_POST['postcode']),\n 'x_country' => $this->stripchars($country->name),\n 'x_ship_to_first_name' => $this->stripchars($name['first-name']),\n 'x_ship_to_last_name' => $this->stripchars($name['last-name']),\n 'x_ship_to_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_ship_to_city' => $this->stripchars($_POST['city']),\n 'x_ship_to_state' => $this->stripchars($_POST['county']),\n 'x_ship_to_zip' => $this->stripchars($_POST['postcode']),\n 'x_ship_to_country' => $this->stripchars($country->name),\n 'x_relay_response' => 'false',\n 'x_cancel_url' => $url . $this->seo->url('cancel', array(), 'yes'),\n 'x_receipt_method' => 'POST',\n 'x_receipt_link_text' => $this->stripchars(str_replace('{store}', $this->settings->website, $this->lang[5])),\n 'x_receipt_link_url' => $url . 'index.php?gw=' . $ID . '-' . $BUYCODE\n );\n // Only include currency code for live server..\n // Seems to throw errors for test server..\n // If this throws (99) errors on live, uncomment..\n if ($this->settings->paymode == 'live') {\n $arr['x_currency_code'] = (in_array($this->settings->currency, array(\n 'USD',\n 'GBP',\n 'CAD',\n 'EUR'\n )) ? $this->settings->currency : 'USD');\n }\n return $arr;\n }", "public function execute($order, $customer, $params = [])\n {\n\n // Payment details\n $paymentDetails = new PaymentDetailsType();\n\n\n // Set the order items\n $itemTotalValue = 0;\n\n $items = $order->orderItems;\n $i = 0;\n foreach ($items as $item) {\n $itemAmount = new BasicAmountType($this->currency, round($item->sell_price, 2));\n $itemTotalValue += $itemAmount->value * $item->qty;\n $itemDetails = new PaymentDetailsItemType();\n $itemDetails->Name = $item->title;\n $itemDetails->Amount = $itemAmount;\n $itemDetails->Quantity = $item->qty;\n\n $paymentDetails->PaymentDetailsItem[$i] = $itemDetails;\n\n $i++;\n }\n\n /**\n * The total cost of the transaction to the buyer. If shipping cost and tax charges are known,\n * include them in this value. If not, this value should be the current subtotal of the order.\n * If the transaction includes one or more one-time purchases, this field must be equal to the sum of the purchases.\n * If the transaction does not include a one-time purchase such as when you set up a billing agreement for a recurring payment,\n * set this field to 0.\n */\n $paymentDetails->ItemTotal = new BasicAmountType($this->currency, $itemTotalValue);\n $paymentDetails->OrderTotal = new BasicAmountType($this->currency, $itemTotalValue);\n\n $setECReqDetails = new SetExpressCheckoutRequestDetailsType();\n $setECReqDetails->PaymentDetails[0] = $paymentDetails;\n /*\n * (Required) URL to which the buyer is returned if the buyer does not approve the use of PayPal to pay you. For digital goods, you must add JavaScript to this page to close the in-context experience.\n */\n $setECReqDetails->CancelURL = $this->cancelUrl;\n /*\n * (Required) URL to which the buyer's browser is returned after choosing to pay with PayPal. For digital goods, you must add JavaScript to this page to close the in-context experience.\n */\n $setECReqDetails->ReturnURL = $this->returnUrl;\n /*\n * Determines where or not PayPal displays shipping address fields on the PayPal pages. For digital goods, this field is required, and you must set it to 1. It is one of the following values:\n 0 – PayPal displays the shipping address on the PayPal pages.\n 1 – PayPal does not display shipping address fields whatsoever.\n 2 – If you do not pass the shipping address, PayPal obtains it from the buyer's account profile.\n */\n $setECReqDetails->NoShipping = 1;\n /*\n * (Optional) Determines whether or not the PayPal pages should display the shipping address set by you in this SetExpressCheckout request, not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. It is one of the following values:\n 0 – The PayPal pages should not display the shipping address.\n 1 – The PayPal pages should display the shipping address.\n */\n $setECReqDetails->AddressOverride = 0;\n /*\n * Indicates whether or not you require the buyer's shipping address on file with PayPal be a confirmed address. For digital goods, this field is required, and you must set it to 0. It is one of the following values:\n 0 – You do not require the buyer's shipping address be a confirmed address.\n 1 – You require the buyer's shipping address be a confirmed address.\n */\n $setECReqDetails->ReqConfirmShipping = 0;\n\n $setECReqType = new SetExpressCheckoutRequestType();\n $setECReqType->SetExpressCheckoutRequestDetails = $setECReqDetails;\n $setECReq = new SetExpressCheckoutReq();\n $setECReq->SetExpressCheckoutRequest = $setECReqType;\n /*\n * \t ## Creating service wrapper object\n Creating service wrapper object to make API call and loading\n Configuration::getAcctAndConfig() returns array that contains credential and config parameters\n */\n $paypalService = new PayPalAPIInterfaceServiceService($this->config);\n\n try {\n /* wrap API method calls on the service object with a try catch */\n $setECResponse = $paypalService->SetExpressCheckout($setECReq);\n if ($setECResponse->Ack === 'Success') {\n // Redirect the user to paypal.com here\n // We use a payment flow with a Pay Now button. Therefore we ad the \"useraction\" parameter with value \"commit\" to the url.\n return Yii::$app->controller->redirect('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=' . $setECResponse->Token);\n } elseif ($setECResponse->Ack === 'Failure') {\n foreach ($setECResponse->Errors as $error) {\n //Log the error\n Yii::error('Paypal SetExpressCheckout Failure: ' . $error->LongMessage);\n }\n Yii::$app->session->setFlash('error', 'You cannot use Paypal Payment at the moment. Pleas use annother Payment Method');\n $redirect = Yii::$app->session->get('checkoutRoute', Yii::$app->getHomeUrl());\n Yii::$app->response->redirect([$redirect]);\n Yii::$app->end();\n }\n\n } catch (Exception $ex) {\n $a = 4;\n }\n }", "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public function processPayment($order)\n {\n $shipping = sprintf('%0.2f', 0);\n // Add any tax amount if you want to apply any tax rule\n $tax = sprintf('%0.2f', 0);\n\n // Create a new instance of Payer class\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Adding items to the list\n $items = array();\n foreach ($order->items as $item) {\n $orderItems[$item->order_item_id] = new Item();\n $orderItems[$item->order_item_id]->setName($item->film->film_name)\n ->setCurrency(config('settings.currency_code'))\n ->setQuantity($item->order_item_quantity)\n ->setPrice(sprintf('%0.2f', $item->order_item_price));\n\n array_push($items, $orderItems[$item->order_item_id]);\n }\n\n $itemList = new ItemList();\n $itemList->setItems($items);\n\n // Setting Shipping Details\n $details = new Details();\n $details->setShipping($shipping)\n ->setTax($tax)\n ->setSubtotal(sprintf('%0.2f', $order->order_grand_total));\n\n // Setup currency payment\n // Create chargeable amout\n $amount = new Amount();\n $amount->setCurrency(config('settings.currency_code'))\n ->setTotal(sprintf('%0.2f', $order->order_grand_total))\n ->setDetails($details);\n\n\n // Creating a transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription($order->user->full_name)\n ->setInvoiceNumber($order->order_number);\n\n // This class takes two values, return URL (after successful completion where PayPal will redirect the user) and the cancel URL (if the user cancels the payment where he should be redirected).\n // Setting up redirection urls\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl(route('checkout.payment.complete'))\n ->setCancelUrl(route('booking.book_tickets_post'));\n\n // Creating payment instance\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n try {\n\n $payment->create($this->payPal);\n } catch (PayPalConnectionException $exception) {\n echo $exception->getCode(); // Prints the Error Code\n echo $exception->getData(); // Prints the detailed error message\n exit(1);\n } catch (Exception $e) {\n echo $e->getMessage();\n exit(1);\n }\n\n $approvalUrl = $payment->getApprovalLink();\n\n header(\"Location: {$approvalUrl}\");\n exit;\n }", "private function _getOrderCheckout(){\n\t\t$layout = $this->getCheckoutLayout();\n\t\t\n\t\t$mOrder = $this->getOrder();\n\t\t\n\t\t$checkout = new SnapOrder_Checkout();\n\t\t$checkout->return_url = Mage::getUrl('hostedpayments/processing/return', array('id' => $mOrder->getRealOrderId(), '_secure' => true));\n\t\t$checkout->cancel_url = $checkout->return_url;\n\t\t$checkout->auto_return = true;\n\t\t$checkout->checkout_layout = $layout;\n\t\t$checkout->create_token = $this->_isCardSaved();\n\t\t$checkout->language = EvoSnapTools::getLanguage(Mage::app()->getLocale()->getLocale()->getLanguage());\n\n\t\t$customer = new SnapCustomer();\n\t\t\n\t\t$customer->first_name = $mOrder->getCustomerFirstname();\n\t\t$customer->last_name = $mOrder->getCustomerLastname();\n\t\t$customer->email = $mOrder->getCustomerEmail();\n\t\t$customer->phone = $mOrder->getBillingAddress()->getTelephone();\n\t\t\n\t\t$checkout->customer = $customer;\n\t\t\n\t\t$checkout->order = $this->_getSnapOrder();\n\n\t\treturn $checkout;\n\t}", "public function customcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts);\n\t\tif($firstname=='')\n\t\t{\n\t\t\t$firstname='@';\n\t\t} */\n\t\t\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t\n\t\t//exit;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>'5','qty'=>1,'price'=>'50'],\n\t\t\t\t\t\t ['product_id'=>'6','qty'=>2,'price'=>'100']\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\n\n /*for sote 4 */\t\t\t\n\t\t /* $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t $helper = $objectManager->get('Webkul\\Marketplace\\Helper\\Data');\n\t\t $helper->setCurrentStore(4); */\n\t\t /* end for sote 4 */\n\t\t\n\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\t\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t\n\t\t//$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=4 and is_active=1 order by entity_id ASC limit 1\";\n\t\t$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t \n\n\t\t$result_result_cart = $connection->fetchAll($quote_sql_latest);\n\t\t // print_r($result_result_cart); \n\t\t\n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and entity_id='$quoteId' and is_active=1\";\n\t\t//$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=4 and entity_id='$quoteId' and is_active=1\";\n\t\t\n\t\t\n\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\tif(!empty($result_result))\n\t\t{\n\t\t\n\t\t\t $quoteId2=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId2);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId2);\n\t\t \n\t\t \n\t\t //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress(); \n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n //->setShippingMethod('freeshipping_freeshipping'); //shipping method\n\t\t\t\t\t\t->setShippingMethod($shipping); //shipping method\n\t\t\t\t\t\t\n //$quote->setPaymentMethod('cashondelivery'); //payment method\n\t\t$quote->setPaymentMethod($payment);\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n //$quote->getPayment()->importData(['method' => 'cashondelivery']);\n $quote->getPayment()->importData(['method' => $payment]);\n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n $quote->getId();\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t //$order->setEmailSent(1);\n $increment_id = $order->getRealOrderId();\n\t $lastOrderId = $increment_id;\n\t\t\n\t\t$helper = $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Data'\n );\n\t\t\n\t\t$getProductSalesCalculation = $objectManager->get(\n 'Webkul\\Marketplace\\Observer\\SalesOrderPlaceAfterObserver'\n );\n $getProductSalesCalculation->getProductSalesCalculation($order);\n\n /*send placed order mail notification to seller*/\n\n $salesOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order');\n $salesOrderItem = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order_item');\n\t\t\n\t\t\n\t\t\n\t\t $paymentCode = '';\n if ($order->getPayment()) {\n $paymentCode = $order->getPayment()->getMethod();\n }\n\n $shippingInfo = '';\n $shippingDes = '';\n\n $billingId = $order->getBillingAddress()->getId();\n\n $billaddress = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($billingId);\n $billinginfo = $billaddress['firstname'].'<br/>'.\n $billaddress['street'].'<br/>'.\n $billaddress['city'].' '.\n $billaddress['region'].' '.\n $billaddress['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($billaddress['country_id'])->getName().'<br/>T:'.\n $billaddress['telephone'];\n\n $payment = $order->getPayment()->getMethodInstance()->getTitle();\n\n\t\t\n\t\t\n\t\t if ($order->getShippingAddress()) {\n $shippingId = $order->getShippingAddress()->getId();\n $address = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($shippingId);\n $shippingInfo = $address['firstname'].'<br/>'.\n $address['street'].'<br/>'.\n $address['city'].' '.\n $address['region'].' '.\n $address['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($address['country_id'])->getName().'<br/>T:'.\n $address['telephone'];\n $shippingDes = $order->getShippingDescription();\n }\n\t\t\n\t\t\n\t\t$adminStoremail = $helper->getAdminEmailId();\n $adminEmail = $adminStoremail ? $adminStoremail : $helper->getDefaultTransEmailId();\n $adminUsername = 'Admin';\n\n $customerModel = $objectManager->create(\n 'Magento\\Customer\\Model\\Customer'\n );\n\n $sellerOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Orders'\n )\n ->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', ['neq' => 0]);\n\t\t\n\t \n\t foreach ($sellerOrder as $info) {\n $userdata = $customerModel->load($info['seller_id']);\n $username = $userdata['firstname'];\n $useremail = $userdata['email'];\n\n $senderInfo = [];\n $receiverInfo = [];\n\n $receiverInfo = [\n 'name' => $username,\n 'email' => $useremail,\n ];\n $senderInfo = [\n 'name' => $adminUsername,\n 'email' => $adminEmail,\n ];\n $totalprice = '';\n $totalTaxAmount = 0;\n $codCharges = 0;\n $shippingCharges = 0;\n $orderinfo = '';\n\n $saleslistIds = [];\n $collection1 = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', $info['seller_id'])\n ->addFieldToFilter('parent_item_id', ['null' => 'true'])\n ->addFieldToFilter('magerealorder_id', ['neq' => 0])\n ->addFieldToSelect('entity_id');\n\n $saleslistIds = $collection1->getData();\n\n $fetchsale = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )\n ->getCollection()\n ->addFieldToFilter(\n 'entity_id', \n ['in' => $saleslistIds]\n );\n $fetchsale->getSelect()->join(\n $salesOrder.' as so', \n 'main_table.order_id = so.entity_id', \n ['status' => 'status']\n );\n\n $fetchsale->getSelect()->join(\n $salesOrderItem.' as soi', \n 'main_table.order_item_id = soi.item_id AND main_table.order_id = soi.order_id', \n [\n 'item_id' => 'item_id', \n 'qty_canceled' => 'qty_canceled', \n 'qty_invoiced' => 'qty_invoiced', \n 'qty_ordered' => 'qty_ordered', \n 'qty_refunded' => 'qty_refunded', \n 'qty_shipped' => 'qty_shipped', \n 'product_options' => 'product_options', \n 'mage_parent_item_id' => 'parent_item_id'\n ]\n );\n foreach ($fetchsale as $res) {\n $product = $objectManager->create(\n 'Magento\\Catalog\\Model\\Product'\n )->load($res['mageproduct_id']);\n\n /* product name */\n $productName = $res->getMageproName();\n $result = [];\n if ($options = unserialize($res->getProductOptions())) {\n if (isset($options['options'])) {\n $result = array_merge($result, $options['options']);\n }\n if (isset($options['additional_options'])) {\n $result = array_merge($result, $options['additional_options']);\n }\n if (isset($options['attributes_info'])) {\n $result = array_merge($result, $options['attributes_info']);\n }\n }\n if ($_options = $result) {\n $proOptionData = '<dl class=\"item-options\">';\n foreach ($_options as $_option) {\n $proOptionData .= '<dt>'.$_option['label'].'</dt>';\n\n $proOptionData .= '<dd>'.$_option['value'];\n $proOptionData .= '</dd>';\n }\n $proOptionData .= '</dl>';\n $productName = $productName.'<br/>'.$proOptionData;\n } else {\n $productName = $productName.'<br/>';\n }\n /* end */\n\n $sku = $product->getSku();\n $orderinfo = $orderinfo.\"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).\"</td>\n <td class='item-price'>\".\n $order->formatPrice(\n $res['magepro_price'] * $res['magequantity']\n ).\n '</td>\n </tr></tbody>';\n $totalTaxAmount = $totalTaxAmount + $res['total_tax'];\n $totalprice = $totalprice + ($res['magepro_price'] * $res['magequantity']);\n\n /*\n * Low Stock Notification mail to seller\n */\n if ($helper->getlowStockNotification()) {\n $stockItemQty = $product['quantity_and_stock_status']['qty'];\n if ($stockItemQty <= $helper->getlowStockQty()) {\n $orderProductInfo = \"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).'</td>\n </tr></tbody>';\n\n $emailTemplateVariables = [];\n $emailTempVariables['myvar1'] = $orderProductInfo;\n $emailTempVariables['myvar2'] = $username;\n\n $this->_objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendLowStockNotificationMail(\n $emailTemplateVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n }\n }\n $shippingCharges = $info->getShippingCharges();\n $totalCod = 0;\n\n if ($paymentCode == 'mpcashondelivery') {\n $totalCod = $info->getCodCharges();\n $codRow = \"<tr class='subtotal'>\n <th colspan='3'>\".__('Cash On Delivery Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalCod).\n '</span></td>\n </tr>';\n } else {\n $codRow = '';\n }\n\n $orderinfo = $orderinfo.\"<tfoot class='order-totals'>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Shipping & Handling Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($shippingCharges).\"</span></td>\n </tr>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Tax Amount').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalTaxAmount).'</span></td>\n </tr>'.$codRow.\"\n <tr class='subtotal'>\n <th colspan='3'>\".__('Grandtotal').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice(\n $totalprice + \n $totalTaxAmount + \n $shippingCharges + \n $totalCod\n ).'</span></td>\n </tr></tfoot>';\n\n $emailTemplateVariables = [];\n if ($shippingInfo != '') {\n $isNotVirtual = 1;\n } else {\n $isNotVirtual = 0;\n }\n $emailTempVariables['myvar1'] = $order->getRealOrderId();\n $emailTempVariables['myvar2'] = $order['created_at'];\n $emailTempVariables['myvar4'] = $billinginfo;\n $emailTempVariables['myvar5'] = $payment;\n $emailTempVariables['myvar6'] = $shippingInfo;\n $emailTempVariables['isNotVirtual'] = $isNotVirtual;\n $emailTempVariables['myvar9'] = $shippingDes;\n $emailTempVariables['myvar8'] = $orderinfo;\n $emailTempVariables['myvar3'] = $username;\n\n $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendPlacedOrderEmail(\n $emailTempVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n\t \n\t \n if($order->getEntityId())\n\t\t {\n // $result['order_id']= $order->getRealOrderId();\n\t\t \n\t\t \n/* \t\t $quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t $result_result = $connection->fetchAll($quote_sql);\n\t\t print_r($result_result); */\n\t\t\t\tif(!empty($result_result_cart))\n\t\t\t\t{\n\t\t\t\t\t $quoteId3=$result_result_cart[0]['entity_id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($quoteId3==$quoteId)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $quote_sql3 = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 and entity_id !=$quoteId3\";\n\t\t\t\t\t\t\t\t $result_result3 = $connection->fetchAll($quote_sql3);\n\t\t\t\t\t\t\t\t if(!empty($result_result3))\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t foreach ($result_result3 as $qt)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t$qtid=$qt['entity_id'];\n\t\t\t\t\t\t\t\t\t\t $quote_sql = \"delete FROM quote where entity_id=$qtid \";\n\t\t\t\t\t\t\t\t\t\t $connection->rawQuery($quote_sql); \n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t$quote_sql2 = \"Select * FROM quote_item where quote_id=$quoteId limit 1\";\n\t\t\t\t\t\t\t\t $result_result2 = $connection->fetchAll($quote_sql2);\n\t\t\t\t\t\t\t\t\t//print_r($result_result2);\n\t\t\t\t\t\t\t\t\tif(!empty($result_result2))\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t\t\t\t\t\t\t\t$checkoutSession->setQuoteId($quoteId3);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result2[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t$quote_item_productid=$result_result2[0]['product_id'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$quote_sql24 = \"Select * FROM quote_item where quote_id=$quoteId3 and product_id=$quote_item_productid\";\n\t\t\t\t\t\t\t\t $result_result24 = $connection->fetchAll($quote_sql24);\n\t\t\t\t\t\t\t\t\t\tif(!empty($result_result24))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result24[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();//instance of object manager\n\t\t\t\t\t\t\t\t\t\t\t$itemModel = $objectManager->create('Magento\\Quote\\Model\\Quote\\Item');//Quote item mode\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem=$itemModel->load($quote_item_id);//load particular item which you want to delete by his item id\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem->delete();//deletes the item\n\t\t\t\t\t\t\t\t\t\t\t$this->cart->removeItem($quote_item_id);\n\t\t\t\t\t\t\t\t\t\t $this->cart->save();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n }else{\n $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n } \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t // $result[]=array('satus'=>'error');\n\t\t \n\t\t \n\t\t \n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\t\t\t\n\t\t\n \t\t\t\n\t return $result; \n\t\n\t }", "public function get_payment_details($order)\n {\n $raw_response = wp_safe_remote_get(\n $this->endpoint . '/charges/' . $order->get_order_key(),\n array(\n 'method' => 'GET',\n 'timeout' => 30,\n 'user-agent' => 'WooCommerce/' . WC()->version,\n 'headers' => array(\n 'Content-Type' => 'application/json;',\n 'Authorization' => 'Bearer ' . $this->gateway->get_option('api_token')\n ),\n 'httpversion' => '1.1',\n )\n );\n\n WC_Gateway_Orangepay::log('Orangepay - get_payment_details() response: ' . wc_print_r($raw_response, true));\n\n if (isset($raw_response['body']) && ($response = json_decode($raw_response['body'], true))) {\n if (isset($response['data'])) {\n $data = $response['data'];\n if (isset($data['charge'])) {\n return $data['charge'];\n }\n }\n }\n\n return null;\n }", "function _prePayment( $data )\n {\n\t\t// prepare the payment form\n $vars = new JObject();\n \n $vars->ssl_merchant_id = $this->params->get('ssl_merchant_id', '');\n $vars->ssl_user_id = $this->params->get('ssl_user_id', '');\n $vars->ssl_pin = $this->params->get('ssl_pin', '');\n $vars->test_mode = $this->params->get('test_mode', '0');\n\t\t$vars->merchant_demo_mode = $this->params->get('merchant_demo_mode', '0');\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n \n\t\t$vars->ssl_customer_code = JFactory::getUser()->id;\n $vars->ssl_invoice_number = $data['orderpayment_id'];\n $vars->ssl_description = JText::_('Order Number: ').$data['order_id'];\n \n // Billing Info\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->address_1 = $data['orderinfo']->billing_address_1;\n $vars->address_2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip \t\t= $data['orderinfo']->billing_postal_code;\n \n $vars->amount = @$data['order_total'];\n\n\t\tif ($vars->merchant_demo_mode == 1)\n\t\t{\n\t\t\t$vars->payment_url = \"https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars->payment_url = \"https://www.myvirtualmerchant.com/VirtualMerchant/process.do\";\n\t\t}\n\n\t\tif ( $vars->inline_creditcard_form == 0)\n\t\t{\n\t\t\t$vars->receipt_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->failed_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$html = $this->_getLayout('prepayment', $vars);\n\t\t}\n\t\telseif ( $vars->inline_creditcard_form == 1)\n\t\t{\n\t\t\t$vars->action_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->order_id\t = $data['order_id'];\n\t\t\t$html = $this->_getLayout('paymentcreditcard', $vars);\n\t\t}\n\n return $html;\n }", "function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}", "public function customcheckoutdirect($userid,$productid,$price,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteid)\n\t {\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>$productid,'qty'=>1,'price'=>$price]\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\t\n\t\t\t\n\t\t\t\n\t\t/* \t $store=$this->_storeManager->getStore();\n $websiteId = $this->_storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n $customer->loadByEmail($orderData['email']);// load customet by email address\n if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\n\t $quote = $this->quote->create()->load($quoteid);\n $quote=$this->quote->create(); //Create object of quote\n $quote->setStore($store); //set store for which you create quote\n // if you have allready buyer id then you can load customer directly \n $customer= $this->customerRepository->getById($customer->getEntityId());\n $quote->setCurrency();\n $quote->assignCustomer($customer); //Assign quote to customer\n \n //add items in quote\n foreach($orderData['items'] as $item){\n $product=$this->_product->load($item['product_id']);\n $product->setPrice($item['price']);\n $quote->addProduct(\n $product,\n intval($item['qty'])\n );\n }\n \n //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress();\n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n ->setShippingMethod('freeshipping_freeshipping'); //shipping method\n $quote->setPaymentMethod('cashondelivery'); //payment method\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n $quote->getPayment()->importData(['method' => 'cashondelivery']);\n \n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n //$quoteid=$quote->getId();\n\t\t // $result['quoteid']= $quoteid;\n\t\t $quoteid=$quote->getId();\n\t\t /* if($quoteid)\n\t\t {\n\t\t\t $result['quoteid']= $quoteid;\n\t\t }\n\t\t else\n\t\t {\n\t\t\t $result=['error'=>1,'msg'=>'Your custom message'];\n\t\t } */\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t\t\n\t\t\n\t\t\n\t\t$increment_id = $order->getRealOrderId();\n \n\t\tif($order->getEntityId()){\n // $result['order_id']= $order->getRealOrderId();\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n }else{\n $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n } \n return $result;\n\t\t\t \n\t\t\t\n\t\n\t }", "public function bookingcustomcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts);\n\t\tif($firstname=='')\n\t\t{\n\t\t\t$firstname='@';\n\t\t} */\n\t\t\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t\n\t\t//exit;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>'5','qty'=>1,'price'=>'50'],\n\t\t\t\t\t\t ['product_id'=>'6','qty'=>2,'price'=>'100']\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\n\n /*for sote 4 */\t\t\t\n\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t $helper = $objectManager->get('Webkul\\Marketplace\\Helper\\Data');\n\t\t $helper->setCurrentStore(4); \n\t\t /* end for sote 4 */\n\t\t\n\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\t\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t\n\t\t/* $quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=4 and is_active=1 order by entity_id ASC limit 1\";\n\t\t$result_result_cart = $connection->fetchAll($quote_sql_latest); */\n\t\t // print_r($result_result_cart); \n\t\t\n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=4 and entity_id='$quoteId' and is_active=1\";\n\t\t\n\t\t\n\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\tif(!empty($result_result))\n\t\t{\n\t\t\n\t\t\t $quoteId2=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId2);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId2);\n\t\t \n\t\t \n\t\t //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress(); \n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n //->setShippingMethod('freeshipping_freeshipping'); //shipping method\n\t\t\t\t\t\t->setShippingMethod($shipping); //shipping method\n\t\t\t\t\t\t\n //$quote->setPaymentMethod('cashondelivery'); //payment method\n\t\t$quote->setPaymentMethod($payment);\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n //$quote->getPayment()->importData(['method' => 'cashondelivery']);\n $quote->getPayment()->importData(['method' => $payment]);\n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n $quote->getId();\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t //$order->setEmailSent(1);\n echo $increment_id = $order->getRealOrderId();\n\t $lastOrderId = $increment_id;\n\t\t\n\t\t$helper = $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Data'\n );\n\t\t\n\t\t$getProductSalesCalculation = $objectManager->get(\n 'Webkul\\Marketplace\\Observer\\SalesOrderPlaceAfterObserver'\n );\n $getProductSalesCalculation->getProductSalesCalculation($order); \n\t \n\t \n\t \n\t \n\t \n\t\t\t if($order->getEntityId())\n\t\t\t {\n\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>$lastOrderId));\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t\t} \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\t\t\t\n\t\t\n \t\t\t\n\t return $result; \n\t\n\t }", "public function init()\r\n { \r\n\t\ttry\r\n\t\t{ \r\n $orderNumber = addslashes( $_GET['order_number'] ) ? : null;\r\n if ( is_null( $orderNumber) ) { return; }\r\n \r\n $table = new Application_Subscription_Checkout_Order();\r\n if( ! $orderInfo = $table->selectOne( null, array( 'order_id' => $orderNumber ) ) )\r\n {\r\n return false;\r\n }\r\n //var_export( $orderInfo );\r\n if( ! is_array( $orderInfo['order'] ) )\r\n {\r\n //\tcompatibility\r\n $orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n }\r\n //$orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n $orderInfo['total'] = 0;\r\n\r\n foreach( $orderInfo['order']['cart'] as $name => $value )\r\n {\r\n if( ! isset( $value['price'] ) )\r\n {\r\n $value = array_merge( self::getPriceInfo( $value['price_id'] ), $value );\r\n }\r\n $orderInfo['total'] += $value['price'] * $value['multiple'];\r\n //$counter++;\r\n }\r\n\r\n $secretKey = Paypal_Settings::retrieve( 'secret_key' );\r\n\r\n // var_Export( $secretKey );\r\n\r\n $result = array();\r\n\r\n //The parameter after verify/ is the transaction reference to be verified\r\n $url = 'https://api.sandbox.paypal.com/v2/checkout/orders/' . $_REQUEST['ref'];\r\n echo $url;\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']\r\n );\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $secretKey ]\r\n );\r\n $request = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n if ( $request ) {\r\n $result = json_decode($request, true);\r\n }\r\n\r\n //Use the $result array\r\n var_export( $request );\r\n \r\n //\tconfirm status\r\n /* var_export( ! empty( $result['Error'] ) );\r\n var_export( @$result['StatusCode'] !== '00' );\r\n var_export( @$result['Amount'] != @$orderInfo['total'] );\r\n var_export( @$result['Amount'] );\r\n var_export( @$orderInfo['total'] );\r\n var_export( @$result['AmountIntegrityCode'] !== '00' );\r\n */\t\t\r\n if( empty( $result['status'] ) )\r\n {\r\n //\tPayment was not successful.\r\n $orderInfo['order_status'] = 'Payment Failed';\r\n }\r\n else\r\n {\r\n $orderInfo['order_status'] = 'Payment Successful';\r\n }\r\n\r\n //var_export( $orderInfo );\r\n $orderInfo['order_random_code'] = $_REQUEST['ref'];\r\n $orderInfo['gateway_response'] = $result;\r\n\r\n //var_export( $orderNumber );\r\n\r\n self::changeStatus( $orderInfo );\r\n //$table->update( $orderInfo, array( 'order_id' => $orderNumber ) );\r\n\r\n //$response = new SimpleXMLElement(file_get_contents($url));\r\n\r\n //var_export( $orderInfo );\r\n //var_export( $result );\r\n\r\n //\tCode to change check status goes heres\r\n //\tif( )\r\n return $orderInfo;\r\n\t\t} \r\n\t\tcatch( Exception $e )\r\n { \r\n // Alert! Clear the all other content and display whats below.\r\n // $this->setViewContent( '<p class=\"badnews\">' . $e->getMessage() . '</p>' ); \r\n // $this->setViewContent( '<p class=\"badnews\">Theres an error in the code</p>' ); \r\n // return false; \r\n }\r\n\t}", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "function process_orders($orders)\n{\n $display = '';\n\n $order_instance = new Order();\n $item_instance = new Item();\n $fulfillment_instance = new Fulfillment();\n\n\n $order_count = 0;\n\n foreach ($orders as $o) {\n $order_count++;\n /** ------------\n * PARSE ORDERS\n * ------------ */\n $order_shopify_id = $o['id'];\n log_error('order_shopify_id: ' . $order_shopify_id);\n\n $customer_email = trim($o['email']);\n $customer_phone = (!empty($o['shipping_address']['phone'])) ? trim(strval($o['shipping_address']['phone'])) : trim(strval($o['billing_address']['phone']));\n $order_tcreate = date(\"Y-m-d H:i:s\", strtotime($o['created_at']));\n $order_tmodified = !empty($o['updated_at'])?date(\"Y-m-d H:i:s\", strtotime($o['updated_at'])):null;\n $order_tclose = !empty($o['closed_at'])?date(\"Y-m-d H:i:s\", strtotime($o['closed_at'])):null;\n $order_is_closed = empty($o['closed_at']) ? true : false;\n $order_total_cost = $o['total_price'];\n $order_receipt_id = $o['name'];\n $order_currency = $o['currency'];\n $order_vendor = '';\n $order_alert_status = NOTIFICATION_STATUS_NONE;\n\n\n\n\n\n\n if (!empty($o['gateway'])) {\n if (stripos($o['gateway'], 'stripe') > -1) $order_gateway = GATEWAY_PROVIDER_STRIPE;\n elseif (stripos($o['gateway'], 'paypal') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n elseif (stripos($o['gateway'], 'shopify_payments') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n else $order_gateway = GATEWAY_PROVIDER_UNKNOWN;\n }\n\n $order_fulfillment_status = $o['fulfillment_status'];\n $order_is_dropified = (!empty($o['note']) && stripos($o['note'], 'dropified') > -1 );\n \n /**\n * Check if note has 'Aliexpress' or 'Dropified'.\n * \n * If has then: \n * - get events related to order\n * - check if Dropified created fulfillments\n * - return array of ids of fulfillments created by Dropified\n * \n * If not then:\n * - return empty array\n * \n * Added by Rafal - 2018-03-13\n */\n \n $dropified_fulfillmets_ids = (stripos($o['note'], 'dropified') > -1 || stripos($o['note'], 'aliexpress') > -1)?getDropifiedEvents(getOrderEvents($order_shopify_id)):array();\n \n /** --------------\n * PARSE CUSTOMER\n * -------------- */\n $order_customer_fn = $o['shipping_address']['first_name'];\n $order_customer_ln = $o['shipping_address']['last_name'];\n $order_customer_address1 = $o['shipping_address']['address1'];\n $order_customer_address2 = $o['shipping_address']['address2'];\n $order_customer_city = $o['shipping_address']['city'];\n $order_customer_zip = $o['shipping_address']['zip'];\n $order_customer_province = $o['shipping_address']['province'];\n $order_customer_country_code = $o['shipping_address']['country_code'];\n $order_customer_province_code = $o['shipping_address']['province_code'];\n $order_customer_phone = $o['shipping_address']['phone'];\n $order_tags = strtolower($o['tags']);\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n $order_customer_billing_fn = $o['billing_address']['first_name'];\n $order_customer_billing_ln = $o['billing_address']['last_name'];\n $order_customer_billing_address1 = $o['billing_address']['address1'];\n $order_customer_billing_address2 = $o['billing_address']['address2'];\n $order_customer_billing_city = $o['billing_address']['city'];\n $order_customer_billing_zip = $o['billing_address']['zip'];\n $order_customer_billing_province = $o['billing_address']['province'];\n $order_customer_billing_country_code = $o['billing_address']['country_code'];\n $order_customer_billing_province_code = $o['billing_address']['province_code'];\n $order_customer_billing_phone = $o['billing_address']['phone'];\n\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n $order_tcancel = !empty($o['cancelled_at'])?date(\"Y-m-d H:i:s\", strtotime($o['cancelled_at'])):'0000-00-00 00:00:00';\n\n\n $order_is_ocu = (stripos($order_tags,'ocu') > -1)?1:0;\n\n $_refund_status = trim($o['financial_status']);\n\n //print 'REFUND STATUS: ' . $_refund_status . PHP_EOL;\n\n switch(strtolower($_refund_status))\n {\n case 'partially_refunded':\n $order_refund_status = 2;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n case 'refunded':\n $order_refund_status = 1;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n default: case 'paid':\n $order_refund_status = 0;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n }\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n \n $_financial_status = trim($o['financial_status']);\n \n switch(strtolower($_financial_status))\n {\n case 'pending':\n $order_financial_status = 1;\n break;\n case 'authorized':\n $order_financial_status = 2;\n break;\n case 'partially_paid':\n $order_financial_status = 3;\n break;\n case 'paid':\n $order_financial_status = 4;\n break;\n case 'partially_refunded':\n $order_financial_status = 5;\n break;\n case 'refunded':\n $order_financial_status = 6;\n break;\n case 'voided':\n $order_financial_status = 7;\n break;\n default: case '':\n $order_financial_status = 0;\n break;\n }\n \n $order_is_fulfilled = false; //has the fulfillment process started or not\n $order_is_delivered = false; //has the order been completed and delivered\n $order_is_tracking = false; //whether we should track the order\n\n $order_array = Array(\n 'order_customer_email' => $customer_email,\n 'order_customer_fn' => $order_customer_fn,\n 'order_customer_ln' => $order_customer_ln,\n 'order_customer_address1' => $order_customer_address1,\n 'order_customer_address2' => $order_customer_address2,\n 'order_customer_city' => $order_customer_city,\n 'order_customer_country' => $order_customer_country_code,\n 'order_customer_province' => $order_customer_province,\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n 'order_customer_billing_fn'=> $order_customer_billing_fn,\n 'order_customer_billing_ln'=> $order_customer_billing_ln,\n 'order_customer_billing_address1'=> $order_customer_billing_address1,\n 'order_customer_billing_address2'=> $order_customer_billing_address2,\n 'order_customer_billing_city'=> $order_customer_billing_city,\n 'order_customer_billing_zip'=> $order_customer_billing_zip,\n 'order_customer_billing_province'=> $order_customer_billing_province,\n 'order_customer_billing_country'=> $order_customer_billing_country_code,\n 'order_customer_billing_phone'=> $order_customer_billing_phone,\n\n 'order_currency' => $order_currency,\n 'order_tags' => $order_tags,\n 'order_is_ocu'=>$order_is_ocu,\n 'order_customer_zip' => $order_customer_zip,\n 'order_customer_phone' => $customer_phone,//$order_customer_phone,\n 'order_fulfillment_status' => $order_fulfillment_status,\n 'order_is_refunded' => $order_refund_status,\n 'order_shopify_id' => $order_shopify_id,\n 'order_gateway' => $order_gateway,\n 'order_receipt_id'=>$order_receipt_id,\n 'order_total_cost' => $order_total_cost,\n 'order_topen' => $order_tcreate,\n 'order_tclose' => $order_tclose,\n\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n 'order_financial_status' => $order_financial_status,\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n 'order_tcancel' => $order_tcancel,\n\n );\n \n /** ----------------------------------------\n * _ORDER_ARRAY - ADDED BY RAFAL 2018-03-20\n * \n * This is added to update only order if \n * is cancel order status\n * --------------------------------------- */\n \n\n /** -----------------------------------\n * LOOKUP ORDERS BY SHOPIFY'S ORDER ID\n * ----------------------------------- */\n if (isset($order_object)) unset($order_object);\n $order_object = $order_instance->fetch_order_by_order_shopify_id($order_shopify_id);\n \n /** ------------------------------\n * IF IT DOESN'T EXIST, CREATE IT\n * ------------------------------ */\n if (!$order_object) {\n $order_object = new Order($order_array);\n $order_id = $order_object->save();\n } else {\n $order_id = $order_object->id;\n }\n\n\n /** --------------------------\n * PARSE REFUNDED LINE ITEMS\n * ------------------------- */\n\n\n\n if(!empty($o['refunds']))\n {\n $refund_list = Array();\n $refund_check = Array();\n foreach($o['refunds'] as $refund)\n {\n $refund_date =date(\"Y-m-d H:i:s\", strtotime($refund['created_at']));\n foreach($refund['refund_line_items'] as $item)\n {\n $refund_list[$item['line_item_id']]=$refund_date;\n $refund_check[] = $item['line_item_id'];\n }\n }\n //print 'refund! ' . print_r($refund_list,true);\n //print 'refund! ' . print_r($refund_check,true);\n }\n\n\n\n\n /** ----------------\n * PARSE LINE ITEMS\n * ---------------- */\n\n foreach ($o['line_items'] as $p) {\n $_fulfillment_status = $p['fulfillment_status'];\n switch(strtolower($_fulfillment_status))\n {\n case 'fulfilled': $item_fulfillment_status = 1;break;\n case 'partial': $item_fulfillment_status = 2; break;\n default: case null: $item_fulfillment_status = 0;break;\n }\n $item_shopify_id = $p['id'];\n $item_shopify_product_id = $p['product_id'];\n $item_shopify_variant_id = $p['variant_id'];\n $item_name = $p['name'];\n $item_quantity = $p['quantity'];\n $item_sku = $p['sku'];\n $item_price = $p['price'];\n $item_is_refunded = 0;\n //$item_refund_tcreate = null;\n if(!empty($o['refunds'])) {\n if (in_array(trim($item_shopify_id), $refund_check)) {\n $item_is_refunded = 1;\n $item_refund_tcreate = $refund_list[$item_shopify_id];\n //print 'FOUND REFUND!';\n }\n }\n\n $item_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'item_shopify_id' => $item_shopify_id,\n 'item_quantity' => $item_quantity,\n 'item_sku' => $item_sku,\n 'item_price'=>floatval($item_price),\n 'item_shopify_product_id' => $item_shopify_product_id,\n 'item_shopify_variant_id' => $item_shopify_variant_id,\n 'item_name' => $item_name,\n 'item_is_refunded' => $item_is_refunded,\n 'item_is_fulfilled'=>$item_fulfillment_status\n );\n\n if(isset($item_refund_tcreate)) $item_array['item_refund_tcreate']=$item_refund_tcreate;\n\n /** -------------------------\n * STORE / UPDATE LINE ITEMS\n * ------------------------- */\n if (isset($item_object)) unset($item_object);\n\n $item_object = $item_instance->fetch_item_by_shopify_item_id($item_shopify_id);\n if (!$item_object) {\n $item_object = new Item($item_array);\n $item_id = $item_object->save();\n } else {\n $item_id = $item_object->id;\n $item_object->save($item_array);\n }\n $order_object->order_items[] = $item_object;\n\n }\n\n\n /** ------------\n * FULFILLMENTS\n * ------------ */\n if (!empty($o['fulfillments'])) {\n foreach ($o['fulfillments'] as $fulfillment) {\n \n \n /**\n * Added by Rafal 2018-04-12\n * \n * Prevent added cancelled, error or failure\n * fulfillments\n */\n if($fulfillment['status'] == 'cancelled' || $fulfillment['status'] == 'error' || $fulfillment['status'] == 'failure'){\n continue;\n }\n \n \n $fulfillment_shopify_id = $fulfillment['id'];\n $fulfillment_shipment_status = strtolower(trim($fulfillment['shipment_status']));\n $fulfillment_topen = date(\"Y-m-d H:i:s\", strtotime($fulfillment['created_at']));\n //$fulfillment_tmodified = date(\"Y-m-d H:i:s\", strtotime($fulfillment['updated_at']));\n \n $fulfillment_tracking_company = strtolower($fulfillment['tracking_company']);\n \n $fulfillment_tracking_number = $fulfillment['tracking_number'];\n $fulfillment_tracking_url = $fulfillment['tracking_url'];\n\n $order_is_fulfilled = true;\n\n\n $fulfillment_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'fulfillment_shipment_status' => trim(strtolower($fulfillment_shipment_status)),\n 'fulfillment_topen'=>$fulfillment_topen,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'fulfillment_tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_tracking_company' => $fulfillment_tracking_company,\n 'fulfillment_tracking_url' => $fulfillment_tracking_url,\n 'order_is_fulfilled' => $order_is_fulfilled,\n );\n \n if ($fulfillment_tracking_company !== 'usps') $is_tracking = true;\n else $is_tracking = false;\n\n $order_delivery_status = false;\n\n //Normally USPS is the only courier that updates this appropriately. If its delivered set status\n switch ($fulfillment_shipment_status) {\n case 'delivered':\n $order_delivery_status = DELIVERY_STATUS_DELIVERED;\n $order_is_delivered = true;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_delivered_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n break;\n\n case 'confirmed':\n $order_delivery_status = DELIVERY_STATUS_CONFIRMED;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_confirmed_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'in_transit':\n $order_delivery_status = DELIVERY_STATUS_IN_TRANSIT;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_in_transit_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'out_for_delivery':\n $order_delivery_status = DELIVERY_STATUS_OUT_FOR_DELIVERY;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_out_for_delivery_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'failure':\n $order_delivery_status = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_failure_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n $order_array['order_alert_status'] = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_alert_status'] = DELIVERY_STATUS_FAILURE;\n break;\n\n default:\n $order_delivery_status = DELIVERY_STATUS_UNKNOWN;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n\n break;\n }\n/*\n if ($order_delivery_status)\n $order_array['delivery_status'] = $order_delivery_status;*/\n \n \n /**\n * 'status_delivered_tcreate'=>'',\n * 'status_confirmed_tcreate'=>'',\n * 'status_in_transit_tcreate'=>'',\n * 'status_out_for_delivery_tcreate'=>'',\n * 'status_failure_tcreate'=>'',\n * 'status_not_found_tcreate'=>'',\n * 'status_customer_pickup_tcreate'=>'',\n * 'status_alert_tcreate'=>'',\n * 'status_expired_tcreate'=>'',\n */\n /** -----------------------------------\n * CREATE AND STORE FULFILLMENT OBJECT\n * ----------------------------------- */\n \n //Lets see if the order exists\n if (isset($fulfillment_object)) unset($fulfillment_object);\n\n $fulfillment_object = $fulfillment_instance->fetch_fulfillment_by_shopify_fulfillment_id($fulfillment_shopify_id);\n\n\n if (!$fulfillment_object) {\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n $fulfillment_object = new Fulfillment($fulfillment_array);\n $fulfillment_object->save();\n\n } else {\n\n if($fulfillment_object->tracking_number == \"\" || $fulfillment_object->tracking_number == null)\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n\n $fulfillment_object->save($fulfillment_array);\n }\n \n $order_object->order_fulfillments[] = $fulfillment_object;\n \n \n /** Added by Rafal - 2018-03-13 */\n if(sizeof($dropified_fulfillmets_ids) > 0 && in_array($fulfillment_shopify_id,$dropified_fulfillmets_ids) === true){\n $dropified_array = Array(\n 'tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'order_id' => $order_id,\n 'vendor_id' => VENDOR_DROPIFIED,\n 'order_receipt_id'=>$order_receipt_id,\n 'tracking_tcreate' => current_timestamp(),\n 'tracking_tmodified'=>current_timestamp()\n );\n set_dropified_tracking($dropified_array);\n }\n }\n\n /** -----------------------\n * UPDATE THE ORDER OBJECT\n * ----------------------- */\n $order_object->save($order_array);\n } else {\n /** -------------------------------------\n * ADDED BY RAFAL 2018-03-20\n * \n * This allow to update cancell date and\n * financial status if it is different\n * than in table\n * ------------------------------------- */\n $cancel_array = Array();\n \n if(isset($order_object -> financial_status) && $order_object -> financial_status != $order_financial_status){\n $cancel_array['order_financial_status'] = $order_financial_status;\n }\n \n if(isset($order_object -> tcancel) && $order_object -> tcancel != $order_financial_status){\n $cancel_array['order_tcancel'] = $order_tcancel;\n }\n \n if (sizeof($cancel_array) > 0) {\n \n $db_conditions = Array('order_id' => $order_id);\n \n if (isset($db_instance)) unset($db_instance); \n $db_instance = new Database;\n $db_instance -> db_update('orders',$cancel_array,$db_conditions,$isOr=false);\n }\n }\n\n if ($order_count >= ORDER_COUNT_LIMIT_MANUAL && ORDER_COUNT_LIMIT_MANUAL != 0) exit('ORIGINAL DATA: ' . PHP_EOL . print_r($order_count, true));\n\n }\n log_error('total orders: ' . $order_count);\n\n\n}", "function getOrderPurchaseDetails($order_id)\n\t\t{\n\t\t\t//get order details\n\t\t\t$orders = $this->_BLL_obj->manage_content->getValue_where('order_info', '*', 'order_id', $order_id);\n\t\t\t$user_id = $orders[0]['user_id'];\n\t\t\t//get product details from order id\n\t\t\t$order_details = $this->_BLL_obj->manage_content->getValue_where('product_inventory_info', '*', 'order_id', $order_id);\n\t\t\tif(!empty($order_details[0]))\n\t\t\t{\n\t\t\t\t//total_overridng fee distributed\n\t\t\t\t$dis_over = 0;\n\t\t\t\t$user_level = 0;\n\t\t\t\t\n\t\t\t\tforeach($order_details as $order)\n\t\t\t\t{\n\t\t\t\t\t/* code for distribute overriding fee */\n\t\t\t\t\t//get transaction id for overriding fee\n\t\t\t\t\t$over_id = uniqid('trans');\n\t\t\t\t\t//calling overriding fee function\n\t\t\t\t\t$distributed_overriding = $this->distributeOverridingFee($user_id, $order['price'], $dis_over, $user_level, $over_id,$order_id);\n\t\t\t\t\tif($distributed_overriding != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_over = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($over_id,$order_id,$order['product_id'],'OF'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value = $this->getSystemMoneyValue() - $distributed_overriding;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_dist_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($over_id,$distributed_overriding,$new_system_value));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for personal commision calculation */\n\t\t\t\t\t//get transaction id for personal comm calculation\n\t\t\t\t\t$per_id = uniqid('trans');\n\t\t\t\t\t//calling personal commision function\n\t\t\t\t\t$per_comm = $this->calculatePersonalCommision($user_id, $order['price'], $per_id,$order_id);\n\t\t\t\t\t//checking for non empty personal commision\n\t\t\t\t\tif($per_comm != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t\t$insert_personal = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($per_id,$order_id,$order['product_id'],'PC'));\n\t\t\t\t\t\t//new system value\n\t\t\t\t\t\t$new_system_value_per = $this->getSystemMoneyValue() - $per_comm;\n\t\t\t\t\t\t//insert distributed amount to system money info\n\t\t\t\t\t\t$insert_per_amount = $this->_BLL_obj->manage_content->insertValue('system_money_info', array('specification','debit','system_balance'), array($per_id,$per_comm,$new_system_value_per));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* code for point value calculation */\n\t\t\t\t\t//get transaction id for point value distribution\n\t\t\t\t\t$pv_id = uniqid('trans');\n\t\t\t\t\t//get product details\n\t\t\t\t\t$product_details = $this->_BLL_obj->manage_content->getValue_where('product_info', '*', 'product_id', $order['product_id']);\n\t\t\t\t\t//total point value\n\t\t\t\t\t$total_pv = $product_details[0]['point_value'] * $order['quantity'];\n\t\t\t\t\t//insert values to fee transaction info table\n\t\t\t\t\t$insert_point = $this->_BLL_obj->manage_content->insertValue('fee_transaction_info', array('transaction_id','order_id','product_id','fee_type'), array($pv_id,$order_id,$order['product_id'],'PV'));\n\t\t\t\t\t//insert pv to system\n\t\t\t\t\t$system_pv = $this->insertSystemPV($pv_id, $total_pv);\n\t\t\t\t\t//calling point value distributive function\n\t\t\t\t\t$this->distributePointValue($user_id, $total_pv, $pv_id, $order_id);\n\t\t\t\t\t\n\t\t\t\t\t/* code for member level upgradation of user and their parent */\n\t\t\t\t\t//calling fucntion for it\n\t\t\t\t\t$this->checkingLevelOfUserAndParent($user_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function finishAction()\n {\n // if the user has not logged in, login fristly\n if (!$this->session['sUserId']){\n return $this->forward('login', 'account', null, array(\n 'sTarget' => 'paymentpilipay',\n 'sTargetAction' => 'finish',\n 'sUseSSL' => true,\n ));\n }\n\n Shopware()->Modules()->Basket()->sRefreshBasket();\n\n $orderNo = intval($this->Request()->getParam('orderNo'));\n if (!$orderNo){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n if (!is_object($this->session['sOrderVariables'])){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view = $this->View();\n $view->assign($this->session['sOrderVariables']->getArrayCopy());\n if ($orderNo != $view->sOrderNumber){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n // fetch order data\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n /**@var $order Shopware\\Models\\Order\\Order */\n $order = $builder->getQuery()->getOneOrNullResult();\n if (!$order){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view->sOrderNumber = $order->getNumber();\n $view->sTransactionnumber = $order->getTransactionId();\n $view->sPayment = array(\n 'description' => $order->getPayment()->getDescription() ?: $order->getPayment()->getName()\n );\n\n// $view->sDispatch = null;\n\n // fetch user data\n $userData = $view->sUserData;\n $userData['shippingaddress'] = array(\n 'company' => '',\n 'salutation' => 'mr',\n 'firstname' => $userData['shippingaddress']['firstname'],\n 'lastname' => $userData['shippingaddress']['lastname'],\n 'street' => '(最终的收货地址是您在霹雳爸爸上所填写的地址)',\n );\n $userData['additional'] = null;\n $view->sUserData = $userData;\n\n\n return $view->loadTemplate('frontend/checkout/finish.tpl');\n }", "function ciniki_sapos_web_paypalExpressCheckoutGet(&$ciniki, $tnid, $args) {\n\n //\n // Load paypal settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', 'paypal');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['settings']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.181', 'msg'=>'Paypal processing not configured'));\n }\n $paypal_settings = $rc['settings'];\n\n if( isset($paypal_settings['paypal-ec-site']) && $paypal_settings['paypal-ec-site'] == 'live' ) {\n $paypal_endpoint = \"https://api-3t.paypal.com/nvp\";\n $paypal_redirect_url = \"https://www.paypal.com/webscr?cmd=_express-checkout\";\n } elseif( isset($paypal_settings['paypal-ec-site']) && $paypal_settings['paypal-ec-site'] == 'sandbox' ) {\n $paypal_endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n $paypal_redirect_url = \"https://www.sandbox.paypal.com/webscr?cmd=_express-checkout\";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.182', 'msg'=>'Paypal processing not configured'));\n }\n\n if( !isset($paypal_settings['paypal-ec-clientid']) || $paypal_settings['paypal-ec-clientid'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.183', 'msg'=>'Paypal processing not configured'));\n }\n if( !isset($paypal_settings['paypal-ec-password']) || $paypal_settings['paypal-ec-password'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.184', 'msg'=>'Paypal processing not configured'));\n }\n if( !isset($paypal_settings['paypal-ec-signature']) || $paypal_settings['paypal-ec-signature'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.185', 'msg'=>'Paypal processing not configured'));\n }\n\n $paypal_clientid = $paypal_settings['paypal-ec-clientid'];\n $paypal_password = $paypal_settings['paypal-ec-password'];\n $paypal_signature = $paypal_settings['paypal-ec-signature'];\n\n //\n // Get the paypal token to start the express checkout process\n //\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $paypal_endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n //turning off the server and peer verification(TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n $nvpreq=\"METHOD=GetExpressCheckoutDetails\"\n . \"&VERSION=93\"\n . \"&PWD=\" . $paypal_password \n . \"&USER=\" . $paypal_clientid\n . \"&SIGNATURE=\" . $paypal_signature\n . \"&TOKEN=\" . urlencode($args['token'])\n . \"\";\n \n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Execute\n $response = curl_exec($ch);\n\n // Parse response\n $nvpResArray = array();\n $kvs = explode('&', $response);\n foreach($kvs as $kv) {\n list($key, $value) = explode('=', $kv);\n $nvpResArray[urldecode($key)] = urldecode($value);\n }\n\n if( curl_errno($ch)) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.186', 'msg'=>'Error processing request: ' . curl_error($ch)));\n } else {\n curl_close($ch);\n }\n if( strtolower($nvpResArray['ACK']) == 'success' || strtolower($nvpResArray['ACK']) == 'successwithwarning' ) {\n $paypal_payer_id = urldecode($nvpResArray['PAYERID']);\n $_SESSION['paypal_payer_id'] = $paypal_payer_id;\n return array('stat'=>'ok');\n } \n\n error_log(\"PAYPAL-ERR: \" . urldecode($nvpResArray['L_ERROCODE0']) . '-' . urldecode($nvpResArray['L_SHORTMESSAGE0']));\n\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.187', 'msg'=>'Oops, we seem to have an error. Please try again or contact us for help. '));\n}", "public function getCheckout()\n\t{\n\t\tMage::log(\" --- Snap* Hosted Payments API : getCheckout --- \");\n\t\treturn Mage::getSingleton('checkout/session');\n\t}", "public function captureInvoice(Varien_Object $payment)\n {\n\n\n $transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()\n ->addAttributeToFilter('order_id', array('eq' => $payment->getOrder()->getEntityId()))->getLastItem();\n $addData = $transaction->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);\n $transaction_id = $addData['transID'];\n\n\n if(empty($transaction_id)){\n $transaction_id = Mage::getSingleton('core/session')->getTransactionID();\n\n }\n if (empty($transaction_id)) {\n Mage::helper('paynovapayment')->log(\"Error. Missing transaction ID from order and cannot do capture.\");\n Mage::throwException(Mage::helper('paynovapayment')->__('Error. Missing transaction ID.'));\n }\n\n\n $invoice = $payment->getCurrentInvoice();\n $transInformation = $payment->getTransaction($transaction_id)->getAdditionalInformation();\n\n\n\n $order_id = $transInformation['raw_details_info']['order_id'];\n $order_number = $transInformation['raw_details_info']['order_number'];\n\n $order = Mage::getModel('sales/order');\n\n $order->loadByIncrementId($order_number);\n\n $res['orderId'] = $order_id;\n $res['transactionId'] = $transaction_id;\n $res['totalAmount'] = $invoice->getGrandTotal();\n $res['invoiceId'] = $transaction_id;\n\n $items = $invoice->getAllItems();\n\n\n $itemcount= count($items);\n $data = array();\n $i=0;\n $linenumber=1;\n\n $unitMeasure = Mage::getStoreConfig('paynovapayment/advanced_settings/product_unit');\n if (empty($unitMeasure)){\n $unitMeasure = \"pcs\";\n }\n $shippingname = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_name');\n if (empty($shippingname)){\n $shippingname = \"Shipping\";\n }\n $shippingsku = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_sku');\n if (empty($shippingsku)){\n $shippingsku = \"Shipping\";\n }\n\n foreach ($items as $itemId => $item)\n {\n\n $orderItem = $item->getOrderItem();\n\n $product = Mage::helper('catalog/product')->getProduct($item->getSku(), Mage::app()->getStore()->getId(), 'sku');\n $productUrl = Mage::getUrl($product->getUrlPath());\n $description = $product->getShortDescription();\n if (empty($description)){\n $description = $orderItem->getName();\n }\n $itemtype = $orderItem->getProductType();\n\n\n $lineqty = intval($item->getQty());\n // if product has parent - get parent qty\n\n\n if ($item->getParentItemID() AND $item->getParentItemID()>0){\n $parentQuoteItem = Mage::getModel(\"sales/quote_item\")->load($item->getParentItemID());\n $parentqty = intval($parentQuoteItem->getQty());\n $lineqty = $lineqty * $parentqty;\n }\n\n\n $lineprice = $orderItem->getPrice();\n $linetax = $orderItem->getTaxPercent();\n $unitAmountExcludingTax = $orderItem->getPrice();\n $linetaxamount = ($lineqty*$lineprice)*($linetax/100);\n $linetotalamount = $lineqty*$unitAmountExcludingTax+$linetaxamount;\n\n\n // If item has discount\n if ($orderItem->getDiscountAmount() AND $orderItem->getDiscountAmount()>0 )\n {\n $linediscountamount = $orderItem->getDiscountAmount();\n $itemdiscount = $linediscountamount/$lineqty;\n $unitAmountExcludingTax = $lineprice-$itemdiscount;\n $linetaxamount = ($lineqty*$unitAmountExcludingTax)*($linetax/100);\n $total1 = $lineqty*$unitAmountExcludingTax;\n $linetotalamount = $total1+$linetaxamount;\n $linetax1 = $lineqty*$unitAmountExcludingTax;\n $linetax2 = $linetax/100;\n $linetaxamount = $linetax1*$linetax2;\n }\n\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($orderItem->getSku(),0,50);\n $res['lineItems'][$itemId]['name'] = $item->getName();\n $res['lineItems'][$itemId]['quantity'] = $lineqty;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = $productUrl;\n\n\n if ($itemtype ==\"bundle\") {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] =0;\n $res['lineItems'][$itemId]['taxPercent'] = 0;\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = 0;\n $res['lineItems'][$itemId]['totalLineAmount'] = 0;\n } else {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($unitAmountExcludingTax,2);\n $res['lineItems'][$itemId]['taxPercent'] = round($linetax,2);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($linetaxamount,2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($linetotalamount,2);\n }\n\n $i++;\n $linenumber++;\n }\n if ($order->getShippingAmount() AND $order->getShippingAmount()>0) {\n $quoteid = $order->getQuoteId();\n $quote = Mage::getModel('sales/quote')->load($quoteid);\n $itemId++;\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($shippingsku,0,50);\n $res['lineItems'][$itemId]['name'] = $shippingname;\n $res['lineItems'][$itemId]['quantity'] = 1;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($order->getShippingAmount(),2);\n $res['lineItems'][$itemId]['taxPercent'] = Mage::helper('paynovapayment')->getShippingTaxPercentFromQuote($quote);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($order->getShippingTaxAmount(),2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($order->getShippingInclTax(),2);\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);;\n }\n\n\n\n $output=$this->setCurlCall($res, '/orders/'.$order_id.'/transactions/'.$transaction_id.'/finalize/'.$res['totalAmount']);\n\n\n $order->save();\n\n $status = $output->status;\n if($status->statusKey == 'PAYMENT_COMPLETED'){\n\n $status->isSuccess = true;\n $output->transactionId = 'Order has been finalized';\n\n }\n\n if($status->isSuccess){\n\n $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);\n\n $order->save();\n\n $payment->setStatus(self::STATUS_APPROVED)\n ->setTransactionId($output->transactionId)\n ->setIsTransactionClosed(0);\n return $status->isSuccess;\n\n }else{\n\n $error=$status->statusMessage;\n\n\n $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,\n Mage::helper('paynovapayment')->__($error)\n );\n $order->save();\n\n Mage::throwException(\"$error\");\n\n $this->_redirect('checkout/onepage');\n\n }\n\n }", "public function preparePayment() {\n\n $order = $this->getOrder();\n $payment = $this->getPaymentModule();\n\n $amount = $order->getTotalAmount();\n $amount = (int) round($amount * 100);\n $orderId = $order->get(\"id\");\n\n $payment->setId($orderId);\n $payment->setCurrency($this->modules->get(\"PadCart\")->currency);\n\n $url = $this->page->httpUrl;\n $payment->setProcessUrl($url . \"process/\" . $orderId . \"/\");\n $payment->setFailureUrl($url . \"fail/\");\n $payment->setCancelUrl($url . \"cancel/\");\n\n $customer = Array();\n $customer['givenName'] = $order->pad_firstname;\n $customer['familyName'] = $order->pad_lastname;\n $customer['streetAddress'] = $order->pad_address;\n $customer['streetAddress2'] = $order->pad_address2;\n $customer['locality'] = $order->pad_city;\n $customer['postalCode'] = $order->pad_postcode;\n $customer['country'] = $order->pad_countrycode;\n $customer['email'] = $order->email;\n $payment->setCustomerData($customer);\n\n foreach ($order->pad_products as $p) {\n $amount = $p->pad_price * 100; // Amount in payment modules always in cents\n if ($this->cart->prices_without_tax) $amount = $amount + ($p->pad_tax_amount * 100 / $p->pad_quantity); // TODO: currently we have only\n $payment->addProduct($p->title, $amount, $p->pad_quantity, $p->pad_percentage, $p->pad_product_id);\n }\n }", "public function customer()\n {\n \n // Sustomer is stil step 0\n $this->set_step(0);\n\n\n\n // You are logged in, you dont have access here\n if($this->current_user)\n {\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n }\n\n\n\n // Check to see if a field is available\n if( $this->input->post('customer') )\n {\n\n $input = $this->input->post();\n switch($input['customer'])\n {\n case 'register':\n $this->session->set_userdata('nitrocart_redirect_to', NC_ROUTE .'/checkout/billing');\n redirect('users/register');\n break;\n case 'guest':\n $this->session->set_userdata('user_id', 0);\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n break;\n default:\n break;\n }\n //more like an system error!\n $this->session->set_flashdata( JSONStatus::Error , 'Invalid selection');\n redirect( NC_ROUTE . '/checkout');\n }\n\n $this->set_step(0);\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('User Account')\n ->build( $this->theme_layout_path . 'customer');\n }", "private function getPaymentInfo()\n {\n $baseUrl = 'http://embeddables.eastus2.cloudapp.azure.com/payment/';\n\n return json_decode(\n file_get_contents(\n $baseUrl . 'payment.json'\n )\n );\n }", "public function execute(\\Magento\\Framework\\Event\\Observer $observer){ \r\n try{\r\n $customer_data = array();\r\n $eventkey = $this->_scopeConfig->getValue('blueshiftconnect/Step1/eventapikey');\r\n $password = '';\r\n $data = array();\r\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n $storeManager = $objectManager->get('\\Magento\\Store\\Model\\StoreManagerInterface');\r\n $baseUrl = $storeManager->getStore()->getBaseUrl();\r\n $order = $observer->getOrder();\r\n $order_details = $order->getData();\r\n $billStreet = $order->getBillingAddress();\r\n $shipStreet = $order->getShippingAddress();\r\n $orders = $order->getAllItems();\r\n $i=0;\r\n $orderRepository = $this->orderRepository->get($order_details['id']);\r\n // $items = $observer->getQuote()->getAllItems();\r\n foreach ($orders as $orderItem) {\r\n $orderItems = $orderItem->getData();\r\n $data['events'][$i]['order_id']=$order_details['id'];\r\n $data['events'][$i]['customer_id']=$order_details['customer_id'];\r\n $data['events'][$i]['ip']=$order_details['remote_ip'];\r\n $data['events'][$i]['event']= \"purchase\"; \r\n $data['events'][$i]['storeUrl']=$baseUrl;\r\n $data['events'][$i]['email']=$order_details['customer_email'];\r\n $data['events'][$i]['products']['sku']=$orderItems['sku'];\r\n $data['events'][$i]['products']['qty']=$orderItems['qty_ordered'];\r\n $data['events'][$i]['products']['price']=$orderItems['price'];\r\n $data['events'][$i]['products']['product_id']=$orderItems['product_id'];\r\n $data['events'][$i]['products']['discounted_price']=$orderItems['original_price'];\r\n $data['events'][$i]['revenue']=$orderRepository->getGrandTotal();\r\n $data['events'][$i]['bill_address']=$billStreet->getData();\r\n $data['events'][$i]['ship_address']=$shipStreet->getData();\r\n $i++;\r\n } \r\n $json_data = json_encode($data);\r\n $path = \"bulkevents\";\r\n $method = \"POST\";\r\n $result = $this->blueshiftConfig->curlFunc($json_data,$path,$method,$password,$eventkey);\r\n if($result['status']== 200){\r\n $this->blueshiftConfig->loggerWrite(\"Order creation: status = ok\",'observer');\r\n }else{\r\n $result = json_encode($result);\r\n $this->blueshiftConfig->loggerWrite(\"Order creation: \".$result,'observer');\r\n } \r\n }catch (\\Exception $e) {\r\n $this->blueshiftConfig->loggerWrite($e->getMessage(),'observer');\r\n }\r\n }", "function _wpsc_paycoingateway_return() {\n\n if ( !isset( $_REQUEST['wpsc_paycoingateway_return'] ) ) {\n return;\n }\n\n // paycoingateway order param interferes with wordpress\n unset($_REQUEST['order']);\n unset($_GET['order']);\n\n if (! isset( $_REQUEST['sessionid'] ) ) {\n return;\n }\n\n global $sessionid;\n\n $purchase_log = new WPSC_Purchase_Log( $_REQUEST['sessionid'], 'sessionid' );\n\n if ( ! $purchase_log->exists() || $purchase_log->is_transaction_completed() )\n return;\n\n $status = 1;\n\n if ( isset( $_REQUEST['cancelled'] ) ) {\n # Unsetting sessionid to show error\n do_action('wpsc_payment_failed');\n $sessionid = false;\n unset ( $_REQUEST['sessionid'] );\n unset ( $_GET['sessionid'] );\n } else {\n $status = WPSC_Purchase_Log::ORDER_RECEIVED;\n $purchase_log->set( 'processed', $status );\n $purchase_log->save();\n wpsc_empty_cart();\n }\n\n}", "protected function getCustomerInfo($customer, $order)\n {\n $email = $customer->getEmail();\n $email = is_string($email) ? htmlentities($email) : '';\n if ($email == \"\") {\n $email = $order['customer_email'];\n }\n\n $first_name = $customer->getFirstname();\n $first_name = is_string($first_name) ? htmlentities($first_name) : '';\n if ($first_name == \"\") {\n $first_name = $order->getBillingAddress()->getFirstname();\n }\n\n $last_name = $customer->getLastname();\n $last_name = is_string($last_name) ? htmlentities($last_name) : '';\n if ($last_name == \"\") {\n $last_name = $order->getBillingAddress()->getLastname();\n }\n\n return ['email' => $email, 'first_name' => $first_name, 'last_name' => $last_name];\n }", "public function getPaymentDetails()\n {\n $ret = $this->response['result']['payment_details'];\n $ret['id'] = $this->getTxnId();\n return $ret;\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "public static function geoCart_payment_choicesProcess()\n {\n //VARIABLES TO SEND\n //sid\n //product_id\n //quantity\n //merchant_order_id\n //demo\n trigger_error('DEBUG TRANSACTION: Top of process 2checkout.');\n $cart = geoCart::getInstance();\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n $user_data = $cart->user_data;\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $due = $invoice->getInvoiceTotal();\n\n if ($due >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n\n $transaction = new geoTransaction();\n $transaction->setGateway(self::gateway_name);\n $transaction->setUser($cart->user_data['id']);\n $transaction->setStatus(0); //for now, turn off until it comes back from paypal IPN.\n $transaction->setAmount(-1 * $due);//set amount that it affects the invoice\n $msgs = $cart->db->get_text(true, 183);\n $transaction->setDescription($msgs[500575]);\n\n $transaction->setInvoice($invoice);\n\n $transaction->save();\n\n $testing = $gateway->get('testing_mode');\n $sid = geoString::specialChars($gateway->get('sid'));\n $responseURL = self::_getResponseURL();\n\n\n //build redirect\n $formdata = $cart->user_data['billing_info'];\n $cc_url = \"https://www.2checkout.com/2co/buyer/purchase?\";\n\n $cc_url .= \"sid=\" . $sid;\n $cc_url .= \"&fixed=Y\";\n $cc_url .= \"&x_receipt_link_url=\" . urlencode($responseURL);\n $cc_url .= \"&cart_order_id=\" . $transaction->getId();\n $cc_url .= \"&total=\" . sprintf(\"%01.2f\", $transaction->getAmount());\n if ($testing) {\n $cc_url .= \"&demo=Y\";\n }\n $cc_url .= \"&card_holder_name=\" . urlencode($formdata['firstname'] . \" \" . $formdata['lastname']);\n $cc_url .= \"&street_address=\" . urlencode($formdata['address'] . \" \" . $formdata['address_2']);\n $cc_url .= \"&city=\" . urlencode($formdata['city']);\n $cc_url .= \"&state=\" . urlencode($formdata['state']);\n $cc_url .= \"&zip=\" . urlencode($formdata['zip']);\n $cc_url .= \"&country=\" . urlencode($formdata['country']);\n $cc_url .= \"&email=\" . urlencode($formdata['email']);\n $cc_url .= \"&phone=\" . urlencode($formdata['phone']);\n $cc_url .= \"&merchant_order_id=\" . $cart->order->getId() . self::ORDER_SEP . $transaction->getId();\n\n //remember URL for debugging if needed\n $transaction->set('cc_url', $cc_url);\n $transaction->save();\n\n //add transaction to invoice\n $invoice->addTransaction($transaction);\n\n //set order to pending\n $cart->order->setStatus('pending');\n\n //stop the cart session\n $cart->removeSession();\n trigger_error('DEBUG TRANSACTION: 2checkout URL: ' . $cc_url);\n require GEO_BASE_DIR . 'app_bottom.php';\n //go to 2checkout to complete\n header(\"Location: \" . $cc_url);\n exit;\n }", "function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) {\r\n $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none';\r\n $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0';\r\n ?>\r\n <div class=\"column-container\">\r\n <div class=\"column\">\r\n <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairsaving\" value=\"<?php esc_attr_e( $fairsaving ); ?>\" class=\"small-text\" />\r\n <p class=\"description\"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n <div class=\"column\">\r\n <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairaddress\" value=\"<?php esc_attr_e( $fairaddress ); ?>\" class=\"medium-text\" />\r\n <p class=\"description\"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n}", "function CreateNewOrder($dom_response_obj)\n{\n global $insert_id, $customer_id, $cart, $sendto, $billto, $payment, $shipping, $order, $cc_id, $shipping_to_class, $languages_id, $currencies;\n $payment = 'googlecheckout';\n // Init all data\n $dom_data_root = $dom_response_obj->document_element();\n $gift_adjustment = $dom_data_root->get_elements_by_tagname(\"gift-certificate-adjustment\");\n $coupon_adjustment = $dom_data_root->get_elements_by_tagname(\"coupon-adjustment\");\n if ( count($coupon_adjustment)==0 ) $coupon_adjustment = $gift_adjustment;\n // coupons type \"free shipping\" pass as gift-certificate - GC feature - coupons apply before shipping & tax, gift - after\n // 2007.03.26 - coupons have type gift-certificate in any case. Module not allow enter gv used only coupons\n if ( count($coupon_adjustment)>0 ) {\n $code_node = $coupon_adjustment[0]->get_elements_by_tagname(\"code\");\n $coupon_code = $code_node[0]->get_content();\n $coupon_query=tep_db_query(\"select coupon_id from \" . TABLE_COUPONS . \" where coupon_type<>'G' AND coupon_code='\".tep_db_input($coupon_code).\"' and coupon_active='Y'\");\n if ( tep_db_num_rows($coupon_query) ) {\n $coupon_result=tep_db_fetch_array($coupon_query);\n if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id');\n $cc_id = $coupon_result['coupon_id'];\n }\n }\n //\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-name\");\n $xml_shipping = $shipping['title'] = $shipping_data[0]->get_content();\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-cost\");\n $shipping['cost'] = $shipping_data[0]->get_content();\n $totaltax_data = $dom_data_root->get_elements_by_tagname(\"total-tax\");\n $xml_tax = $totaltax_data[0]->get_content();\n/*\n$shipping['title'] $shipping['cost'] for correct new order creation\n*/\n\n // get customers data and check them\n $ship = array();\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-shipping-address\");\n $shipping_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $ship['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $ship['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $ship['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $ship['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $ship['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $ship['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $ship['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $ship['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $ship['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $ship['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $ship['postal-code'] = $data[0]->get_content();\n $billing = array();\n unset($customer_data);\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-billing-address\");\n $billing_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $billing['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $billing['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $billing['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $billing['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $billing['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $billing['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $billing['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $billing['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $billing['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $billing['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $billing['postal-code'] = $data[0]->get_content();\n // check customer\nif (defined('GOOGLE_FORCE_TO_USA')) {\n $ship['country-code'] = 'GB';\n $billing['country-code'] = 'GB';\n}\n $check = tep_db_query(\"select customers_id from \" . TABLE_CUSTOMERS . \" where customers_email_address='\" . $ship['email'] . \"' or customers_email_address='\" . $billing['email'] . \"'\");\n list($firstname_ship, $lastname_ship) = split(' ', $ship['contact-name'], 2);\n // get country id and state id for shipping\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $ship['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $ship['region'] . \"'\"));\n $ship['countries_id'] = $country['countries_id'];\n $ship['zone_id'] = (int)$state['zone_id'];\n // get country id and state id for billing\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $billing['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $billing['region'] . \"'\"));\n $billing['countries_id'] = $country['countries_id'];\n $billing['zone_id'] = (int)$state['zone_id'];\n\n list($firstname_bill, $lastname_bill) = split(' ', $billing['contact-name'], 2);\n if(tep_db_num_rows($check) > 0) {\n $customer_id = tep_db_fetch_array($check);\n $customer_id = $customer_id['customers_id'];\n // check addresses and init $billto and $sendto\n $check_sendto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($ship['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_ship) . \"' and entry_lastname='\" . tep_db_input($lastname_ship) . \"' and entry_street_address='\" . tep_db_input($ship['address1']) . ' ' . tep_db_input($ship['address2']) . \"' and entry_postcode='\" . tep_db_input($ship['postal-code']) . \"' and entry_city='\" . tep_db_input($ship['city']) . \"' and entry_state='\" . tep_db_input($ship['region']) . \"' and entry_zone_id='\" . intval($ship['zone_id']) . \"' and entry_country_id='\" . intval($ship['countries_id']) . \"'\");\n if(tep_db_num_rows($check_sendto) > 0) {\n $sendto = tep_db_fetch_array($check_sendto);\n $sendto = $sendto['address_book_id'];\n } else {\n // insert new shipping address\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => (int)$ship['zone_id'],\n 'entry_country_id' => (int)$ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $sendto = tep_db_insert_id();\n }\n $check_billto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($billing['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_bill) . \"' and entry_lastname='\" . tep_db_input($lastname_bill) . \"' and entry_street_address='\" . tep_db_input($billing['address1']) . ' ' . tep_db_input($billing['address2']) . \"' and entry_postcode='\" . tep_db_input($billing['postal-code']) . \"' and entry_city='\" . tep_db_input($billing['city']) . \"' and entry_state='\" . tep_db_input($billing['region']) . \"' and entry_zone_id='\" . (int)$billing['zone_id'] . \"' and entry_country_id='\" . (int)$billing['countries_id'] . \"'\");\n if(tep_db_num_rows($check_billto) > 0) {\n $billto = tep_db_fetch_array($check_billto);\n $billto = $billto['address_book_id'];\n } else {\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => (int)$billing['zone_id'],\n 'entry_country_id' => (int)$billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $billto = tep_db_insert_id();\n }\n } else { // create new customer\n $sql_data_array = array('customers_firstname' => $firstname_ship,\n 'customers_lastname' => $lastname_ship,\n 'customers_email_address' => $ship['email'],\n 'customers_telephone' => $ship['phone'],\n 'customers_fax' => $ship['fax']);\n tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);\n $customer_id = tep_db_insert_id();\n // insert new shipping address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => $ship['zone_id'],\n 'entry_country_id' => $ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $sendto = $address_id;\n tep_db_query(\"update \" . TABLE_CUSTOMERS . \" set customers_default_address_id = '\" . $address_id . \"' where customers_id = '\" . $customer_id . \"'\");\n tep_db_query(\"insert into \" . TABLE_CUSTOMERS_INFO . \" (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('\" . (int)$customer_id . \"', '0', now())\");\n // insert new billing address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => $billing['zone_id'],\n 'entry_country_id' => $billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $billto = $address_id;\n }\n/* start search engines statistics */\n $search_engines_id = 0;\n $search_words_id = 0;\n $affiliate_ref = 0;\n $search_engines_id_dom = $dom_data_root->get_elements_by_tagname(\"search_engines_id\");\n if ( is_array($search_engines_id_dom) && isset($search_engines_id_dom[0]) && is_object($search_engines_id_dom[0]) ) $search_engines_id = intval($search_engines_id_dom[0]->get_content());\n \n $search_words_id_dom = $dom_data_root->get_elements_by_tagname(\"search_words_id\");\n if ( is_array($search_words_id_dom) && isset($search_words_id_dom[0]) && is_object($search_words_id_dom[0]) ) $search_words_id = intval($search_words_id_dom[0]->get_content());\n\n $affiliate_ref_dom = $dom_data_root->get_elements_by_tagname(\"affiliate_ref\");\n if ( is_array($affiliate_ref_dom) && isset($affiliate_ref_dom[0]) && is_object($affiliate_ref_dom[0]) ) $affiliate_ref = intval($affiliate_ref_dom[0]->get_content());\n\n/* end search engines statistics*/\n\n // create order\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n // recreate shopping cart\n $sess_cart = $dom_data_root->get_elements_by_tagname(\"sess_cart\");\n $sess_cart = $sess_cart[0]->get_content();\n $saved_cart = unserialize( base64_decode($sess_cart) );\n if ( $saved_cart!==false ) {\n $cart = new shoppingCart;\n $cart = $saved_cart;\n }else{\n $items_list = $dom_data_root->get_elements_by_tagname(\"osc-item\");\n $currencies = new currencies();\n $cart = new shoppingCart;\n $post_process = array();\n foreach($items_list as $item)\n {\n $uprid = $item->get_attribute('item_id');\n $qty = $item->get_content();\n if ( preg_match('/^ga/',$uprid) ) {\n $post_process[] = $uprid;\n }elseif(preg_match('/^(\\d+)\\{used_(\\d+)\\}/',$uprid,$usedm)) {\n $u_pid = $usedm[1];\n $u_uid = $usedm[2];\n $cart->add_used($u_uid, $qty);\n }else{\n $attr = get_attributes($uprid);\n $cart->add_cart($uprid, $qty, $attr);\n }\n }\n foreach($post_process as $give_away) {\n $give = explode('|',$give_away);\n if ( count($give)==3 ) {\n $attr = get_attributes($give[1]);\n $cart->add_giveaway( $give[2], (int)$give[1], $attr );\n }\n }\n }\n $cart->calculate();\n\n//\nglobal $country_code, $state_code;\n\n$country_code = $ship['country-code'];\n$state_code = $ship['region'];\n$shipping_ = $shipping;\nunset($shipping);\nInitOscShippings();\nif (isset($shipping_to_class[$xml_shipping])){\n $shipping = $shipping_to_class[$xml_shipping];\n $GLOBALS['shipping']['id'] = $shipping['id'];\n}else{\n $shipping = $shipping_;\n}\n//\n\n require_once(DIR_WS_CLASSES . 'order.php');\n $order = new order;\n require_once(DIR_WS_CLASSES . 'order_total.php');\n\n $order_total_modules = new order_total;\n $order_totals = $order_total_modules->process();\n// fake tax or warmup shipping from shipping name & recalc all corect\n//mydump(var_export($order,true));\n//mydump(var_export($order_totals,true));\n/*\nforeach( $order_totals as $idx=>$ot_module ) {\n if ( $ot_module['code']=='ot_tax' ) {\n $order_totals[$idx]['value'] = $xml_tax;\n $order_totals[$idx]['text'] = $currencies->format($xml_tax, true, $order->info['currency'], $order->info['currency_value']);\n break;\n }\n}*/\n//\\fake tax\n //print_r($order);\n //print_r($order_totals);\n if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS')) $order->info['order_status'] = MODULE_PAYMENT_GOOGLECHECKOUT_STATUS;\n\n $sql_data_array = array('customers_id' => $customer_id,\n 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],\n //{{ BEGIN FISTNAME\n 'customers_firstname' => $order->customer['firstname'],\n 'customers_lastname' => $order->customer['lastname'],\n //}} END FIRSTNAME\n 'customers_company' => $order->customer['company'],\n 'customers_street_address' => $order->customer['street_address'],\n 'customers_suburb' => $order->customer['suburb'],\n 'customers_city' => $order->customer['city'],\n 'customers_postcode' => $order->customer['postcode'],\n 'customers_state' => $order->customer['state'],\n 'customers_country' => $order->customer['country']['title'],\n 'customers_telephone' => $order->customer['telephone'],\n 'customers_email_address' => $order->customer['email_address'],\n 'customers_address_format_id' => $order->customer['format_id'],\n 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],\n //{{ BEGIN FISTNAME\n 'delivery_firstname' => $order->delivery['firstname'],\n 'delivery_lastname' => $order->delivery['lastname'],\n //}} END FIRSTNAME\n 'delivery_company' => $order->delivery['company'],\n 'delivery_street_address' => $order->delivery['street_address'],\n 'delivery_suburb' => $order->delivery['suburb'],\n 'delivery_city' => $order->delivery['city'],\n 'delivery_postcode' => $order->delivery['postcode'],\n 'delivery_state' => $order->delivery['state'],\n 'delivery_country' => $order->delivery['country']['title'],\n 'delivery_address_format_id' => $order->delivery['format_id'],\n 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],\n //{{ BEGIN FISTNAME\n 'billing_firstname' => $order->billing['firstname'],\n 'billing_lastname' => $order->billing['lastname'],\n //}} END FIRSTNAME\n 'billing_company' => $order->billing['company'],\n 'billing_street_address' => $order->billing['street_address'],\n 'billing_suburb' => $order->billing['suburb'],\n 'billing_city' => $order->billing['city'],\n 'billing_postcode' => $order->billing['postcode'],\n 'billing_state' => $order->billing['state'],\n 'billing_country' => $order->billing['country']['title'],\n 'billing_address_format_id' => $order->billing['format_id'],\n 'payment_method' => $order->info['payment_method'],\n 'payment_class' => 'googlecheckout',\n 'payment_info' => $GLOBALS['payment_info'], //???\n 'google_orders_id' => $number,\n 'shipping_method' => $order->info['shipping_method'],\n 'cc_type' => $order->info['cc_type'],\n 'cc_owner' => $order->info['cc_owner'],\n 'cc_number' => $order->info['cc_number'],\n 'cc_expires' => $order->info['cc_expires'],\n 'keep_date' => 'now()',\n 'language_id' => (int)$languages_id,\n 'payment_class' => $order->info['payment_class'],\n 'shipping_class' => $order->info['shipping_class'],\n 'date_purchased' => 'now()',\n 'last_modified' => 'now()',\n/* start search engines statistics */\n 'search_engines_id' => $search_engines_id,\n 'search_words_id' => $search_words_id,\n/* end search engines statistics*/\n\n /// 'affiliate_id' => (int)$affiliate_ref,\n // 'comments' => 'AFF_DOM' . var_export($affiliate_ref_dom[0]->get_content(), true),\n\n // 'how_did_you_find' => $order->info['how_did_you_find'],\n //'how_did_you_find_text' => $order->info['how_did_you_find_text'],\n \n 'orders_status' => $order->info['order_status'],\n 'currency' => $order->info['currency'],\n 'currency_value' => $order->info['currency_value']);\n tep_db_perform(TABLE_ORDERS, $sql_data_array);\n $insert_id = tep_db_insert_id();\n for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'title' => $order_totals[$i]['title'],\n 'text' => $order_totals[$i]['text'],\n 'value' => $order_totals[$i]['value'],\n 'class' => $order_totals[$i]['code'],\n 'sort_order' => $order_totals[$i]['sort_order']);\n tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);\n }\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => $order->info['order_status'],\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => 'Order created by Google Checkout');\n tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {\n /*\n if (STOCK_LIMITED == 'true') {\n if (DOWNLOAD_ENABLED == 'true') {\n $stock_query_raw = \"SELECT products_quantity, products_attributes_filename\n FROM \" . TABLE_PRODUCTS . \" p\n LEFT JOIN \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n ON p.products_id=pa.products_id\n WHERE p.products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\";\n// Will work with only one option for downloadable products\n// otherwise, we have to build the query dynamically with a loop\n $products_attributes = $order->products[$i]['attributes'];\n if (is_array($products_attributes)) {\n $stock_query_raw .= \" AND pa.options_id = '\" . $products_attributes[0]['option_id'] . \"' AND pa.options_values_id = '\" . $products_attributes[0]['value_id'] . \"'\";\n }\n $stock_query = tep_db_query($stock_query_raw);\n } else {\n $stock_query = tep_db_query(\"select products_quantity from \" . TABLE_PRODUCTS . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n if (tep_db_num_rows($stock_query) > 0) {\n $stock_values = tep_db_fetch_array($stock_query);\n // do not decrement quantities if products_attributes_filename exists\n if ((DOWNLOAD_ENABLED != 'true') || ((!$stock_values['products_attributes_filename']) && $order->products[$i]['products_file'])) {\n $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];\n } else {\n $stock_left = $stock_values['products_quantity'];\n }\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = '\" . $stock_left . \"' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_status = '0' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n }\n */\n // Update products_ordered (for bestsellers list)\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_ordered = products_ordered + \" . sprintf('%d', $order->products[$i]['qty']) . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($order->products[$i]['id']),\n 'products_model' => $order->products[$i]['model'],\n 'products_name' => $order->products[$i]['name'],\n 'products_price' => $order->products[$i]['price'],\n 'final_price' => $order->products[$i]['final_price'],\n 'products_purchase_price' => tep_get_products_purchase_price(normalize_id($order->products[$i]['id']), $order->products[$i]['final_price']),\n 'products_tax' => $order->products[$i]['tax'],\n 'used' => $order->products[$i]['used'],\n\n\n 'is_give_away'=>((isset($order->products[$i]['is_give_away']) && $order->products[$i]['is_give_away']==1)?'1':'0'),\n // addon - gives as products 'gives' => (is_array($order->products[$i]['gives'])?serialize($order->products[$i]['gives']):''),\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($order->products[$i]['id']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_products_id = tep_db_insert_id();\n $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM\n //------insert customer choosen option to order--------\n $attributes_exist = '0';\n $products_ordered_attributes = '';\n\n if ((DOWNLOAD_ENABLED == 'true') && tep_not_null($order->products[$i]['products_file'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $order->products[$i]['products_file'],\n 'download_maxdays' => DOWNLOAD_MAX_DAYS,\n 'download_count' => DOWNLOAD_MAX_COUNT);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n\n\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> ////\n /*\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'];\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n }\n */\n\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n $dec_price = 0;\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'] . ' (+' . $currencies->display_price($gdata['price'], $gdata['tax']) . ')';\n $dec_price += $gdata['price'];\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($gdata['id']),\n 'parent_giv_id' => normalize_id($order->products[$i]['id']),\n 'products_model' => $gdata['model'],\n 'products_name' => $gdata['name'] . ' (Giveaway '.$order->products[$i]['model'].')',\n 'products_price' => $gdata['price'],\n 'final_price' => $gdata['price'],\n 'products_tax' => $gdata['tax'],\n\n \n\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($gdata['uprid']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($gdata['uprid']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_gives_id = tep_db_insert_id();\n\n if (is_array($gdata['attributes']) && sizeof($gdata['attributes'])>0) {\n foreach ($gdata['attributes'] as $gdata_attr) {\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_gives_id,\n 'products_options_id' => $gdata_attr['opt_id'],\n 'products_options' => $gdata_attr['opt_name'],\n 'products_options_values_id' => $gdata_attr['opt_val_id'],\n 'products_options_values' => $gdata_attr['tep_values_name'],\n 'options_values_price' => '0',\n 'price_prefix' => '+');\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n }\n }\n\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n\n tep_db_query(\"update \".TABLE_ORDERS_PRODUCTS.\" set products_price=(products_price-'\".floatval($dec_price).\"'), final_price=(final_price-'\".floatval($dec_price).\"') where orders_products_id='\".intval($order_products_id).\"'\");\n }\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> off ////\n\n\n\n\n if (isset($order->products[$i]['attributes'])) {\n $attributes_exist = '1';\n for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {\n if (DOWNLOAD_ENABLED == 'true') {\n $attributes_query = \"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_maxdays, pa.products_attributes_maxcount , pa.products_attributes_filename\n from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n where pa.products_id = '\" . $order->products[$i]['id'] . \"'\n and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '\" . $languages_id . \"'\n and poval.language_id = '\" . $languages_id . \"'\";\n $attributes = tep_db_query($attributes_query);\n } else {\n $attributes = tep_db_query(\"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa where pa.products_id = '\" . $order->products[$i]['id'] . \"' and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"' and pa.options_id = popt.products_options_id and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '\" . $languages_id . \"' and poval.language_id = '\" . $languages_id . \"'\");\n }\n\n $attributes_values = tep_db_fetch_array($attributes);\n $attributes_values['options_values_price'] = tep_get_options_values_price($attributes_values['products_attributes_id']);\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'products_options' => $attributes_values['products_options_name'],\n 'products_options_values' => $attributes_values['products_options_values_name'],\n 'options_values_price' => $attributes_values['options_values_price'],\n 'price_prefix' => $attributes_values['price_prefix']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $attributes_values['products_attributes_filename'],\n 'download_maxdays' => $attributes_values['products_attributes_maxdays'],\n 'download_count' => $attributes_values['products_attributes_maxcount']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n $products_ordered_attributes .= \"\\n\\t\" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];\n }\n\n\n\n }\n\n // update inventory\nif (PRODUCTS_INVENTORY == 'True'){\n update_stock($order->products[$i]['id'], 0, $order->products[$i]['qty']);\n}\n//\n\n }\n\n //$insert_id, $customer_id, $REMOTE_ADDR, $cc_id;\n $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM\n\n \n tep_calculate_order_revenue($insert_id); \n \n}", "function get_customer_details($customer_id, $to=null)\n{\n\n\tif ($to == null)\n\t\t$todate = date(\"Y-m-d\");\n\telse\n\t\t$todate = date2sql($to);\n\t$past1 = get_company_pref('past_due_days');\n\t$past2 = 2 * $past1;\n\t// removed - debtor_trans.alloc from all summations\n\n $value = \"decode(\".TB_PREF.\"debtor_trans.type, 11, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type, 12, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type,2,\t-1, 1))) * \n\t\t\t\t\".\n \"\t(\".TB_PREF.\"debtor_trans.ov_amount + \".TB_PREF.\"debtor_trans.ov_gst + \"\n\t\t\t\t.TB_PREF.\"debtor_trans.ov_freight + \".TB_PREF.\"debtor_trans.ov_freight_tax + \"\n\t\t\t\t\t.TB_PREF.\"debtor_trans.ov_discount)\n\t\t\t \";\n\t$due = \"decode(\".TB_PREF.\"debtor_trans.type,10,\".TB_PREF.\"debtor_trans.due_date,\".TB_PREF.\"debtor_trans.tran_date)\";\n $sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"payment_terms.terms,\n\t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description,\n\t\t\n\t\tSum(\".$value.\") AS balance,\n\t\t\n\t\tSum(decode(sign(to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due),-1, 0, $value)) AS due,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past1),-1, $value, 0)) AS overdue1,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past2),-1, 0, $value)) AS overdue2 \n\t\tFROM \".TB_PREF.\"debtors_master,\n\t\t\t \".TB_PREF.\"payment_terms,\n\t\t\t \".TB_PREF.\"credit_status,\n\t\t\t \".TB_PREF.\"debtor_trans\n\n\t\tWHERE\n\t\t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n\t\t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id).\"\n\t\t\t AND \".TB_PREF.\"debtor_trans.tran_date <= to_date('$todate', 'yyyy-mm-dd hh24:mi:ss')\n\t\t\t AND \".TB_PREF.\"debtor_trans.type <> 13\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".TB_PREF.\"debtor_trans.debtor_no\n\n\t\tGROUP BY\n\t\t\t \".TB_PREF.\"debtors_master.name,\n\t\t\t \".TB_PREF.\"payment_terms.terms,\n\t\t\t \".TB_PREF.\"payment_terms.days_before_due,\n\t\t\t \".TB_PREF.\"payment_terms.day_in_following_month,\n\t\t\t \".TB_PREF.\"debtors_master.credit_limit,\n\t\t\t \".TB_PREF.\"credit_status.dissallow_invoices,\n\t\t\t \".TB_PREF.\"debtors_master.curr_code, \t\t\n\t\t\t \".TB_PREF.\"credit_status.reason_description\";\n\t\t\t \n\t\t\t \n $result = db_query($sql,\"The customer details could not be retrieved\");\n\n if (db_num_rows($result) == 0)\n {\n\n \t/*Because there is no balance - so just retrieve the header information about the customer - the choice is do one query to get the balance and transactions for those customers who have a balance and two queries for those who don't have a balance OR always do two queries - I opted for the former */\n\n \t$nil_balance = true;\n\n \t$sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"debtors_master.debtor_no, \".TB_PREF.\"payment_terms.terms,\n \t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description\n \t\tFROM \".TB_PREF.\"debtors_master,\n \t\t \".TB_PREF.\"payment_terms,\n \t\t \".TB_PREF.\"credit_status\n\n \t\tWHERE\n \t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n \t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n \t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id);\n\n \t$result = db_query($sql,\"The customer details could not be retrieved\");\n\n }\n else\n {\n \t$nil_balance = false;\n }\n\n $customer_record = db_fetch($result);\n\n if ($nil_balance == true)\n {\n\t\techo \"nill ba = true\";\n \t$customer_record[\"balance\"] = 0;\n \t$customer_record[\"due\"] = 0;\n \t$customer_record[\"overdue1\"] = 0;\n \t$customer_record[\"overdue2\"] = 0;\n }\n return $customer_record;\n\n\n}", "private function getData() {\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->model( 'payment/directebanking' );\n\n\t\t$this->data['testMode']\t= $this->_param['testMode'];\n\t\t$this->data['continue']\t= $this->buildUrl( 'checkout/success' );\n\n\t\t// only for OC 1.4.x\n\t\tif( $this->request->get['route'] != 'checkout/guest_step_3' ) {\n\t\t\t$this->data['back'] = $this->buildUrl( 'checkout/payment' );\n\t\t}else{\n\t\t\t$this->data['back'] = $this->buildUrl( 'checkout/guest_step_2' );\n\t\t}\n\n\t\t// get order info\n\t\t$order_info\t\t= $this->model_checkout_order->getOrder( $this->session->data['order_id'] );\n\t\t// get product info\n\t\t$product_info\t= $this->model_payment_directebanking->getOrderProduct( $this->session->data['order_id'] );\n\t\t// get country iso2 code\n\t\t$iso2\t\t\t= $this->model_payment_directebanking->getCountryIso2( $this->config->get( 'config_country_id' ) );\n\t\t// remove any currency symbol(s)\n\t\t$amount\t\t\t= preg_replace( '/[^0-9.,]/', '', $order_info['total'] );\n\n\t\t// get form data\n\t\t$this->getFormData( $order_info, $product_info, $iso2, $amount );\n\t\t// get success / cancel URLs\n\t\t$this->getUrls();\n\n\t\tif(\n $this->_debug == 2\n && $this->_ocversion == '1.4'\n )\n {\n\t\t\techo '<hr />formData BEFORE hash:<br />';\n\t\t\tprint_r( $this->formData );\n\t\t\techo '<hr />';\n\t\t}\n\n\t\t// get the hash value\n\t\t$this->getProjectHash();\n\n\t\tif(\n $this->_debug == 2\n && $this->_ocversion == '1.4'\n )\n {\n\t\t\techo '<hr />formData AFTER hash:<br />';\n\t\t\tprint_r( $this->formData );\n\t\t\techo '<hr />';\n\t\t}\n\n\t\t// build the array for the form output new (we need only those values)\n\t\t$this->data['form'] = array(\n\t\t\t'user_id'\t\t\t\t=> $this->formData['user_id'],\n\t\t\t'project_id'\t\t\t=> $this->formData['project_id'],\n\t\t\t'amount'\t\t\t\t=> $this->formData['amount'],\n\n\t\t\t'reason_1'\t\t\t\t=> $this->formData['reason_1'],\n\t\t\t'reason_2'\t\t\t\t=> $this->formData['reason_2'],\n\t\t\t'user_variable_0'\t\t=> $this->formData['user_variable_0'],\n\t\t\t'user_variable_1'\t\t=> $this->formData['user_variable_1'],\n\t\t\t'user_variable_2'\t\t=> $this->formData['user_variable_2'],\n\t\t\t'user_variable_3'\t\t=> $this->formData['user_variable_3'],\n\t\t\t'user_variable_4'\t\t=> htmlspecialchars( $this->formData['user_variable_4'], ENT_QUOTES, 'UTF-8' ),\n\t\t\t'user_variable_5'\t\t=> $this->formData['user_variable_5'],\n\n\t\t\t'sender_holder'\t\t\t=> htmlspecialchars( $this->formData['sender_holder'], ENT_QUOTES, 'UTF-8' ),\n\t\t\t'sender_account_number'\t=> $this->formData['sender_account_number'],\n\t\t\t'sender_bank_code'\t\t=> $this->formData['sender_bank_code'],\n\t\t\t'sender_country_id'\t\t=> $this->formData['sender_country_id'],\n\n\t\t\t'language_id'\t\t\t=> $this->formData['language_id'],\n\t\t\t'currency_id'\t\t\t=> $this->formData['currency_id'],\n\t\t\t'hash'\t\t\t\t\t=> $this->formData['hash']\n\t\t);\n\n\t\t// get possible text to display\n\t\tif( $this->config->get( 'directebanking_title_as_text') ) {\n\t\t\tswitch( $this->config->get( 'directebanking_title_as_text') ) {\n\t\t\t\tcase '2':\n\t\t\t\t\t$this->data['instruction'] = $this->language->get( 'text_title_w_image' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tcase '1':\n\t\t\t\t\t$this->data['instruction'] = $this->language->get( 'text_title' );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->data['instruction'] = html_entity_decode(\n\t\t\t\t$this->config->get( 'directebanking_instruction_' . $this->config->get( 'config_language_id' ) ),\n\t\t\t\tENT_QUOTES,\n\t\t\t\t'utf-8'\n\t\t\t);\n\t\t}\n\n\t\t$this->data['instruction'] .= ( $this->_param['testMode']\n\t\t\t\t? '<br />' . $this->language->get( 'text_testOrder' )\n\t\t\t\t: ''\n\t\t\t);\n\n\t\t// write log\n\t\t$comment\t= $this->_param['testMode']\n\t\t\t\t\t\t? $this->language->get( 'text_log_testorder' )\n\t\t\t\t\t\t: $this->language->get( 'text_log_order' );\n\t\t$msg\t\t= sprintf(\n\t\t\t\t\t\t$this->language->get( 'text_log_new_order' ),\n\t\t\t\t\t\t$this->formData['project_id'],\n\t\t\t\t\t\t$order_info['order_id'],\n\t\t\t\t\t\t$comment,\n\t\t\t\t\t\t$product_info['name'],\n\t\t\t\t\t\t$order_info['lastname'],\n\t\t\t\t\t\t$amount\n\t\t\t\t\t\t);\n\n\t\t$this->writeLog( $msg, 1 );\n\t}", "public function get_request_url( $order ) {\n\t\t\n\t\t$registerCard = $useRegisteredCard = 0;\n\t\t$useCard = 0;\n\t\tif (isset($_POST['oneclic'])) {\n\t\t\t$oneclic = wc_clean( $_POST['oneclic'] );\n\t\t\t\n\t\t\tswitch($oneclic) {\n\t\t\t\tcase 'register_card':\n\t\t\t\t\t$registerCard = $useRegisteredCard = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'use_card':\n\t\t\t\t\t$useCard = 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Build args with the order\n\n\t\t$amount = $order->get_total();\n\t\t//$amountCom = $amount;\n $amountCom = 0;\n\t\t\n\t\t/*if( function_exists( 'is_plugin_active' ) ) {\n\t\t\tif ( is_plugin_active( 'payohmkt/payohmkt.php' ) ) {\n\t\t\t\t//@TODO manage mixted cart\n\t\t\t\t\n\t\t\t\t//Keep only subtotal for vendors because webkul plugin work like this :-(\n\t\t\t\t$amountCom = $order->get_total() - $order->get_subtotal();\n\t\t\t}\n\t\t}*/\n\t\n\t\t$comment = get_bloginfo( 'name' ) . \" - \" . sprintf(__('Order #%s by %s %s %s', PAYOH_TEXT_DOMAIN), $order->get_order_number(), $order->billing_last_name, $order->billing_first_name, $order->billing_email);\n\t\t$returnUrl = '';\n\n\t\tif (!$useCard) {\n\t\t\t$params = array(\n\t\t\t\t\t'wkToken' => $order->id,\n\t\t\t\t\t'wallet' => $this->gateway->get_option(WC_Gateway_Payoh::WALLET_MERCHANT_ID),\n\t\t\t\t\t'amountTot' => $this->formatAmount($amount),\n\t\t\t\t\t'amountCom' => $this->formatAmount($amountCom),\n 'autoCommission' => 1,\n\t\t\t\t\t'comment' => $comment,\n\t\t\t\t\t'returnUrl' => $this->notify_url, //esc_url_raw( $this->gateway->get_return_url( $order )),\n\t\t\t\t\t'cancelUrl' => esc_url_raw( $order->get_cancel_order_url_raw() ),\n\t\t\t\t\t'errorUrl' => esc_url_raw( $order->get_cancel_order_url_raw() ), //@TODO change for a specific error url\n\t\t\t\t\t'registerCard' => $registerCard, //For Atos\n\t\t\t\t\t'useRegisteredCard' => $useRegisteredCard, //For payline\n\t\t\t);\n\t\t\t\n\t\t\tWC_Gateway_Payoh::log(print_r($params, true));\n\t\t\t\n\t\t\t//Call APi MoneyInWebInit in correct MODE with the args\n\t\t\t$moneyInWeb = $this->gateway->getDirectkit()->MoneyInWebInit($params);\n\t\t\t\n\t\t\t//Save card ID\n\t\t\tif($registerCard || $useRegisteredCard){\n\t\t\t\tupdate_user_meta( get_current_user_id(), '_lw_card_id', $moneyInWeb->CARD->ID );\n\t\t\t\tupdate_post_meta( $order->id, '_register_card', true );\n\t\t\t\tWC_Gateway_Payoh::log(sprintf(__(\"Card Saved for customer Id %s\", PAYOH_TEXT_DOMAIN), get_current_user_id()));\n\t\t\t}\n\t\t\t\n\t\t\tWC_Gateway_Payoh::log(print_r($moneyInWeb, true));\n\t\t\t$returnUrl = $this->gateway->getDirectkit()->formatMoneyInUrl($moneyInWeb->TOKEN, $this->gateway->get_option(WC_Gateway_Payoh::CSS_URL));\n\t\t}\n\t\telse { //Customer want to use his last card, so we call MoneyInWithCardID directly\n\t\t\n\t\t\t$cardId = get_user_meta(get_current_user_id(), '_lw_card_id', true);\n\t\t\t\n\t\t\t//call directkit for MoneyInWithCardId\n\t\t\t$params = array(\n\n\t\t\t\t\t'wkToken' => $order->id,\n\t\t\t\t\t'wallet' => $this->gateway->get_option(WC_Gateway_Payoh::WALLET_MERCHANT_ID),\n\t\t\t\t\t'amountTot' => $this->formatAmount($amount),\n\t\t\t\t\t'amountCom' => $this->formatAmount($amountCom),\n 'autoCommission' => 1,\n\t\t\t\t\t'comment' => $comment . \" -- \" . sprintf(__('Oneclic mode (card id: %s)', PAYOH_TEXT_DOMAIN), $cardId),\n\t\t\t\t\t'cardId' => $cardId\n\t\t\t);\n\t\t\t\n\t\t\tWC_Gateway_Payoh::log(print_r($params, true));\n\t\t\t\n\t\t\t$operation = $this->gateway->getDirectkit()->MoneyInWithCardId($params);\n\t\t\t\n\t\t\tWC_Gateway_Payoh::log(print_r($operation, true));\n\t\t\t\n\t\t\tif($operation->STATUS == \"3\") {\n\t\t\t\t\n\t\t\t\t$transaction_id = $operation->ID;\n\t\t\t\t//Set transaction id to POST array. Needed on notif handler\n\t\t\t\t\n\t\t\t\t$_POST['response_transactionId'] = $transaction_id;\n\t\t\t\t\n\t\t\t\t//Process order status\n\t\t\t\t$this->gateway->getNotifhandler()->valid_response($order);\n\t\t\t\t\n\t\t\t\t//Return to original wc success page\n\t\t\t\t$returnUrl = $this->gateway->get_return_url($order);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception(__('Error during payment', PAYOH_TEXT_DOMAIN));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return redirect url\n\t\treturn $returnUrl;\n\t}", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "function get_gateway_data( ){\n\t\t\n\t\t$authorize_login_id \t\t= \t\tget_option( 'ec_option_authorize_login_id' );\n\t\t$authorize_trans_key \t\t= \t\tget_option( 'ec_option_authorize_trans_key' );\n\t\t$authorize_test_mode \t\t= \t\tget_option( 'ec_option_authorize_test_mode' );\n\t\t$authorize_currency_code \t= \t\tget_option( 'ec_option_authorize_currency_code' );\n\t\t\n\t\t$transaction_type = \"AUTH_CAPTURE\";\n\t\t$expiration_date = $this->credit_card->expiration_month . '/' . $this->credit_card->get_expiration_year( 4 );\n\t\t\n\t\t/*\n\t\t$line_items = \"\";\n\t\tfor( $i=0; $i<count($this->cart->cart); $i++ ){\n\t\t\t\n\t\t\tif( $i != 0)\n\t\t\t\t$line_items .= \"&\";\n\t\t\t\t\n\t\t\t$line_items .= \t$this->cart->cart[$i]->product_id . \"<|>\" . \n\t\t\t\t\t\t\t$this->cart->cart[$i]->title . \"<|><|>\" . \n\t\t\t\t\t\t\t$this->cart->cart[$i]->quantity . \"<|>\" . \n\t\t\t\t\t\t\t$this->cart->cart[$i]->unit_price . \"<|>\" . \n\t\t\t\t\t\t\t$this->cart->cart[$i]->is_taxable; \t\n\t\t}\n\t\t*/\n\t\t\n\t\t$authorize_values = array(\n\t\t \"x_login\"\t\t\t\t\t\t\t=> $authorize_login_id,\n\t\t \"x_test_request\" \t\t\t\t\t=> $authorize_test_mode,\n\t\t \"x_tran_key\"\t\t\t\t\t\t=> $authorize_trans_key,\n\t\t \"x_type\"\t\t\t\t\t\t\t=> $transaction_type,\n\t\t \"x_amount\"\t\t\t\t\t\t=> $this->order_totals->grand_total,\n\t\t \"x_card_num\"\t\t\t\t\t\t=> $this->credit_card->card_number,\n\t\t \"x_exp_date\"\t\t\t\t\t\t=> $expiration_date,\n\t\t \"x_card_code\"\t\t\t\t\t\t=> $this->credit_card->security_code,\n\t\t \"x_invoice_num\"\t\t\t\t\t=> $this->order_id,\n\t\t \"x_relay_response\"\t\t\t\t=> \"FALSE\",\n\t\t \"x_delim_data\"\t\t\t\t\t=> \"TRUE\",\n\t\t \"x_version\"\t\t\t\t\t\t=> \"3.1\",\n\t\t \"x_delim_char\"\t\t\t\t\t=> \",\",\n\t\t \"x_method\"\t\t\t\t\t\t=> \"CC\",\n\t\t \"x_tax\"\t\t\t\t\t\t\t=> $this->order_totals->tax_total,\n\t\t \"x_duty\"\t\t\t\t\t\t\t=> $this->order_totals->duty_total,\n\t\t \"x_freight\"\t\t\t\t\t\t=> $this->order_totals->shipping_total,\n\t\t \"x_first_name\"\t\t\t\t\t=> $this->user->billing->first_name,\n\t\t \"x_last_name\"\t\t\t\t\t\t=> $this->user->billing->last_name,\n\t\t \"x_address\"\t\t\t\t\t\t=> $this->user->billing->address_line_1,\n\t\t \"x_city\"\t\t\t\t\t\t\t=> $this->user->billing->city,\n\t\t \"x_state\"\t\t\t\t\t\t\t=> $this->user->billing->state,\n\t\t \"x_zip\"\t\t\t\t\t\t\t=> $this->user->billing->zip,\n\t\t \"x_country\"\t\t\t\t\t\t=> $this->user->billing->country,\n\t\t \"x_phone\"\t\t\t\t\t\t\t=> $this->user->billing->phone,\n\t\t \"x_email\"\t\t\t\t\t\t\t=> $this->user->email,\n\t\t \"x_cust_id\"\t\t\t\t\t\t=> $this->user->user_id,\n\t\t \"x_customer_ip\"\t\t\t\t\t=> $_SERVER['REMOTE_ADDR'],\n\t\t \"x_ship_to_first_name\"\t\t\t=> $this->user->shipping->first_name,\n\t\t \"x_ship_to_last_name\"\t\t\t\t=> $this->user->shipping->last_name,\n\t\t \"x_ship_to_address\"\t\t\t\t=> $this->user->shipping->address_line_1,\n\t\t \"x_ship_to_city\"\t\t\t\t\t=> $this->user->shipping->city,\n\t\t \"x_ship_to_state\"\t\t\t\t\t=> $this->user->shipping->state,\n\t\t \"x_ship_to_zip\"\t\t\t\t\t=> $this->user->shipping->zip,\n\t\t \"x_ship_to_country\"\t\t\t\t=> $this->user->shipping->country,\n\t\t \"x_ship_to_phone\"\t\t\t\t\t=> $this->user->shipping->phone//,\n\t\t // \"x_line_item\"\t\t\t\t\t\t=> $line_items\n\t\t);\n\t\t\n\t\treturn $authorize_values;\n\t}", "public function ride_payment()\r\n\t{\r\n\t\tif (!empty($_SESSION['olouserid'])) {\r\n\t\t\t$ordercode = $_SESSION['order_code'];\r\n\t\t\t$this->load->library('zyk/OrderLib', 'orderlib');\r\n\t\t\t$data = $this->orderlib->getOrderDetails($ordercode);\r\n\t\t\t$this->template->set('ordercode',$ordercode);\r\n\t\t\t$this->template->set('userdata',$data[0]);\r\n\t\t\t$this->template->set ( 'page', 'Ride Payment' );\r\n\t\t $this->template->set ( 'description', '' );\r\n\t\t $this->template->set ( 'keywords', '' );\r\n\t\t $this->template->set_theme('default_theme');\r\n\t\t $this->template->set_layout ('default')\r\n\t\t ->title ( 'ServiceOn' )\r\n\t\t ->set_partial ( 'header', 'partials/header' )\r\n\t\t ->set_partial ( 'footer', 'partials/footer' );\r\n\t\t\t$this->template->build ('rider-payment-view');\r\n\t\t} else {\r\n\t\t\tredirect(base_url().\"login\");\r\n\t\t}\r\n\t}", "function regiomino_cart_paymentinfo() {\r\n\tglobal $base_url;\r\n/* \t$force_referer[] = 'checkout/shipping';\r\n\t$force_referer[] = 'checkout/payment';\r\n\t$force_referer[] = 'checkout/verify';\r\n\t$referer = str_replace($base_url . '/', \"\", $_SERVER['HTTP_REFERER']);\r\n\r\n\tif($referer != $force_referer[0] && $referer != $force_referer[1] && $referer != $force_referer[2]) {\r\n\t\tdrupal_set_message(t('Please follow the steps of the checkout process one after another'), 'warning');\r\n\t\tdrupal_goto('checkout/address');\r\n\t} */\r\n\t\r\n\t\r\n\t $coopprofile = node_load(3524);\r\n\t\t//var_dump($coopprofile->field_region);\r\n\t\r\n\tglobal $user;\r\n\tif ($user->uid) {\r\n\t\t$loggedin = TRUE;\r\n\t\t$cart_id = $user->uid;\r\n\t}\r\n\telse {\r\n\t\t$loggedin = FALSE;\r\n\t\t$cart_id = session_id();\r\n\t}\r\n\t//Load cart\r\n\t$empty = regiomino_cart_empty_cart($cart_id);\r\n\t//Set message if cart is empty\r\n\tif($empty) {\r\n\t\tdrupal_goto('cart');\r\n\t}\r\n\t\r\n\t//Make sure user logs in or registers before continuing to checkout\r\n\tif(!$loggedin) drupal_goto('user', array('query' => drupal_get_destination()));\r\n\t\r\n\t$content = drupal_get_form('regiomino_cart_paymentinfo_form');\t\r\n\treturn\ttheme('regiomino_cart_theme_payment', array(\r\n\t\t\t\t\t\t'vars' => array(\r\n\t\t\t\t\t\t\t'form' => $content,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t));\r\n}", "public function orderItem()\n {\n /* @var $customerAccount MagentoComponents_Pages_CustomerAccount */\n $customerAccount = Menta_ComponentManager::get('MagentoComponents_Pages_CustomerAccount');\n $customerAccount->login();\n\n /* @var $cart MagentoComponents_Pages_Cart */\n $cart = Menta_ComponentManager::get('MagentoComponents_Pages_Cart');\n $cart->clearCart();\n\n /* @var $productSingleView MagentoComponents_Pages_ProductSingleView */\n $productSingleView = Menta_ComponentManager::get('MagentoComponents_Pages_ProductSingleView');\n $productSingleView->putProductsIntoCart($this->getConfiguration()->getValue('testing.simple.product.id'));\n\n /* @var $onePageCheckout MagentoComponents_Pages_OnePageCheckout */\n $onePageCheckout = Menta_ComponentManager::get('MagentoComponents_Pages_OnePageCheckout');\n\n $onePageCheckout->goThroughCheckout();\n\n $this->getHelperAssert()->assertTextNotPresent(\"There was an error capturing the transaction.\");\n $orderNumber = $onePageCheckout->getOrderNumberFromSuccessPage();\n\n return $orderNumber;\n }", "private function fetchOrder()\n {\n $this->oOrder = Mage::getSingleton('sales/order');\n try {\n $this->oOrder->load($this->getParameter('orderid',self::REGEX_INTEGER));\n } catch (Exception $e) {\n $this->returnMessage = self::MESSAGE_INVALID_ORDER_ID;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n\n if(!$this->oOrder->getPayment() || substr($this->oOrder->getPayment()->getMethod(),0,3) != 'mcp') {\n $this->returnMessage = self::MESSAGE_NOT_MICROPAYMENT_ORDER;\n $this->returnStatus = self::STATUS_ERROR;\n $this->sendStatus();\n }\n }", "public function getFormFields()\n {\n $order_id = $this->getOrder()->getRealOrderId();\n $billing = $this->getOrder()->getBillingAddress();\n if ($this->getOrder()->getBillingAddress()->getEmail()) {\n $email = $this->getOrder()->getBillingAddress()->getEmail();\n } else {\n $email = $this->getOrder()->getCustomerEmail();\n }\n\n $params = array(\n 'merchant_fields' => 'partner',\n 'partner' => 'magento',\n 'pay_to_email' => Mage::getStoreConfig(Paynova_Paynovapayment_Helper_Data::XML_PATH_EMAIL),\n 'transaction_id' => $order_id,\n 'return_url' => Mage::getUrl('paynovapayment/processing/success', array('transaction_id' => $order_id)),\n 'cancel_url' => Mage::getUrl('paynovapayment/processing/cancel', array('transaction_id' => $order_id)),\n 'status_url' => Mage::getUrl('paynovapayment/processing/status'),\n 'language' => $this->getLocale(),\n 'amount' => round($this->getOrder()->getGrandTotal(), 2),\n 'currency' => $this->getOrder()->getOrderCurrencyCode(),\n 'recipient_description' => $this->getOrder()->getStore()->getWebsite()->getName(),\n 'firstname' => $billing->getFirstname(),\n 'lastname' => $billing->getLastname(),\n 'address' => $billing->getStreet(-1),\n 'postal_code' => $billing->getPostcode(),\n 'city' => $billing->getCity(),\n 'country' => $billing->getCountryModel()->getIso3Code(),\n 'pay_from_email' => $email,\n 'phone_number' => $billing->getTelephone(),\n 'detail1_description' => Mage::helper('paynovapayment')->__('Order ID'),\n 'detail1_text' => $order_id,\n 'payment_methods' => $this->_paymentMethod,\n 'hide_login' => $this->_hidelogin,\n 'new_window_redirect' => '1'\n );\n\n // add optional day of birth\n if ($billing->getDob()) {\n $params['date_of_birth'] = Mage::app()->getLocale()->date($billing->getDob(), null, null, false)->toString('dmY');\n }\n\n return $params;\n }", "public function testGetOrderDetail(){\n \t\n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \t\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n \t\n \n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t\n \t$parameters = array(\n \t\t\tPayUParameters::ORDER_ID => $authorizationResponse->transactionResponse->orderId,\n \t);\n \t\n \t$response = PayUReports::getOrderDetail($parameters);\n \t\n \t$this->assertNotNull($response);\n \t$this->assertEquals($authorizationResponse->transactionResponse->orderId, $response->id);\n \t \n }", "public function PaypalGetAndDoExpressCheckout($oPaypal){\n if (!isset($_GET['token'])){\n header('Location:'.'http://localhost/PHPScripts_website/live_demo/buy_ticket.php?c=cancel'); \n }\n\n // *** Checkout process (get and do expresscheckout) \n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n\n // GetExpressCheckoutDetails (get orders, buyer, transaction informations)\n $response = $oPaypal->request('GetExpressCheckoutDetails', array(\n 'TOKEN' => $_GET['token']\n ));\n\n //Store buyer information\n $oPaypal->RecordPaypalPayer($response); \n\n // Store order\n $oOrder = new Order();\n\n //Record order\n $id_cat = 1;\n $sIdOrder = $oOrder->RecordOrder($response, $id_cat);\n\n if($response){\n // if checkout success\n if($response['CHECKOUTSTATUS'] == 'PaymentActionCompleted'){\n die('This payment has already been validated');\n }\n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n die();\n }\n\n // DoExpressCheckoutPayment setting\n $params = array(\n 'TOKEN' => $response['TOKEN'],\n 'PAYERID'=> $response['PAYERID'],\n 'PAYMENTREQUEST_0_PAYMENTACTION'=>'Sale',\n 'PAYMENTREQUEST_0_AMT' => $response['AMT'],\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $response['ITEMAMT'],\n );\n\n foreach($_SESSION['tickets'] as $k => $ticket){\n // Send again order informations to paypal for the history buyer purchases.\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // DoExpressCheckoutPayment\n $response = $oPaypal->request('DoExpressCheckoutPayment',$params );\n\n if($response){\n // DoExpressCheckoutPayment is success then update order in database ('Transaction ID', 'paymentstatus'...=\n $oOrder->updateOrder($sIdOrder, $response);\n\n if ($response['PAYMENTINFO_0_PAYMENTSTATUS'] == 'Completed'){\n // Send mail confirmation (with order information and ticket pdf link). A FAIRE\n echo \"<br>the transaction n°{$response['PAYMENTINFO_0_TRANSACTIONID']} was successful\";\n } \n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n }\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n\n}", "public function getcustomerDetails_get() {\n $result = $this->QuotationForEnquiry_model->getcustomerDetails();\n return $this->response($result);\n }", "function process(&$order)\n\t\t{\t\n\t\t\t$order->payment_type = \"PayPal Express\";\n\t\t\t$order->cardtype = \"\";\n\t\t\t$order->ProfileStartDate = date_i18n(\"Y-m-d\", strtotime(\"+ \" . $order->BillingFrequency . \" \" . $order->BillingPeriod)) . \"T0:0:0\";\n\t\t\t$order->ProfileStartDate = apply_filters(\"pmpro_profile_start_date\", $order->ProfileStartDate, $order);\n\n\t\t\treturn $this->setExpressCheckout($order);\n\t\t}", "protected function _afterAdd(KControllerContext $context)\n {\n $order = $context->result;\n\n // Salesreceipt data\n $salesreceipt = array(\n 'DocNumber' => $order->id,\n 'TxnDate' => date('Y-m-d'),\n 'CustomerRef' => $order->_account_customer_ref,\n 'CustomerMemo' => 'Thank you for your business and have a great day!',\n );\n\n if ($order->payment_method == ComRewardlabsModelEntityOrder::PAYMENT_METHOD_COD)\n {\n // COD payment\n $salesreceipt['DepartmentRef'] = $this->_department_ref; // Angono EC Valle store\n $salesreceipt['DepositToAccountRef'] = $this->_cod_payments_account; // COD payment processor account\n $salesreceipt['transaction_type'] = 'online'; // Customer ordered thru website\n }\n elseif ($order->payment_method == ComRewardlabsModelEntityOrder::PAYMENT_METHOD_DRAGONPAY)\n {\n // Online payment\n $salesreceipt['DepartmentRef'] = $this->_department_ref; // Angono EC Valle store\n $salesreceipt['DepositToAccountRef'] = $this->_online_payments_account; // Online payment processor account\n $salesreceipt['transaction_type'] = 'online'; // Customer ordered thru website\n }\n else\n {\n // Cash (in-store) purchase\n // $user = $this->getObject('user');\n // $employee = $this->getObject('com://site/rewardlabs.model.employeeaccounts')->user_id($user->getId())->fetch();\n \n $salesreceipt['DepartmentRef'] = $this->_department_ref; //$employee->DepartmentRef; // Store branch\n $salesreceipt['DepositToAccountRef'] = $this->_undeposited_account_ref; // Undeposited Funds Account\n $salesreceipt['transaction_type'] = 'offline'; // Order placed via onsite POS\n }\n\n // Shipping address\n $salesreceipt['ShipAddr'] = array(\n 'Line1' => $order->address,\n 'Line2' => $order->city,\n 'Line3' => $order->country\n );\n\n // Line items\n $lines = array();\n\n foreach ($order->getOrderItems() as $orderItem)\n {\n $lines[] = array(\n 'Description' => $orderItem->item_name,\n 'Amount' => ($orderItem->item_price * $orderItem->quantity),\n 'Qty' => $orderItem->quantity,\n 'ItemRef' => $orderItem->ItemRef,\n );\n }\n\n $shipping_cost = $order->shipping_cost;\n\n // Shipping charge line item\n if ($order->shipping_method && $shipping_cost)\n {\n // Delivery charge\n $lines[] = array(\n 'Description' => 'Shipping',\n 'Amount' => $shipping_cost,\n 'Qty' => $orderItem->quantity,\n 'ItemRef' => $this->_shipping_account,\n );\n }\n\n $salesreceipt['lines'] = $lines;\n\n $id = $this->getObject('com://admin/qbsync.service.salesreceipt')->create($salesreceipt);\n $order->SalesReceiptRef = $id;\n $order->save();\n }", "function get_customer_to_order($customer_id) {\n\t$sql = \"SELECT cust.name, \n\t\t cust.address, \"\n\t\t .TB_PREF.\"credit_status.dissallow_invoices, \n\t\t cust.sales_type AS salestype,\n\t\t cust.dimension_id,\n\t\t cust.dimension2_id,\n\t\t stype.sales_type,\n\t\t stype.tax_included,\n\t\t stype.factor,\n\t\t cust.curr_code,\n\t\t cust.discount,\n\t\t cust.payment_terms,\n\t\t cust.pymt_discount,\n\t\t cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,\n\t\t\t-1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit\n\t\tFROM \".TB_PREF.\"debtors_master cust\n\t\t LEFT JOIN \".TB_PREF.\"debtor_trans trans ON trans.type!=\".ST_CUSTDELIVERY.\" AND trans.debtor_no = cust.debtor_no,\"\n\t\t .TB_PREF.\"credit_status, \"\n\t\t .TB_PREF.\"sales_types stype\n\t\tWHERE cust.sales_type=stype.id\n\t\t\tAND cust.credit_status=\".TB_PREF.\"credit_status.id\n\t\t\tAND cust.debtor_no = \".db_escape($customer_id)\n\t\t.\" GROUP by cust.debtor_no\";\n\n\t$result =db_query($sql,\"Customer Record Retreive\");\n\treturn \tdb_fetch($result);\n}", "public function makeOrder(){\n\t\tsession_start();\n\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/purchase/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: ' . TOKEN));\n\n\t\t// send the request\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['id_user' => $_SESSION['id_user'], 'date' => date('Y-m-d')]));\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$insertId = json_decode($output,true)['insertId'];\n\n\t\t// decode the cookie into a php object\n\t\t$cart = json_decode($_COOKIE['cart'], true);\n\n\t\t// fill the contain table from the API with the products of the order\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$this->addToOrder($product['quantity'], $insertId, $product['quantity']);\n\t\t}\n\n/*\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/user/status/bde_member\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t$bdeMembers = json_decode($output, true);\n\n\t\tvar_dump($bdeMembers);\n\n\t\t$emailMessage = \"L'utilisateur \" . $_SESSION['first_name'] . \" \" . $_SESSION['last_name'] . \" a passer une commande :\\n\";\n\t\t$total = 0;\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$emailMessage = $emailMessage . \"\\t\" . $cart['name'] . \" : \" . $cart['quantity'] . \"\\n\";\n\t\t\t$total += $cart['price'] * $cart['quantity'];\n\t\t}\n\n\t\t$emailMessage = $emailMessage . \"Montant : \" . $total . \"€\";\n\n\t\techo $emailMessage;\n\n\t\tforeach ($bdeMembers as $key => $bdeMember) {\n\t\t\tmail('[email protected]', \"Commande n°\" . '1', 'test');\n\t\t}*/\n\n\t\t// deletes the cart cookie\n\n\t\t// erase the cookie\n\t\tunset($_COOKIE['cart']);\n \t\tsetcookie('cart', '', time() - 3600);\n\n \t\treturn redirect()->route('cart', 'success');\n\t}", "function _processSale() {\n// \t\tAndroidHelper::write_log('braintree.txt', 'Payment_method_nonce: '.$_POST['payment_method_nonce']);\t\n\t\t$this->autoload();\n\t\t$input = JFactory::getApplication()->input;\n\t\t$order_id = $input->getString('order_number');\n\t\t\n\t\t$orderComplex = AndroidHelper::getOrderDetail($order_id);\n\t\tAImporter::classes('order');\n\t\t$order = new BookproOrder();\n\t\t\n\t\t$this->setConfig();\n\t\tif($this->sale($orderComplex)){\n\t\t\t$result = array(\n\t\t\t\t\t'status'=>1,\n\t\t\t\t\t'tx_id'=>$paymentId,\n\t\t\t\t\t'desc'=>$transaction[0]->description,\n\t\t\t\t\t'total'=>$transaction[0]->getAmount()->getTotal(),\n\t\t\t\t\t'currency'=>$transaction[0]->getAmount()->getCurrency(),\n\t\t\t\t\t'created'=>$payment->getCreateTime(),\n\t\t\t\t\t'method'=>$payment->getPayer()->getPaymentMethod()\n\t\t\t);\n\t\t\t$cardinfo = $payment->getPayer()->getFundingInstruments();\n\t\t\tif($cardinfo[0]){\n\t\t\t\t$result['card_info']['type'] = $cardinfo[0]->getCreditCardToken()->getType();\n\t\t\t\t$result['card_info']['last4'] = $cardinfo[0]->getCreditCardToken()->getLast4();\n\t\t\t}\n\t\t\treturn $result;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "public function captureOrder(\\TPkgShopPaymentTransactionManager $transactionManager, \\TdbShopOrder $order);", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function getInfoPayment()\n {\n $response = $this->client->request($this->methods['post'],'sandbox', [\n 'json' => [\n 'MERCHANT_TRANS_ID' => $this->merchant_trans_id,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->merchant_trans_id. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }", "function _prePayment( $data )\r\n {\r\n // prepare the payment form\r\n \r\n $app = JFactory::getApplication();\r\n $session = JFactory::getSession();\r\n \r\n// Gather Order Ids, amount, and variables \r\n\r\n $order_id = $data['order_id'];\r\n $orderpayment_id = $data['orderpayment_id'];\r\n $amount = $data['orderpayment_amount'];\r\n \r\n $merchant_id = $this->params->get(\"merchant_id\");\r\n $test_mode = $this->params->get(\"sandbox\");\r\n $xmlCollection = $this->params->get(\"xmlcollection\");\r\n\r\n// Check Test Mode has been enabled by the Merchant\r\nif ($test_mode == 1){\r\n\t$test_transaction = \"100\";\r\n}else{\r\n\t$test_transaction = \"\";\r\n}\r\n \r\n\t\tF0FTable::addIncludePath ( JPATH_ADMINISTRATOR . '/components/com_j2store/tables' );\r\n\t\t$order = F0FTable::getInstance ( 'OrderInfo', 'J2StoreTable' );\r\n\t\r\n// Get Product Details from the Shopping Cart\r\n\t\t$cart = F0FTable::getInstance('Cart', 'J2StoreTable')->getClone();\r\n\t\t\r\n\t\t\t\t$cartitem_model = F0FModel::getTmpInstance('Cartitems', 'J2StoreModel');\r\n\t\t\t\t$cartitem_model->setState('filter_cart', $data['orderpayment_id']);\r\n\t\t\t\t$items = $cartitem_model->getList();\r\n\t\t\t\t\r\n$products = array_unique($items, SORT_REGULAR);\r\n$xmlcollect = \"<items>\";\r\nforeach($products as &$item) {\r\n\t\r\n\t$description = \"Product ID: \" . $item->product_id . \", Product Name: \" . $item->sku . \", Product Quantity: \" . number_format($item->product_qty,0) . \", Product Price: \". number_format($item->price,2);\r\n\t$xmlcollect .= \"<item><id>\".$item->product_id.\"</id><name>\".$item->sku.\"</name><description>\".$item->sku.\"</description><quantity>\".number_format($item->product_qty,0).\"</quantity><price>\".number_format($item->price,2).\"</price></item>\";\r\n}\r\n$xmlcollect .= \"</items>\";\r\n\r\n// Check XML collection has been enabled by the Merchant\r\nif ($xmlCollection ==1){\r\n\r\n$description = \"Order created for: \" . $order_id;\r\n\r\n}else{\r\n\r\n$xmlcollect = \"\";\r\n\r\n}\r\n\r\n// Billing Address Details\r\n$billing_fullname = $order->billing_first_name . \", \" . $order->billing_last_name;\r\n$billing_address = $order->billing_address_1 . \", \" . $order->billing_address_2;\r\n$billing_city = $order->billing_city;\r\n$billing_postcode = $order->billing_zip;\r\n\r\n$delivery_fullname = $order->shipping_first_name . \", \" . $order->shipping_last_name;\r\n$delivery_address = $order->shipping_address_1 . \", \" . $order->shipping_address_2;\r\n$delivery_city = $order->shipping_city;\r\n$delivery_postcode = $order->shipping_zip;\r\n\r\n// Phone Number\r\n$customer_phone_number = $order->billing_phone_1;\r\n\r\n// Email Address\r\n$email_address = str_replace(\"{\",\"\",$order->all_billing);\r\n$email_address = str_replace(\"}\",\"\",$email_address);\r\n$email_address = str_replace(\":\",\"\",$email_address);\r\n$email_address = str_replace(\",\",\"\",$email_address);\r\n$email_address = str_replace('\"','',$email_address);\r\n$email_address = str_replace(\"emaillabelJ2STORE_EMAILvalue\",'',$email_address);\r\n\r\n$callback_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$success_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$cancel_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=carts&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n\r\n$html = \"<form action=\\\"https://secure.nochex.com/default.aspx\\\" method=\\\"post\\\" name=\\\"nochexForm\\\">\r\n <input type=\\\"hidden\\\" name=\\\"order_id\\\" value=\\\"\".$order_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"merchant_id\\\" value=\\\"\".$merchant_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"amount\\\" value=\\\"\".$amount.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"description\\\" value=\\\"\".$description.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"xml_item_collection\\\" value=\\\"\".$xmlcollect.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_fullname\\\" value=\\\"\".$billing_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_address\\\" value=\\\"\".$billing_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_city\\\" value=\\\"\".$billing_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_postcode\\\" value=\\\"\".$billing_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_fullname\\\" value=\\\"\".$delivery_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_address\\\" value=\\\"\".$delivery_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_city\\\" value=\\\"\".$delivery_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_postcode\\\" value=\\\"\".$delivery_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"customer_phone_number\\\" value=\\\"\".$customer_phone_number.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"email_address\\\" value=\\\"\".$email_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"callback_url\\\" value=\\\"\".$callback_url.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"test_success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"cancel_url\\\" value=\\\"\". $cancel_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"test_transaction\\\" value=\\\"\" .$test_transaction.\"\\\"> \r\n <input type=\\\"submit\\\" class=\\\"j2store_cart_button btn btn-primary\\\" value=\\\"Make a Payment\\\" /> \r\n</form>\";\r\n\r\n return $html;\r\n }", "public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }", "function payment_success()\n {\n\t\t\t/*log_message('INFO', 'Inside order2/payment_success');\n\t\t\t$this->morder->equateProductsQuantities();\n\t\t\tlog_message('INFO', 'end equateProductsQuantities()______________________________________________________');*/\n\t\t\t/* END ADDED BY SHAMMI SHAILAJ */\n\t\t\t\n //print \"<p>inside payments success</p>\";\n include('header_include.php');\n $data['email'] = $this->session->userdata('email');\n $this->session->unset_userdata('email');\n $txnid= $this->session->userdata('e_txn_id');\n $data['transID'] = $txnid;\n //print \"<p>transID = \".$txnid.\"</p>\";\n if(is_null($this->session->userdata('e_txn_id')) || strcmp($this->session->userdata('e_txn_id'), \"\") === 0)\n {\n $data['transID'] = NULL;\n }\n $this->session->unset_userdata('e_txn_id');\n \n //purchase email\n $this->load->model('vc_orders');\n /* following code added by shammi to generate data for sokrati and ecommerce tracking */\n if(!is_null($data['transID']))\n {\n $transDataDB = $this->vc_orders->orderDetails($data['transID']);\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n //exit();\n if($transDataDB !== FALSE)\n {\n $data['prodsCount'] = count($transDataDB);\n $data ['buyerFName'] = $transDataDB[0]->shipping_fname;\n $data ['buyerLName'] = $transDataDB[0]->shipping_lname;\n $data['buyerAddress'] = $transDataDB[0]->shipping_address;\n $data['buyerCity'] = $transDataDB[0]->shipping_city;\n $data['buyerPinCode'] = $transDataDB[0]->shipping_pincode;\n $data['buyerState'] = $transDataDB[0]->shipping_state;\n $data['buyerCountry'] = $transDataDB[0]->shipping_country;\n $data['buyerUserID'] = $transDataDB[0]->user_id;\n $data['tax'] = 0;\n $grandTotal = 0;\n $products = array();\n if(is_array($products))\n {\n for($j=0;$j < $data['prodsCount']; $j++)\n {\n $product = new productInfo;\n $product->storeID = $transDataDB[$j]->store_id;\n $product->storeName = $transDataDB[$j]->store_name;\n $order_no = $transDataDB[$j]->order_id;\n $product->orderID = $transDataDB[$j]->order_id;\n $product->productName = $transDataDB[$j]->product_name;\n $product->vSize = $transDataDB[$j]->vsize;\n $product->vColor = $transDataDB[$j]->vcolor;\n $product->unitPrice = $transDataDB[$j]->amt_paid;\n $product->quantity = $transDataDB[$j]->quantity;\n $grandTotal += $transDataDB[$j]->amt_paid * $transDataDB[$j]->quantity;\n $product->productID = $transDataDB[$j]->product_id; \n $product->cid = $transDataDB[$j]->couponid;\n $products[$j] = $product;\n /* ADDED BY SHAMMI SHAILAJ to keep quantities in the new and old products table EQUAL (NEW METHOD)*/\n\t\t\t\t\t\t\t//log_message('INFO', 'Inside order2/payment_success');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' => 1, 'msg' => 'Inside order2/payment_success'));\n\t\t\t\t\t\t\t$this->morder->equateProductsQuantities2($product->productID);\n\t\t\t\t\t\t\t//log_message('INFO', 'end equateProductsQuantities2()______________________________________________________');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' =>1, 'msg' => 'end equateProductsQuantities2()______________________________________________________'));\n /* END ADDED BY SHAMMI SHAILAJ */\n }\n }\n else\n {\n $product = new productInfo;\n $product->storeID = $transDataDB->store_id;\n $product->storeName = $transDataDB->store_name;\n $order_no = $transDataDB->order_id;\n $product->orderID = $transDataDB->order_id;\n $product->productName = $transDataDB->product_name;\n $product->vSize = $transDataDB->vsize;\n $product->vColor = $transDataDB->vcolor;\n $product->unitPrice = $transDataDB->amt_paid;\n $product->quantity = $transDataDB->quantity;\n $product->productID = $transDataDB->product_id;\n $product->cid = $transDataDB->couponid;\n $grandTotal += $transDataDB->amt_paid * $transDataDB->quantity;\n $products[] = $product;\n }\n $data['grandTotal'] = $grandTotal;\n $data['products'] = $products;\n }\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n }\n /* end code added by shammi to generate data for sokrati and ecommerce tracking */\n $base_url = base_url();\n $ip_address = (string)$this->input->ip_address();\n //log_message('Info',\"Ipaddress = $ip_address\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Ipaddress = $ip_address\"));\n if($ip_address!='127.0.0.1')\n {\n //log_message('Info',\"Allow mail as the Ip is not 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' =>1, 'msg' => \"Allow mail as the Ip is not 127.0.0.1\"));\n $mail_info = $this->vc_orders->purchaseMailDetails($txnid);\n $this->slog->write(array('level' =>1 ,'msg' => \"mail_info FROM ORDERS2/PAYMENT_SUCCESS_____\".print_r($mail_info, TRUE)));\n if($mail_info!=0)\n {\n $count_prod = count($mail_info);\n $buyer_name = $mail_info[0]['shipping_fname'].' '.$mail_info[0]['shipping_lname'];\n $shipping_address = $mail_info[0]['shipping_address'];\n $shipping_city = $mail_info[0]['shipping_city'];\n $pin_code = $mail_info[0]['shipping_pincode'];\n $couponcode = $mail_info[0]['couponid'];\n $payment_mode = $mail_info[0]['pg_type'];\n if ($payment_mode=='COD')\n {\n $payment_mode = 'Cash on Delivery';\n }\n elseif ($payment_mode=='CC')\n {\n $payment_mode = 'Credit Card';\n }\n elseif ($payment_mode=='DC')\n {\n $payment_mode = 'Debit Card';\n }\n elseif ($payment_mode=='NB')\n {\n $payment_mode = 'Net Banking';\n }\n \n for($j=0;$j<$count_prod;$j++)\n {\n $order_no = $mail_info[$j]['order_id'];\n $product_name = $mail_info[$j]['product_name'];\n $variant_size = \"Size: \".$mail_info[$j]['variant_size'];\n $variant_color = \"Color: \".$mail_info[$j]['variant_color'];\n $variant_details = \"\";\n $this->slog->write(array('level' => 1,'msg' => \"INDEX MAIL VALUE\".print_r($mail_info[$j]['sent_email_id'],TRUE)));\n if ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \"\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \" - (\".$variant_size.\")\";\n }\n elseif ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_color.\")\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_size.\",\".$variant_color.\")\";\n }\n $process_days = (int)$mail_info[$j]['process_days'];\n $productImagePath = './assets/images/stores/'.$mail_info[$j]['store_id'].'/'.$mail_info[$j]['product_id'].'/';\n if(file_exists($productImagePath.'fancy3.jpg'))\n {\n $productImage = $productImagePath.'fancy3.jpg';\n }\n elseif(file_exists($productImagePath.'fancy3.JPG'))\n {\n $productImage = $productImagePath.'fancy3.JPG';\n }\n else\n {\n $productImage = '';\n }\n //log_message('INFO', 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']));\n include 'mail_4.php';\n //Buyer Purchase Email\n $this->load->model('automate_model');\n\t\t\t\t\t\t\t$jobType = 1; // an email job\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate email\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 66); // current time + 1 minute 6 seconds\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => $mail_info[$j]['sent_email_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $purchase_message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>An Email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A (P)', $jobScheduledTime).\" </p>\" ) );\n\n\t\t\t\t\t\t\t$smsMsg = \"Dear \".$mail_info[$j]['shipping_fname'].' '.$mail_info[$j]['shipping_lname'].\", \\r\\n Thank you for placing an order with us. Your order ID \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$smsMsg .= \" will be dispatched by \".date( \"d-M-Y\", ( strtotime($mail_info[$j]['date_of_pickup']) ) ).\". Once dispatched, it will reach you in 1-5 working days. Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$smsNo = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\tif($smsNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$smsNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->load->model('smsc');\n\t\t\t\t\t\t\t$this->smsc->sendSMS($smsNo, $smsMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent an SMS to '.json_encode($smsNo).'. The msg sent is <p>'.$smsMsg.'</p>' ) );\n\n\t\t\t\t\t\t\t// now set an email job to be executed only after 24 hours if the seller has not sent the mail\n\t\t\t\t\t\t\t$orderEmail11Data = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerName'] = $mail_info[$j]['owner_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['orderID'] = $mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['dispatchDate'] = $mail_info[$j]['date_of_pickup'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerEmail'] = $mail_info[$j]['contact_email'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeName'] = $mail_info[$j]['store_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productName'] = $mail_info[$j]['product_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productID'] = $mail_info[$j]['product_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['bnbProductCode'] = $mail_info[$j]['bnb_product_code'];\n\t\t\t\t\t\t\t$orderEmail11Data['amountPaid'] = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n\t\t\t\t\t\t\t$orderEmail11Data['paymentType'] = $mail_info[$j]['pg_type'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerName'] = $mail_info[$j]['shipping_fname'].\" \".$mail_info[$j]['shipping_lname'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerAddress'] = $mail_info[$j]['shipping_address'].\"<br/>\".$mail_info[$j]['shipping_city'].\"<br/>\".$mail_info[$j]['shipping_pincode'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerContactNumber'] = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\t$orderEmail11Data['processingTime'] = $mail_info[$j]['process_days'];\n\n\t\t\t\t\t\t\t$orderEmail11 = $this->load->view('emailers/orderEmail11', $orderEmail11Data, TRUE);\n\n\t\t\t\t\t\t\t$jobType = 4; // a check and then send email job depending upon the result of the check\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate index\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 86460); // current time + 1 day (24 hrs 1 minute)\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'orderID' => $order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => ( (empty($mail_info[$j]['contact_email']) )? $mail_info[$j]['contact_email'] : '[email protected]'),\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $orderEmail11\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>A check and then email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A T (P)', $jobScheduledTime).\" </p>\" ) );\n\t\t\t\t\t\t\t/* OLD EMAIL SENDING CODE\n $this->load->library('email');\n $mailArraylog = array();\n $this->email->from('[email protected]','BuynBrag');\n $this->email->to($mail_info[$j]['sent_email_id']);\n $this->email->bcc('[email protected],[email protected]');\n $this->email->subject(\"BuynBrag: Order Success,Order Id:$order_no\");\n\n $this->email->message($purchase_message);\n $this->email->set_newline(\"\\r\\n\");\n if($this->email->send())\n {\n log_message('Info', 'SUCCESSFULLY SENT EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $mailArraylog = array('level' => 1, 'send status' => 1,'to' => $mail_info[$j]['sent_email_id'],'bcc' =>'[email protected],[email protected]','From' => '[email protected]','mail content' => $purchase_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog);\n }\n else\n {\n log_message('Info', 'FAILED SENDING EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n }*/\n\n //////////////////////////////\n $owner_name = $mail_info[$j]['owner_name'];\n $owner_email = $mail_info[$j]['contact_email'];\n $total_amount = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n include 'mail_7.php';\n\n $sellerSMSMsg = \"Dear \".$mail_info[$j]['owner_name'].\", \\r\\n You have recieved a new order for \".$mail_info[$j]['product_name'].\". The order ID is \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$sellerSMSMsg .= \" and the quantity ordered is \".$mail_info[$j]['quantity'].\". Please make sure that the product is dispatched by \".date( \"d-M-Y\", ( ( strtotime($mail_info[$j]['date_of_pickup']) ) - 86400) ).\". Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$sellerSMSNo = $mail_info[$j]['contact_number'];\n\t\t\t\t\t\t\tif($sellerSMSNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sellerSMSNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->smsc->sendSMS($sellerSMSNo, $sellerSMSMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent seller SMS to '.json_encode($sellerSMSNo).'. The msg sent is <p>'.$sellerSMSMsg.'</p>' ) );\n\n //Seller New Order Email\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$config['protocol'] = 'smtp';\n\t\t\t\t\t\t\t$config['smtp_host'] = 'ssl://smtp.googlemail.com';\n\t\t\t\t\t\t\t$config['smtp_port'] = 465;\n\t\t\t\t\t\t\t$config['smtp_user'] = '[email protected]';\n\t\t\t\t\t\t\t$config['smtp_pass'] = '';*/\n\n $this->load->library('email');\n $mailArraylog2 = array();\n $this->email->clear(TRUE);\n $this->email->from('[email protected]','BuynBrag');\n if(empty($owner_email))\n {\n \t//log_message('INFO', 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]');\n \t$this->load->model('slog');\n \t$this->slog->write(array('level' => 1 , 'msg' => 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]'));\n $owner_email = '[email protected]';\n }\n\n $this->email->to($owner_email);\n $this->email->bcc('[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]');\n $this->email->subject(\"New Order from BuynBrag,Order Id:\".$order_no);\n $this->email->message($new_order_message);\n $this->email->attach('./invoice/'.$txnid.'/buyer_invoice_order_'.$order_no.'.pdf');\n \n if(!empty($productImage))\n {\n $this->email->attach($productImage);\n }\n\n $this->email->set_newline(\"\\r\\n\");\n \n if($this->email->send())\n {\n //log_message('Info',\"Seller eMail sent to $owner_email for order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => \"Seller eMail sent to $owner_email for order no: $order_no\" ));\n $mailArraylog2 = array('level' => 1, 'send status' => 1,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n if($j==($count_prod-1))\n {\n $this->vc_orders->purchase_mail_success($txnid);\n }\n }\n else\n {\n //log_message('Info',\"ERROR occurred while sending Seller email to $owner_email order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write( array('level' => 1, 'msg' => \"ERROR occurred while sending Seller email to $owner_email order no: \".$order_no, 'debug' => $this->email->print_debugger() ) );\n $mailArraylog2 = array('level' => 1, 'send status' => 0,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n \n }\n $this->email->clear(TRUE);\n //end email send\n }//end for\n \n }//end if mail_info !=0\n }\n else\n {\n log_message('Info',\"Don't Allow mail as the Ip is 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Don't Allow mail as the Ip is 127.0.0.1\"));\n }\n $this->load->view('order_success',$data);\n }", "public function joinPaymentInfo();", "abstract protected function handlePayment();", "public function finishAction() {\r\n if ($this->Request()->getParam('sUniqueID') && !empty($this->session['sOrderVariables'])) {\r\n $sql = '\r\n SELECT transactionID as sTransactionumber, ordernumber as sOrderNumber\r\n FROM s_order\r\n WHERE temporaryID=? AND userID=?\r\n ';\r\n\r\n $order = Shopware()->Db()->fetchRow($sql, array($this->Request()->getParam('sUniqueID'), Shopware()->Session()->sUserId));\r\n if (!empty($order)) {\r\n $this->View()->assign($order);\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $orderVariables = $this->session['sOrderVariables']->getArrayCopy();\r\n\r\n $userData = $this->View()->sUserData;\r\n $userData[\"billingaddress\"]['country'] = $this->getCountryById($userData[\"billingaddress\"][\"countryID\"]);\r\n $userData[\"shippingaddress\"]['country'] = $this->getCountryById($userData[\"shippingaddress\"][\"countryID\"]);\r\n $this->View()->sUserData = $userData;\r\n\r\n $orderVariables['sAddresses']['billing'] = $this->View()->sUserData[\"billingaddress\"];\r\n $orderVariables['sAddresses']['shipping'] = $this->View()->sUserData[\"shippingaddress\"];\r\n $orderVariables['sAddresses']['equal'] = $this->areAddressesEqual($orderVariables['sAddresses']['billing'], $orderVariables['sAddresses']['shipping']);\r\n\r\n $this->View()->assign($orderVariables);\r\n } else {\r\n $this->View()->assign($this->session['sOrderVariables']->getArrayCopy());\r\n }\r\n return;\r\n }\r\n }\r\n\r\n if (empty($this->session['sOrderVariables'])||$this->getMinimumCharge()||$this->getEsdNote()||$this->getDispatchNoOrder()) {\r\n return $this->forward('confirm');\r\n }\r\n\r\n $checkQuantities = $this->basket->sCheckBasketQuantities();\r\n if (!empty($checkQuantities['hideBasket'])) {\r\n return $this->forward('confirm');\r\n }\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $orderVariables = $this->session['sOrderVariables']->getArrayCopy();\r\n\r\n $userData = $this->View()->sUserData;\r\n $userData[\"billingaddress\"]['country'] = $this->getCountryById($userData[\"billingaddress\"][\"countryID\"]);\r\n $userData[\"shippingaddress\"]['country'] = $this->getCountryById($userData[\"shippingaddress\"][\"countryID\"]);\r\n $this->View()->sUserData = $userData;\r\n\r\n $orderVariables['sAddresses']['billing'] = $this->View()->sUserData[\"billingaddress\"];\r\n $orderVariables['sAddresses']['shipping'] = $this->View()->sUserData[\"shippingaddress\"];\r\n $orderVariables['sAddresses']['equal'] = $this->areAddressesEqual($orderVariables['sAddresses']['billing'], $orderVariables['sAddresses']['shipping']);\r\n $this->View()->assign($orderVariables);\r\n } else {\r\n $this->View()->assign($this->session['sOrderVariables']->getArrayCopy());\r\n }\r\n\r\n if ($this->basket->sCountBasket()>0\r\n && empty($this->View()->sUserData['additional']['payment']['embediframe'])) {\r\n if ($this->Request()->getParam('sNewsletter')!==null) {\r\n $this->session['sNewsletter'] = $this->Request()->getParam('sNewsletter') ? true : false;\r\n }\r\n //if ($this->Request()->getParam('sComment')!==null) {\r\n $this->session['sComment'] = trim(strip_tags($this->Request()->getParam('sComment')));\r\n //}\r\n if (!empty($this->session['sNewsletter'])) {\r\n $this->admin->sUpdateNewsletter(true, $this->admin->sGetUserMailById(), true);\r\n }\r\n $orderVariables = $this->saveOffer();\r\n }\r\n $this->View()->assign('sKUZOOffer', true);\r\n\r\n $this->View()->assign($orderVariables->getArrayCopy());\r\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "function __getCustomerDetail(){\n \t\t\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\t\t\n\t\t$customer_id = $this->session->userdata['pos_customer_id']; //get customer id from session\n\t\t\n\t\t$saldo_status = $this->payments_model->getSaldostatus($customer_id);\n\t\t$this->data['visible']['saldo_status'] = $saldo_status;\n\t\t\n\t\t\n\t\t//get results\n\t\t$this->data['reg_fields'][] = 'customer';\n\t\t$this->data['fields']['customer'] = $this->customer_model->getCustomerinfo($customer_id);\n\t\t$this->data['debug'][] = $this->customer_model->debug_data;\n\t\t\n\t\t$this->data['lists']['customer_name'] = $this->data['fields']['customer']['firstname'];\n\t\tif(count($this->data['fields']['customer'])> 0){\n\t\t\t$this->data['visible']['wi_customer_profile'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$this->data['visible']['wi_profile_none'] = 0;\n\t\t}\n\t\t\n\t\t$customer=$this->session->userdata['customer']['id'];\n\t\t$data = $this->payments_model->getAccountBalance($customer);\n\t\t$pendingsaldo = $data['pending'];\n\t\t$paidsaldo = $data['paid'];\n\t\t\t\n\t\tif(intval($pendingsaldo) > 0)\n\t\t{\t\n\t\t\t$amount= formatcurrency($paidsaldo).' ('.formatcurrency($pendingsaldo).')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amount= formatcurrency($paidsaldo);\n\t\t}\n\t\t$this->data['lists']['saldo']=$amount;\n\n\t\tif($paidsaldo < 0)\n\t\t{\n\t\t\t$this->data['lists']['saldocolor']='style=\"color:red;\"';\n\t\t}\n\t\t\n\t\t\n\t\t//get utlevering count for a customer\n\t\t$this->data['reg_blocks'][] = 'orders';\n\t\t$this->data['blocks']['orders'] = $this->orders_model->getCustomerOrderhistory($customer_id,'utlevering');\n\t\t$this->data['debug'][] = $this->orders_model->debug_data;\n\t\t\n\t\t$this->data['vars']['order_count'] = count($this->data['blocks']['orders']);\n\t\t\n\t\t\n\t }", "function fetch_customer_data($connect)\n{\t\n\t$totalprice=0;\n $query = \"SELECT * FROM PAYMENT5\";\n \n //oci_parse ( resource $connect , string $sql_text ) \n //oci_fetch ( resource $statement ) : bool\n\t$statement = $connect->prepare($query);\n\t$statement->execute();\n\t$result = $statement->fetchAll();\n\t$output = '\n \n <div class=\"invoice-box\">\n <table cellpadding=\"0\" cellspacing=\"0\">\n <tr class=\"top\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td class=\"title\">\n <img src=\"logo.png\" style=\"width:70%; max-width:70px;\">\n </td>\n \n <td>\n Invoice #: 123<br>\n Created: January 1, 2015<br>\n Due: February 1, 2015\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"information\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td>\n Sparksuite, Inc.<br>\n 12345 Sunny Road<br>\n Sunnyville, CA 12345\n </td>\n \n <td>\n Acme Corp.<br>\n John Doe<br>\n [email protected]\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Payment Method\n </td>\n \n <td>\n Check #\n </td>\n </tr>\n \n <tr class=\"details\">\n <td>\n Check\n </td>\n \n <td>\n 1000\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Item\n </td>\n \n <td>\n Price\n </td>\n </tr>\n \n \n \n\n\t';\n\tforeach($result as $row)\n\t{\n\t\t$output .= '\n\n\n\t\t<tr class=\"item\">\n <td>\n '.$row[\"PNAME\"].'\n\n </td>\n <td>\n '.$row[\"PQTY\"].'\n\n </td>\n \n <td>\n '.$row[\"TOTAL\"].'\n </td>\n </tr>\n\t\t\t\n\t\t';\n\n\n\t\t$totalprice=$totalprice+$row[\"TOTAL\"];\n\t}\n\n\t$output .= '\n <tr class=\"total\">\n <td></td>\n \n <td>\n Total: '.$totalprice.'\n </td>\n </tr>\n\t\n\t';\n\n\t$output .= '\n\n\t\t</table>\n\t</div>\n\t';\n\treturn $output;\n\n\n}", "public function generateContentForBuyerPaymentConfirmation($order) {\n// \t\t$itineraryBrief = $megahelper->getItineraryBrief( $order ['itinerary'] );\n\t\t\n\t\t// $subject = \"BTCTrip - We are booking your ticket - \" . $itineraryBrief;\n\t\t$content = $this->get( 'templating' )->render( $this->purchaseConfirmationTemplate, array(\n\t\t\t\t'order' => $order\n\t\t) );\n\t\t\n\t\treturn $content;\n\t}", "public function getCheckoutForm(){\r\n\r\n $form='\r\n <form id=\"paypal_checkout\" action=\"https://www.sandbox.paypal.com/cgi-bin/webscr\" method=\"post\">';\r\n\r\n //==> Variables defining a cart, there shouldn't be a need to change those <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"cmd\" value=\"_cart\" />\r\n <input type=\"hidden\" name=\"upload\" value=\"1\" />\t\t\t\r\n <input type=\"hidden\" name=\"no_note\" value=\"0\" />\t\t\t\t\t\t\r\n <input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF\" />\t\t\t\t\t\r\n <input type=\"hidden\" name=\"tax\" value=\"0\" />\t\t\t\r\n <input type=\"hidden\" name=\"rm\" value=\"2\" />';\r\n \r\n //==> Personnalised variables, they get their values from the specified settings nd the class attributes <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"business\" value=\"'.$this->business.'\" />\r\n <input type=\"hidden\" name=\"handling_cart\" value=\"'.$this->shipping.'\" />\r\n <input type=\"hidden\" name=\"currency_code\" value=\"'.$this->currency.'\" />\r\n <input type=\"hidden\" name=\"lc\" value=\"'.$this->location.'\" />\r\n <input type=\"hidden\" name=\"return\" value=\"'.$this->returnurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"cbt\" value=\"'.$this->returntxt.'\" />\r\n <input type=\"hidden\" name=\"cancel_return\" value=\"'.$this->cancelurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"custom\" value=\"'.$this->custom.'\" />';\r\n\r\n //==> The items of the cart <==//\r\n $cpt=1;\r\n if(!empty($this->items)){foreach($this->items as $item){\r\n $form.='\r\n <div id=\"item_'.$cpt.'\" class=\"itemwrap\">\r\n <input type=\"hidden\" name=\"item_name_'.$cpt.'\" value=\"'.$item['name'].'\" />\r\n <input type=\"hidden\" name=\"quantity_'.$cpt.'\" value=\"'.$item['quantity'].'\" />\r\n <input type=\"hidden\" name=\"amount_'.$cpt.'\" value=\"'.$item['price'].'\" />\r\n <input type=\"hidden\" name=\"shipping_'.$cpt.'\" value=\"'.$item['shipping'].'\" />\r\n </div>';\r\n $cpt++;\r\n }}\r\n\r\n //==> The submit button, (you can specify here your own button) <==//\r\n $form.='\r\n <input id=\"ppcheckoutbtn\" type=\"submit\" value=\"Checkout\" class=\"button\" />\r\n </form>';\r\n\r\n return $form;\r\n }", "public function getPaymentUrl($id_order)\n {\n \n $x_fp_timestamp = time();\n $order = new Order($id_order);\n $cart = new Cart($order->id_cart);\n \n $currency = new Currency($order->id_currency);\n $order_id = $order->id;\n $description = $this->l('Payment order ') . ' №' . $order_id;\n $paysto_merchant_id = ConfPPM::getConf('paysto_merchant_id');\n $x_relay_url = _PS_BASE_URL_.__PS_BASE_URI__.'module/paysto/result';\n \n $order_amount = number_format(($order->total_products_wt + $order->total_shipping_tax_incl), 2, '.', '');\n \n // Not right RUR for rubles iso_code = RUB\n $iso_code = $currency->iso_code;\n if ($iso_code == 'RUR') {\n $iso_code = 'RUB';\n }\n \n $address = new Address($cart->id_address_delivery);\n $customer = new Customer($order->id_customer);\n \n $products = $cart->getProducts(true);\n \n foreach ($products as &$product) {\n $price_item_with_tax = Product::getPriceStatic(\n $product['id_product'],\n true,\n $product['id_product_attribute']\n );\n $price_item_with_tax = number_format(\n $price_item_with_tax,\n 2,\n '.',\n ''\n );\n \n $product['price_item_with_tax'] = $price_item_with_tax;\n \n \n if (!ConfPPM::getConf('disable_tax_shop')) {\n if (Configuration::get('PS_TAX')) {\n $rate = $product['rate'];\n switch ($rate) {\n case 10:\n $product['tax_value'] = 'Y';\n break;\n case 18:\n $product['tax_value'] = 'Y';\n break;\n case 20:\n $product['tax_value'] = 'Y';\n break;\n default:\n $product['tax_value'] = 'N';\n }\n } else {\n $product['tax_value'] = 'N';\n }\n } else {\n $product['tax_value'] = $this->getProductTax($product['id_product']);\n }\n }\n \n $params = [\n 'x_description' => $description,\n 'x_login' => $paysto_merchant_id,\n 'x_amount' => $order_amount,\n 'x_email' => $customer->email,\n 'x_currency_code' => $iso_code,\n 'x_fp_sequence' => $order_id,\n 'x_fp_timestamp' => $x_fp_timestamp,\n 'x_fp_hash' => $this->get_x_fp_hash($paysto_merchant_id, $order_id, $x_fp_timestamp,\n $order_amount, $iso_code),\n 'x_invoice_num' => $order_id,\n 'x_relay_response' => \"TRUE\",\n 'x_relay_url' => $x_relay_url\n ];\n \n $params['x_line_item'] = '';\n \n if (is_array($products) && count($products)) {\n $tax_value_shipping = ConfPPM::getConf('tax_delivery');\n $products = $cart->getProducts(true);\n foreach ($products as $pos => $product) {\n if (!ConfPPM::getConf('disable_tax_shop')) {\n $carrier = new Carrier((int)$cart->id_carrier);\n \n $tax_value = 'no_vat';\n if (Configuration::get('PS_TAX')) {\n $rate = $carrier->getTaxesRate($address);\n switch ($rate) {\n case 10:\n $tax_value = 'Y';\n break;\n case 18:\n $tax_value = 'Y';\n break;\n case 20:\n $tax_value = 'Y';\n break;\n default:\n $tax_value = 'N';\n }\n }\n } else {\n $tax_value = ConfPPM::getConf('tax_delivery');\n }\n \n $lineArr = array();\n $lineArr[] = '№' . $pos . \" \";\n $lineArr[] = substr($product['id_product'], 0, 30);\n $lineArr[] = substr($product['name'], 0, 254);\n $lineArr[] = substr($product['cart_quantity'], 0, 254);\n $lineArr[] = number_format($product['price_wt'], 2, '.', '');\n $lineArr[] = $tax_value;\n $params['x_line_item'] .= implode('<|>', $lineArr) . \"0<|>\\n\";\n }\n \n if ($order->total_shipping_tax_incl) {\n $pos++;\n $lineArr = array();\n $lineArr[] = '№' . $pos . \" \";\n $lineArr[] =$this->l('Shipping');\n $lineArr[] = $this->l('Shipping') .' '. $order_id;\n $lineArr[] = 1;\n $lineArr[] =number_format($order->total_shipping_tax_incl, 2,\n '.', '');\n $lineArr[] = $tax_value_shipping;\n $params['x_line_item'] .= implode('<|>', $lineArr) . \"0<|>\\n\";\n }\n }\n \n return ['url' => $this->url, 'params' => $params];\n \n }", "public function getPayPalResponse(){\r\n\t\t\r\n\t}", "public function _build_CustomerInsertObject($customer=NULL, $order=NULL){\n\t\tif(isset($order)){\n\n\t\t\t//LOAD QUOTE BILLING ADDRESS AS PRIMARY ACCOUNT ID\n\t\t\t$primaryAddress = $order->getBillingAddress();\n\n\t\t\t//CHECK IF CUSTOMER NAME IS GUEST NULL IF SO USE BILLING NAME\n\t\t\tif($order->getCustomerFirstname() != NULL){\n\t\t\t\t//CHECK AND BUILD CUSTOMER NAME - MUST LESS THEN 30 CHARS\n\t\t\t\t$custname = $order->getCustomerFirstname().' '.$order->getCustomerLastname();\n\t\t\t\tif(strlen($custname) > 30){\n\t\t\t\t\t$custname = substr($custname, 0, 30);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//LOAD BILLING NAME\n\t\t\t\t$custname = $primaryAddress->getFirstname().' '.$primaryAddress->getLastname();\n\t\t\t\tif(strlen($custname) > 30){\n\t\t\t\t\t$custname = substr($custname, 0, 30);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//FORMAT PRIMARY CUSTOMER ADDRESS LINE4-LINE5 BY COUNTRY RULES\n\t\t\tswitch($primaryAddress->getCountryId()){\n\t\t\t\tcase \"CA\":\n\t\t\t\t\t//MEASURE CITY CHARS\n\t\t\t\t\t$primaryAddressCharCount = strlen($primaryAddress->getCity());\n\t\t\t\t\t//CHECK IF COUNT IS GREATER OR EQUAL >= 27\n\t\t\t\t\tif($primaryAddressCharCount >= 27){\n\t\t\t\t\t\t$primaryAddress_city = substr($primaryAddress->getCity(), 0, 27);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$primaryAddress_city = str_pad($primaryAddress->getCity(), 27);\n\t\t\t\t\t}\n\t\t\t\t\t$primaryAddress_stateLocation = $primaryAddress->getRegionCode();\n\t\t\t\t\t$primaryAddress_line4 = $primaryAddress_city.' '.$primaryAddress->getRegionCode();\n\t\t\t\t\t$primaryAddress_line5 = strtoupper($primaryAddress->getCountryModel()->getName()).' '.$primaryAddress->getPostcode();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"US\":\n\t\t\t\t\t$primaryAddress_stateLocation = $primaryAddress->getRegionCode();\n\t\t\t\t\t$primaryAddress_line4 = $primaryAddress->getCity();\n\t\t\t\t\t$primaryAddress_line5 = $primaryAddress->getRegionCode().', '.$primaryAddress->getPostcode();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$primaryAddress_stateLocation = '';\n\t\t\t\t\t$primaryAddress_line4 = $primaryAddress->getCity().' '.($primaryAddress->getRegionCode() ?: $primaryAddress->getRegion());\n\t\t\t\t\t$primaryAddress_line5 = $primaryAddress->getPostcode();\n\t\t\t}\n\t\t\t\n\t\t\t//LOAD CURRENT STORE SAO CODE\n\t\t\t$store_sao = Mage::getStoreConfig('vistaprocessing_section/vistaprocessing_group/vistaprocessing_saocode', $order->getStoreId());\n\t\t\t\n\t\t\t$xml_data = '<CustApp>\n\t\t\t <Parameters Option=\"N\" Identifier=\"consumerweb\" PreAuth=\"Y\" DefaultMask=\"CA\" WebSiteId=\"'.$store_sao.'\"/>\n\t\t\t <Records>\n\t\t\t <Item>\n\t\t\t <IdentifierSection>\n\t\t\t <Identifier>consumerweb</Identifier>\n\t\t\t <Type/>\n\t\t\t <Suffix/>\n\t\t\t <MasterCust/>\n\t\t\t <Cust/>\n\t\t\t <AltAddressFile/>\n\t\t\t <MailCust/>\n\t\t\t <WebSiteId>'.$store_sao.'</WebSiteId>\n\t\t\t <DevToken/>\n\t\t\t </IdentifierSection>\n\t\t\t <Controls/>\n\t\t\t <Individuals>\n\t\t\t <Title/>\n\t\t\t <TitleCode/>\n\t\t\t <Initials/>\n\t\t\t <Forename/>\n\t\t\t <Surname/>\n\t\t\t <JobTitle/>\n\t\t\t <Email1><![CDATA['.$order->getCustomerEmail().']]></Email1>\n\t\t\t <Email2/>\n\t\t\t <Telephone1><![CDATA['.$primaryAddress->getTelephone().']]></Telephone1>\n\t\t\t <Telephone2/>\n\t\t\t <Telephone3/>\n\t\t\t <Fax1><![CDATA['.$primaryAddress->getFax().']]></Fax1>\n\t\t\t <AgreeToOffers/>\n\t\t\t </Individuals>\n\t\t\t <Company>\n\t\t\t <BusinessName/>\n\t\t\t </Company>\n\t\t\t <Address>\n\t\t\t <HouseName/>\n\t\t\t <HouseNumber/>\n\t\t\t <Street/>\n\t\t\t <Floor/>\n\t\t\t <LocalDistrict/>\n\t\t\t <County/>\n\t\t\t <Town/>\n\t\t\t <SpecialInfo>YYYY</SpecialInfo>\n\t\t\t <State><![CDATA['.$primaryAddress_stateLocation.']]></State>\n\t\t\t <PoBox/>\n\t\t\t <PostalCode><![CDATA['.$primaryAddress->getPostcode().']]></PostalCode>\n\t\t\t <CountryCode><![CDATA['.$primaryAddress->getCountryId().']]></CountryCode>\n\t\t\t <Country/>\n\t\t\t <Line1/>\n\t\t\t <Line2/>\n\t\t\t <Line3/>\n\t\t\t <Brick/>\n\t\t\t <AddressLevel>1</AddressLevel>\n\t\t\t </Address>\n\t\t\t <Additional/>\n\t\t\t <CusmasSection>\n\t\t\t <Name><![CDATA['.$custname.']]></Name>\n\t\t\t <AddressLine1><![CDATA['.$primaryAddress->getStreet1().']]></AddressLine1>\n\t\t\t <AddressLine2><![CDATA['.$primaryAddress->getStreet2().']]></AddressLine2>\n\t\t\t <AddressLine3><![CDATA['.$primaryAddress->getStreet3().']]></AddressLine3>\n\t\t\t <AddressLine4><![CDATA['.$primaryAddress_line4.']]></AddressLine4>\n\t\t\t <AddressLine5><![CDATA['.$primaryAddress_line5.']]></AddressLine5>\n\t\t\t <PostalCode><![CDATA['.$primaryAddress->getPostcode().']]></PostalCode>\n\t\t\t </CusmasSection>\n\t\t\t </Item>\n\t\t\t </Records>\n\t\t\t</CustApp>';\n\t\t\t$data = array('Input'=> (string) $xml_data);\n\t\t\treturn $data;\n\t\t}\n\t}", "public function paypalCreateOrder(SessionInterface $session) {\n\n $clientId = \"AZvdHvxArQ6e9N1xtCO-Hc8X6oFGVxizZfnkJvDEYGF4zP727c1NjVD5lGbbDxi4QjGraqrFQ_cxcZNm\";\n $clientSecret = \"EANsINF_SmRiv25XBD0g5dIDdKmcoQCIpiaGhcazF45itNfSSW1t-Hm1NXoF5C7QxCt094i8KjaCGgn8\";\n $env = new SandboxEnvironment($clientId,$clientSecret);\n $client = new PayPalHttpClient($env);\n $req = new OrdersCreateRequest();\n $req->prefer('return=representation');\n\n // Get Orders from cart\n /** @var Cart|null $cart */\n if ($session->has('CART') === true) {\n $cart = $session->get('CART');\n }\n if (null === $cart) {\n throw new $this->createNotFoundException();\n }\n if($cart->getCartLines()->count() == 0){\n throw new $this->createNotFoundException();\n }\n $lines = $cart->getCartLines();\n $items = [];\n $menuName=\"\";\n $qty = 1;\n $description = \"\";\n $currency = \"USD\";\n /*switch ($city = $session->get('CART')) {\n case \"Morroco\":\n $currency ='MAD';\n break;\n case \"Canada\":\n $currency='USD';\n break;\n default:\n $currency='USD';\n }*/\n foreach ($lines as $line) {\n /** @var Variant|null $variant */\n $variant = $line->getVariant();\n $qty= $line->getQuantity();\n $price = $variant->getPrice();\n $description = $variant->getSize();\n\n /** @var User|null $restaurant */\n if ($variant->getMenu() != null) {\n $restaurant = $variant->getMenu()->getUser();\n $menuName = $variant->getMenu()->getName();\n } elseif ($variant->getSubMenu() != null) {\n $restaurant = $variant->getSubMenu()->getMenu()->getUser();\n $menuName = $variant->getSubMenu()->getName();\n } else {\n throw new NotFoundHttpException();\n }\n\n $item = [\n 'name' => $menuName,\n 'description' => $description,\n 'unit_amount' =>\n [\n 'currency_code' => $currency,\n 'value' => $price,\n ],\n 'quantity' => $qty,\n ];\n $items[]= $item;\n }\n $req->body = array(\n 'intent' => 'CAPTURE',\n 'application_context' =>\n array(\n 'brand_name' => 'Foodepia',\n 'landing_page' => 'BILLING',\n 'user_action' => 'PAY_NOW',\n ),\n 'purchase_units' =>\n array(\n 0 =>\n array(\n 'amount' =>\n array(\n 'currency_code' => $currency,\n 'value' => $cart->total(),\n 'breakdown' =>\n array(\n 'item_total' =>\n array(\n 'currency_code' => $currency,\n 'value' => $cart->total(),\n ),\n ),\n ),\n 'items' => $items,\n ),\n ),\n );\n try {\n // Call API with your client and get a response for your call\n $response = $client->execute($req);\n return new JsonResponse($response);\n // If call returns body in response, you can get the deserialized version from the result attribute of the response\n }catch (HttpException $ex) {\n $response = $ex->getMessage();\n $response .= $ex->statusCode ;\n return new JsonResponse($response);\n }\n }", "private function ProcessOrderPayment()\n\t{\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t$order_token = \"\";\n\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t$order_token = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t}\n\n\t\t// If the order token is empty then something has gone wrong.\n\t\tif($order_token == '') {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Load the pending order\n\t\t$orders = LoadPendingOrdersByToken($order_token);\n\n\t\tif(!is_array($orders)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\tif ($orders['status'] != ORDER_STATUS_INCOMPLETE) {\n\t\t\t// has this order already been completed? redirect to finish order\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Get the payment module\n\t\tif(!GetModuleById('checkout', $provider, $orders['paymentmodule'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t$provider->SetOrderData($orders);\n\n\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($provider, 'DoExpressCheckoutPayment')) {\n\t\t\t$provider->DoExpressCheckoutPayment();\n\t\t\tdie();\n\t\t}\n\n\t\t// Does this method have it's own processing method?\n\t\tif(method_exists($provider, \"ProcessPaymentForm\")) {\n\t\t\t$result = $provider->ProcessPaymentForm();\n\t\t\tif($result) {\n\t\t\t\t$paymentStatus = $provider->GetPaymentStatus();\n\t\t\t\t$orderStatus = GetOrderStatusFromPaymentStatus($paymentStatus);\n\t\t\t\tif(CompletePendingOrder($order_token, $orderStatus)) {\n\t\t\t\t\t// Everything is fine, send the customer to the thank you page.\n\t\t\t\t\tredirect(getConfig('ShopPathSSL').'/finishorder.php');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise there was an error\n\t\t\t$this->ShowPaymentForm($provider);\n\t\t}\n\n\t\t// If we're still here then something from the above has gone wrong. Show the confirm page again\n\t\tredirect(getConfig('ShopPathSSL').'/checkout.php?action=confirm_order');\n\t}", "public function action_paypal_callback()\n\t{\n $post = $this->request->post();\n\t\t$type = $this->request->param('id');\n\t\t$payment = new Model_Realexpayments; // Not actually \"Realex\"\n\t\t$data['purchase_time'] = date('Y-m-d H:i:s');\n\n\t\tIbHelpers::htmlspecialchars_array($post);\n\n\t\t$data['cart_details'] = json_encode(IbHelpers::iconv_array($post));\n\n try\n\t\t{\n $is_booking = ($type == 'booking' AND isset($post['custom']));\n\t\t\t$is_product = ($type == 'product' AND isset($post['custom']));\n\t\t\t$is_invoice = ($type == 'invoice' AND isset($post['custom']));\n\t\t\t$data['paid'] = 1;\n\t\t\t$data['payment_type'] = 'PayPal';\n\t\t\t$data['payment_amount'] = isset($post['mc_gross']) ? $post['mc_gross'] : '';\n\n\t\t\tif ($is_booking)\n\t\t\t{\n\t\t\t\t// Use contact details from the booking, which should also be the data filled out in the checkout form\n\t\t\t\t$booking = Model_CourseBookings::load(trim($post['custom'], '|'));\n $data['customer_name'] = $booking['student']['first_name'].' '.$booking['student']['last_name'];\n\t\t\t\t$data['customer_telephone'] = $booking['student']['phone'];\n\t\t\t\t$data['customer_address'] = $booking['student']['address'];\n\t\t\t\t$data['customer_email'] = $booking['student']['email'];\n\t\t\t}\n\t\t\telseif ($is_product OR $is_invoice)\n\t\t\t{\n\t\t\t\t$cart = new Model_Cart($post['custom']);\n\n\t\t\t\t// Set the cart item as paid\n\t\t\t\t$cart->set_paid(1)->save();\n\n\t\t\t\t// Send the emails\n\t\t\t\t$cart = $cart->get_instance();\n\t\t\t\t$form_data = json_decode($cart['form_data']);\n\t\t\t\t$cart_data = json_decode($cart['cart_data']);\n\t\t\t\t$cart_data = isset($cart_data->data) ? $cart_data->data : new stdClass();\n $cart_data->payment_type = 'Paypal';\n\n\t\t\t\t$data['customer_name'] = isset($form_data->ccName) ? $form_data->ccName : '';\n\t\t\t\t$data['customer_telephone'] = isset($form_data->phone) ? $form_data-> phone : '';\n\t\t\t\t$data['customer_address'] = isset($form_data->address_1) ? $form_data->address_1 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_2) ? ', '.$form_data->address_2 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_3) ? ', '.$form_data->address_3 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_4) ? ', '.$form_data->address_4 : '';\n\t\t\t\t$data['customer_email'] = isset($form_data->email) ? $form_data->email : '';\n\t\t\t\t$data['cart_id'] = isset($cart_data->id) ? $cart_data->id : '';\n\n\t\t\t\t$payment->send_mail_seller($form_data, (array) $cart_data);\n\t\t\t\t$payment->send_mail_customer($form_data, NULL, (array) $cart_data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Use contact details from the buyer's PayPal account\n\t\t\t\t$data['customer_name'] = trim((isset($post['first_name'])?$post['first_name']:'').' '.(isset($post['last_name'])?$post['last_name']:''));\n\t\t\t\t$data['customer_telephone'] = isset($post['contact_phone']) ? $post['contact_phone'] : '';;\n\t\t\t\t$data['customer_address'] = \"\".\n\t\t\t\t\t(isset($post['address_name']) ? $post['address_name'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_street']) ? $post['address_street'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_city']) ? $post['address_city'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_state']) ? $post['address_state'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_zip']) ? $post['address_zip'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_country']) ? $post['address_country'].\"\\n\" : '');\n\t\t\t\t$data['customer_email'] = isset($post['payer_email']) ? $post['payer_email'] : '';\n\t\t\t}\n\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\n if ($is_booking)\n\t\t\t{\n\t\t\t\tModel_CourseBookings::paypal_handler_old($booking['id'], $post['mc_gross'], $post['txn_id']);\n\n\t\t\t\t// send success emails regarding bookings\n\t\t\t\t$payment->send_mail_seller_bookings($post);\n\t\t\t\t$payment->send_mail_customer_bookings($post);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().\"\\n\".$e->getTraceAsString());\n\t\t\t$data['payment_type'] = 'Test/failed payment';\n\t\t\tModel_Errorlog::save($e);\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\t\t}\n\t}", "protected function buildPaymentFields($order_info)\r\n {\r\n $processor_params = $this->processor_data['processor_params'];\r\n\r\n return [\r\n 'Amount' => intval($order_info['total'] * 100),\r\n 'CurrencyCode' => PaymentsenseIso4217::getCurrencyIsoCode($processor_params['currency']),\r\n 'OrderID' => ($order_info['repaid']) ? ($order_info['order_id'] . '_' . $order_info['repaid']) : $order_info['order_id'],\r\n 'TransactionType' => $processor_params['transaction_type'],\r\n 'TransactionDateTime' => date('Y-m-d H:i:s P'),\r\n 'CallbackURL' => $this->getCallbackUrl($this->processor_data['processor_script']),\r\n 'OrderDescription' => '',\r\n 'CustomerName' => $order_info['b_firstname'] . ' ' . $order_info['b_lastname'],\r\n 'Address1' => $order_info['b_address'],\r\n 'Address2' => $order_info['b_address_2'],\r\n 'Address3' => '',\r\n 'Address4' => '',\r\n 'City' => $order_info['b_city'],\r\n 'State' => $order_info['b_state_descr'],\r\n 'PostCode' => $order_info['b_zipcode'],\r\n 'CountryCode' => $this->getCountryNumericCode($order_info['b_country']),\r\n 'EmailAddress' => $order_info['email'],\r\n 'PhoneNumber' => $order_info['phone'],\r\n 'EmailAddressEditable' => 'false',\r\n 'PhoneNumberEditable' => 'false',\r\n 'CV2Mandatory' => $processor_params['cv2_mandatory'],\r\n 'Address1Mandatory' => $processor_params['address_mandatory'],\r\n 'CityMandatory' => $processor_params['city_mandatory'],\r\n 'PostCodeMandatory' => $processor_params['postcode_mandatory'],\r\n 'StateMandatory' => $processor_params['state_mandatory'],\r\n 'CountryMandatory' => $processor_params['country_mandatory'],\r\n 'ResultDeliveryMethod' => 'SERVER',\r\n 'ServerResultURL' => $this->getServerResultURL(),\r\n 'PaymentFormDisplaysResult' => 'false'\r\n ];\r\n }", "public function getPurchaseDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $purchase_details = $this->transactionUtil->getPurchaseTotals($business_id, $start, $end);\n\n return $purchase_details;\n }\n }", "public function getProductListing($order,$orderItems,$ref)\n {\n //echo \"<pre>\"; print_r($orderItems->getData());\n $html_content.='\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr>\n <td width=\"50%\">\n <h4>Ship To:</h4>';\n $html_content.=$order->getShippingAddress()->getCompany().'<br/>'.$order->getShippingAddress()->getStreet(1).',<br/>'.$order->getShippingAddress()->getStreet(2).'<br/>'.$order->getShippingAddress()->getRegion(). $order->getShippingAddress()->getPostcode().',<br/> '.$order->getShippingAddress()->getCountryId().',<br/> '.$order->getShippingAddress()->getFirstname().' '.$order->getShippingAddress()->getLastname().'\n </td>\n <td width=\"50%\">\n <h4>Req by:</h4>'.\n $customerAddressId = Mage::getModel('customer/customer')->load($order->getCustomerId())->getDefaultBilling();\n \n if ($customerAddressId) {\n $address = Mage::getModel('customer/address')->load($customerAddressId);\n }\n $html_content.=$address->getCompany().' <br/>'.$address->getStreet(1).',<br/>'.$address->getStreet(2).' <br/>'.$address->getRegion(). $address->getPostcode().', '.$address->getCountryId().'\n </td>\n </tr> \n </table>\n </td> \n </tr>\n <tr><td height=\"20\">&nbsp;</td></tr>\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"box-table\">\n <tr>\n <td><b>Sales Rep:</b><br/>'.$customer = Mage::getModel('customer/customer')->load($order->getCustomerId())->getIpsalesrep().'</td>\n <td><b>Customer ID: </b><br/>'.$order->getCustomerId().'</td>\n <td><b>Shipped Date: </b><br/>'.date(\"d-M-y\").' </td>\n </tr>\n </table>\n </td>\n </tr> \n <tr><td height=\"20\">&nbsp;</td></tr>\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">';\n if($ref==2){\n $html_content.='\n <tr>\n <th width=\"10%\" align=\"left\">&nbsp;</th>\n <th width=\"10%\" align=\"left\">Quantity</th>\n <th width=\"35%\" align=\"left\">Product Name</th>\n <th width=\"15%\" align=\"left\">Color</th>\n <th width=\"15%\" align=\"left\">Basis Weight</th>\n <th width=\"15%\" align=\"left\">Sheet Size</th>\n </tr>'; \n }\n else{\n $html_content.='\n <tr>\n <th width=\"10%\" align=\"left\">PL</th>\n <th width=\"10%\" align=\"left\">Quantity</th>\n <th width=\"35%\" align=\"left\">Product Name</th>\n <th width=\"15%\" align=\"left\">Color</th>\n <th width=\"15%\" align=\"left\">Basis Weight</th>\n <th width=\"15%\" align=\"left\">Sheet Size</th>\n </tr>'; \n } \n foreach ($orderItems as $item){\n \n if($item->getProductType() != \"configurable\"){\n $product = Mage::getModel('catalog/product')->load($item->getProductId());\n \n $optionsArr = $item->getProductOptions();\n if(count($optionsArr['options']) > 0)\n {\n foreach ($optionsArr['options'] as $option)\n {\n //$optionTitle = $option['label'];\n //$optionId = $option['option_id'];\n //$optionType = $option['type'];\n $optionValue = '<br> Custom Order: '.$option['value'];\n }\n }\n \n $attributePrefix = $this->getAttributeSet($product);\n if($attributePrefix == \"fs\"){\n if(!$product->getAttributeText($attributePrefix.'_size')){\n $promo = true;\n }\n }\n else{ \n if(!$product->getAttributeText($attributePrefix.'_basis_weight') && !$product->getAttributeText($attributePrefix.'_size')){\n $promo = true;\n } \n } \n if($ref==2){\n if($attributePrefix == \"fs\"){\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\"> &nbsp; </td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\"> &nbsp; </td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>';\n \n }\n else{\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\"> &nbsp; </td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_basis_weight').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n } \n }\n else{\n if($attributePrefix == \"fs\"){\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\">'.$product->getPullLocation().'</td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\"> &nbsp; </td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n }\n else {\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\">'.$product->getPullLocation().'</td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_basis_weight').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n } \n } \n \n }\n \n unset($optionValue);\n //unset($basisWeight);\n //unset($sheetSize);\n //unset($proColor);\n }\n $html_content.='\n </table>\n </td>\n </tr>\n <tr><td height=\"20\">&nbsp;</td></tr>\n <tr>\n <td width=\"100%\" align=\"left\">\n <p>Requested By: '.$address->getFirstname().' '.$address->getLastname().'</p>\n <p>Remarks:</p>';\n if($promo){\n $html_content.='<h1>Promotional Material Needed*</h1>';\n } \n $html_content.='\n </td> \n </tr>\n <tr><td height=\"20\">&nbsp;</td></tr>\n <tr>\n <td width=\"100%\" align=\"left\">\n <h1>'.preg_replace(\"/Customer Order Comment:/\", \"\", $order->getCustomerNote()).'</h1>\n </td> \n </tr>\n ';\n return $html_content; \n }", "public function getCheckoutPurchaseOrderNo();", "public function get_woo_pal_details() {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\t$api_prefix = '';\n\n\t\tif ( 'live' !== $environment ) {\n\t\t\t$api_prefix = 'sandbox_';\n\t\t}\n\n\t\t$this->setup_api_vars( $this->key, $environment, $this->wc_gateway()->get_option( $api_prefix . 'api_username' ), $this->wc_gateway()->get_option( $api_prefix . 'api_password' ), $this->wc_gateway()->get_option( $api_prefix . 'api_signature' ) );\n\n\t\t$this->add_parameter( 'METHOD', 'GetPalDetails' );\n\t\t$this->add_credentials_param( $this->api_username, $this->api_password, $this->api_signature, 124 );\n\t\t$request = new stdClass();\n\t\t$request->path = '';\n\t\t$request->method = 'POST';\n\t\t$request->body = $this->to_string();\n\n\t\treturn $this->perform_request( $request );\n\n\t}", "function get_json_payment( $c_transactions) {\n\n global $return_url, $cancel_url;\n\n $payment = '{\n \"intent\": \"sale\",\n \"redirect_urls\":\n {\n \"return_url\": \"'.$return_url.'\",\n \"cancel_url\": \"'.$cancel_url.'\"\n },\n \"payer\":\n {\n \"payment_method\": \"paypal\"\n },\n \"transactions\": ['.$c_transactions.'] \n }';\n\n return $payment;\n\n}", "public function customer_details(){\n\t\t\t\n\t\t\t$this->input->post(NULL, TRUE); // returns all POST items with XSS filter\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$reference = html_escape($this->input->post('reference'));\n\t\t\t//$reference = preg_replace('#[^0-9]#i', '', $reference); // filter everything but numbers\n\t\t\t\n\t\t\t$detail = $this->db->select('*')->from('orders')->where('reference',$reference)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\t\t\t\t\n\t\t\t\t\t$data['customer_email'] = $detail->customer_email;\n\t\t\t\t\t\n\t\t\t\t\t$data['success'] = true;\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function retrieveCustomerOrder($customer_nr, $order_nr)\n {\n $query = 'SELECT order_view.order_nr, name, order_view.state, buying_price, ROUND(order_view.price, 2) AS total, model, ski_quantity, msrp, subtotal, date_placed \n FROM order_view INNER JOIN orders ON orders.order_nr = order_view.order_nr WHERE order_view.order_nr = :order_nr';\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(\":order_nr\", $order_nr);\n $stmt->execute();\n $orders = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if (empty($orders))\n throw new BusinessException(httpErrorConst::notFound, \"Record not found\");\n\n $row = array();\n\n // Prints order\n $row['order_nr'] = $orders[0]['order_nr'];\n $row['name'] = $orders[0]['name'];\n $row['date_placed'] = $orders[0]['date_placed'];\n $row['buying_price'] = $orders[0]['buying_price'];\n $row['state'] = $orders[0]['state'];\n $row['total'] = $orders[0]['total'];\n\n // Prints suborders\n $row['sub_orders'] = array();\n for($i = 0; $i < count($orders); $i++){\n $this->fillSubOrder($row, $i, $orders[$i]);\n }\n\n return $row;\n }", "public function getFormFields() {\r\r\n\r\r\n $billing = $this->getOrder()->getBillingAddress();\r\r\n $shipping = $this->getOrder()->getShippingAddress();\r\r\n $addr_entity_id = $shipping->getCustomerAddressId();\r\r\n $shippingaddress = Mage::getModel('sales/order_address');\r\r\n $shippingaddress->load($addr_entity_id);\r\r\n $shipaddgetdat = $shippingaddress->getData();\r\r\n\r\r\n\r\r\n\r\r\n $biladdr_entity_id = $billing->getCustomerAddressId();\r\r\n ;\r\r\n $billingaddress = Mage::getModel('sales/order_address');\r\r\n $billingaddress->load($biladdr_entity_id);\r\r\n $billaddgetdat = $billingaddress->getData();\r\r\n\r\r\n $coFields = array();\r\r\n $items = $this->getQuote()->getAllItems();\r\r\n\r\r\n if ($items) {\r\r\n $i = 1;\r\r\n foreach ($items as $item) {\r\r\n if ($item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n $coFields['c_prod_' . $i] = $this->cleanString($item->getSku());\r\r\n $coFields['c_name_' . $i] = $this->cleanString($item->getName());\r\r\n $coFields['c_description_' . $i] = $this->cleanString($item->getDescription());\r\r\n $coFields['c_price_' . $i] = number_format($item->getPrice(), 2, '.', '');\r\r\n $i++;\r\r\n }\r\r\n }\r\r\n\r\r\n $request = '';\r\r\n foreach ($coFields as $k => $v) {\r\r\n $request .= '<' . $k . '>' . $v . '</' . $k . '>';\r\r\n }\r\r\n\r\r\n\r\r\n $key = Mage::getStoreConfig('payment/payucheckout_shared/key');\r\r\n $salt = Mage::getStoreConfig('payment/payucheckout_shared/salt');\r\r\n $debug_mode = Mage::getStoreConfig('payment/payucheckout_shared/debug_mode');\r\r\n\r\r\n $orderid = $this->getOrder()->getRealOrderId();\r\r\n $orderInfo = $this->getOrder();\r\r\n $order = Mage::getModel('sales/order')->loadByIncrementId($orderid);\r\r\n// get order total value\r\r\n $orderValue = number_format($order->getGrandTotal(), 2, '.', $thousands_sep = '');\r\r\n// get order item collection\r\r\n $orderItems = $order->getItemsCollection();\r\r\n $productInfo = array();\r\r\n $productInfo2 = array();\r\r\n \r\r\n \r\r\n foreach ($orderItems as $item) {\r\r\n \r\r\n $item->getName();\r\r\n $product_id = $item->product_id;\r\r\n $product_sku = $item->sku;\r\r\n $product_name = $item->getName();\r\r\n $_product = Mage::getModel('catalog/product')->load($product_id);\r\r\n $cats = $_product->getCategoryIds();\r\r\n $category_id = $cats[0]; // just grab the first id\r\r\n $category = Mage::getModel('catalog/category')->load($category_id);\r\r\n $category_name = $category->getName();\r\r\n\r\r\n $productInfo['name'] = $this->cleanString($item->getName());\r\r\n $productInfo['description'] = $this->cleanString(substr($_product->getDescription(),0,100));\r\r\n $productInfo['value'] = $orderValue;\r\r\n $productInfo['isRequired'] = true;\r\r\n $productInfo['settlementEvent'] = \"EmailConfirmation\";\r\r\n $productInfo2[] = $productInfo;\r\r\n }\r\r\n $productIndoFilterData['paymentParts'] = $productInfo2;\r\r\n $jsonProductInfo = json_encode($productIndoFilterData);\r\r\n\r\r\n $txnid = $orderid;\r\r\n\r\r\n $coFields['key'] = $key;\r\r\n $coFields['txnid'] = $txnid;\r\r\n $coFields['udf2'] = $txnid;\r\r\n $coFields['amount'] = number_format($this->getOrder()->getBaseGrandTotal(), 0, '', '');\r\r\n $coFields['productinfo'] = $jsonProductInfo;\r\r\n $coFields['address'] = $billaddgetdat['street'];\r\r\n $coFields['firstname'] = $billing->getFirstname();\r\r\n $coFields['Lastname'] = $billing->getLastname();\r\r\n $coFields['City'] = $billing->getCity();\r\r\n $coFields['State'] = $billing->getRegion();\r\r\n $coFields['Country'] = $billing->getCountry();\r\r\n $coFields['Zipcode'] = $billing->getPostcode();\r\r\n $coFields['email'] = $this->getOrder()->getCustomerEmail();\r\r\n $coFields['phone'] = $billing->getTelephone();\r\r\n\r\r\n $coFields['ship_name'] = $shipping->getFirstname() . \" \" . $shipping->getLastname();\r\r\n $coFields['ship_address'] = $shipaddgetdat['street'];\r\r\n $coFields['ship_zipcode'] = $shipping->getPostcode();\r\r\n $coFields['ship_city'] = $shipping->getCity();\r\r\n $coFields['ship_state'] = $shipping->getRegion();\r\r\n $coFields['ship_country'] = $shipping->getCountry();\r\r\n $coFields['ship_phone'] = $shipping->getTelephone();\r\r\n $coFields['website'] = Mage::getBaseUrl();\r\r\n $coFields['surl'] = Mage::getBaseUrl() . 'payucheckout/shared/success/';\r\r\n $coFields['furl'] = Mage::getBaseUrl() . 'payucheckout/shared/failure/';\r\r\n $coFields['curl'] = Mage::getBaseUrl() . 'payucheckout/shared/canceled/id/' . $this->getOrder()->getRealOrderId();\r\r\n $coFields['Pg'] = $billing->getpg();\r\r\n $coFields['bankcode'] = $billing->getbankcode();\r\r\n $coFields['ccnum'] = $billing->getccnum();\r\r\n $coFields['ccvv'] = $billing->getccvv();\r\r\n $coFields['ccexpmon'] = $billing->getccexpmon();\r\r\n $coFields['ccexpyr'] = $billing->getccexpyr();\r\r\n $coFields['ccname'] = $billing->getccname();\r\r\n $coFields['service_provider'] = 'payu_paisa';\r\r\n\r\r\n $debugId = '';\r\r\n \r\r\n\r\r\n if ($debug_mode == 1) {\r\r\n\r\r\n $requestInfo = $key . '|' . $coFields['txnid'] . '|' . $coFields['amount'] . '|' .\r\r\n $jsonProductInfo . '|' . $coFields['firstname'] . '|' . $coFields['email'] . '|' . $debugId . '||||||||||' . $salt;\r\r\n $debug = Mage::getModel('payucheckout/api_debug')\r\r\n ->setRequestBody($requestInfo)\r\r\n ->save();\r\r\n\r\r\n $debugId = $debug->getId();\r\r\n\r\r\n $coFields['udf1'] = $debugId;\r\r\n $coFields['Hash'] = hash('sha512', $key . '|' . $coFields['txnid'] . '|' . $coFields['amount'] . '|' .\r\r\n $jsonProductInfo . '|' . $coFields['firstname'] . '|' . $coFields['email'] . '|' . $debugId . '|' . $coFields['udf2'] . '|||||||||' . $salt);\r\r\n } else {\r\r\n $coFields['Hash'] = strtolower(hash('sha512', $key . '|' . $coFields['txnid'] . '|' . $coFields['amount'] . '|' .\r\r\n $jsonProductInfo . '|' . $coFields['firstname'] . '|' . $coFields['email'] . '||' . $coFields['udf2'] . '|||||||||' . $salt));\r\r\n }\r\r\n return $coFields;\r\r\n }", "function getOrder()\n{\n\n}", "public function insertOrderCustomer($value,$line_item, $mainOrderId)\n {\n\n\n //customer info\n $customer_arr['order_id'] = $mainOrderId;\n $customer_arr['line_item_id'] = $line_item->id;\n $customer_arr['billing_address_name'] =$value->billing_address->name;\n $customer_arr['billing_address_first_name'] =$value->billing_address->first_name;\n $customer_arr['billing_address_last_name'] =$value->billing_address->last_name;\n $customer_arr['billing_address_address1'] =$value->billing_address->address1;\n $customer_arr['billing_address_address2'] =$value->billing_address->address2;\n $customer_arr['billing_address_phone'] =$value->billing_address->phone;\n $customer_arr['billing_address_city'] =$value->billing_address->city;\n $customer_arr['billing_address_zip'] =$value->billing_address->zip;\n $customer_arr['billing_address_province'] =$value->billing_address->province;\n $customer_arr['billing_address_country'] =$value->billing_address->country;\n $customer_arr['billing_address_company'] =$value->billing_address->company;\n $customer_arr['billing_address_latitude'] =$value->billing_address->latitude;\n $customer_arr['billing_address_longitude'] =$value->billing_address->longitude;\n $customer_arr['billing_address_province_code'] =$value->billing_address->province_code;\n $customer_arr['billing_address_country_code'] =$value->billing_address->country_code;\n $customer_arr['shipping_address_name'] = $value->shipping_address->name;\n $customer_arr['shipping_address_first_name'] = $value->shipping_address->first_name;\n $customer_arr['shipping_address_last_name'] = $value->shipping_address->last_name;\n $customer_arr['shipping_address_address1'] = $value->shipping_address->address1;\n $customer_arr['shipping_address_address2'] = $value->shipping_address->address2;\n $customer_arr['shipping_address_phone'] = $value->shipping_address->phone;\n $customer_arr['shipping_address_city'] = $value->shipping_address->city;\n $customer_arr['shipping_address_zip'] = $value->shipping_address->zip;\n $customer_arr['shipping_address_province'] = $value->shipping_address->province;\n $customer_arr['shipping_address_country'] = $value->shipping_address->country;\n $customer_arr['shipping_address_company'] = $value->shipping_address->company;\n $customer_arr['shipping_address_latitude'] = $value->shipping_address->latitude;\n $customer_arr['shipping_address_longitude'] = $value->shipping_address->longitude;\n $customer_arr['shipping_address_province_code'] = $value->shipping_address->province_code;\n $customer_arr['shipping_address_country_code'] = $value->shipping_address->country_code;\n $customer_arr['customer_id'] = $value->customer->id;\n $customer_arr['customer_email'] = $value->customer->email;\n $customer_arr['customer_first_name'] = $value->customer->first_name;\n $customer_arr['customer_last_name'] = $value->customer->last_name;\n $customer_arr['customer_total_spent'] = $value->customer->total_spent;\n $customer_arr['customer_last_order_id'] = $value->customer->last_order_id;\n $customer_arr['customer_phone'] = $value->customer->phone;\n $customer_arr['customer_tags'] = $value->customer->tags;\n $customer_arr['customer_last_order_name'] = $value->customer->last_order_name;\n $customer_arr['customer_currency'] = $value->customer->currency;\n $customer_arr['default_address_id'] = $value->customer->default_address->id;\n $customer_arr['default_address_customer_id'] = $value->customer->default_address->customer_id;\n $customer_arr['default_address_first_name'] = $value->customer->default_address->first_name;\n $customer_arr['default_address_last_name'] = $value->customer->default_address->last_name;\n $customer_arr['default_address_company'] = $value->customer->default_address->company;\n $customer_arr['default_address_address1'] = $value->customer->default_address->address1;\n $customer_arr['default_address_address2'] = $value->customer->default_address->address2;\n $customer_arr['default_address_city'] = $value->customer->default_address->city;\n $customer_arr['default_address_province'] = $value->customer->default_address->province;\n $customer_arr['default_address_country'] = $value->customer->default_address->country;\n $customer_arr['default_address_zip'] = $value->customer->default_address->zip;\n $customer_arr['default_address_phone'] = $value->customer->default_address->phone;\n $customer_arr['default_address_name'] = $value->customer->default_address->name;\n $customer_arr['default_address_province_code'] = $value->customer->default_address->province_code;\n $customer_arr['default_address_country_code'] = $value->customer->default_address->country_code;\n $customer_arr['default_address_country_name'] = $value->customer->default_address->country_name;\n\n\n return OrderCustomerDetails::insertGetId($customer_arr);\n\n }", "public function hookPaymentReturn($params)\n\t{\n\t\tif (!isset($params['objOrder']) || ($params['objOrder']->module != $this->name))\n\t\t\treturn false;\n\t\t\n\t\tif ($params['objOrder'] && Validate::isLoadedObject($params['objOrder']) && isset($params['objOrder']->valid))\n\n\t\t\t$this->smarty->assign('stripe_order', array('reference' => isset($params['objOrder']->reference) ? $params['objOrder']->reference : '#'.sprintf('%06d', $params['objOrder']->id), 'valid' => $params['objOrder']->valid));\n\n \n\t $stripe_charges = Db::getInstance()->ExecuteS('\n\t\t\tSELECT a.`id_transaction`,a.`id_order`,b.`id_customer` FROM `'._DB_PREFIX_.'stripepro_transaction` a,`'._DB_PREFIX_.'stripepro_customer` b WHERE a.`id_stripe_customer`=b.`id_customer` && a.`id_cart` = '.(int)Tools::getValue('id_cart'),false);\n\t\t\n\t\tinclude(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n foreach($stripe_charges as $charge){\n\t\t $mp_seller = Db::getInstance()->getValue('SELECT `customer_id` FROM `'._DB_PREFIX_.'marketplace_commision_calc` WHERE `id_order`= '.(int)$charge['id_order'],false);\n\t\t try\n\t\t {\n\t\t\t $ch = \\Stripe\\Charge::retrieve($charge['id_transaction']);\n\t\t\t $ch->description = \"PS Cus: \".$charge['id_customer'].\" – MP Seller: \".$mp_seller.\" – MP Order: \".$charge['id_order'].\" – Ord Ref: \".$params['objOrder']->reference;\n\t\t\t $ch->save();\n\t\t }\n\t\tcatch (Exception $e)\n\t\t\t\t{\n\t\t\t\t\t\tLogger::addLog($this->l('Stripe - charge update failed'.$e->getMessage()), 1, null, 'Cart', (int)Tools::getValue('id_cart'), true);\n\t\t\t\t}\n\t\t \n\t\t}\n\t\t\t// added this so we could present a better/meaningful message to the customer when the charge suceeds, but verifications have failed.\n\t\t\t$pendingOrderStatus = (int)Configuration::get('STRIPE_PENDING_ORDER_STATUS');\n\t\t\t$currentOrderStatus = (int)$params['objOrder']->getCurrentState();\n\n\t\t\tif ($pendingOrderStatus==$currentOrderStatus)\n\t\t\t\t$this->smarty->assign('order_pending', true);\n\t\t\telse\n\t\t\t\t$this->smarty->assign('order_pending', false);\n\n\t\treturn $this->display(__FILE__, './views/templates/hook/order-confirmation.tpl');\n\n\t}" ]
[ "0.6585961", "0.65769047", "0.65300477", "0.6380407", "0.628283", "0.6156265", "0.61345875", "0.6130991", "0.6100451", "0.6082305", "0.6079839", "0.60190225", "0.5944091", "0.5935058", "0.5906031", "0.5869138", "0.5862159", "0.5855021", "0.5837794", "0.5812199", "0.5799402", "0.57981294", "0.5795318", "0.57948804", "0.578891", "0.57888925", "0.57851297", "0.57628095", "0.5760664", "0.57552266", "0.57499665", "0.57403123", "0.573116", "0.5730865", "0.5722404", "0.571082", "0.57090276", "0.57073003", "0.57024664", "0.5698008", "0.56926554", "0.5691868", "0.5691209", "0.5683725", "0.5682719", "0.5679686", "0.5669269", "0.5665972", "0.5656686", "0.56451297", "0.5633795", "0.5632705", "0.5618965", "0.5617724", "0.560583", "0.5602304", "0.5602069", "0.55954933", "0.55901766", "0.55892164", "0.5587067", "0.5585176", "0.5573431", "0.55632037", "0.5562847", "0.5560397", "0.5554713", "0.55491173", "0.55467516", "0.5545436", "0.5527941", "0.5519736", "0.55131155", "0.5504656", "0.55000746", "0.5497487", "0.54962134", "0.54948026", "0.54934067", "0.54859173", "0.5482709", "0.5478591", "0.54687935", "0.5465736", "0.54617244", "0.5459471", "0.5450068", "0.5447303", "0.54455894", "0.54445076", "0.5442505", "0.5439746", "0.542649", "0.5422717", "0.5417995", "0.5416413", "0.5409445", "0.54083854", "0.540781", "0.5399136", "0.539819" ]
0.0
-1
Perform actual payment 3rd Step
public function doExpressCheckoutPayment(Array $orderDetails) { $nvpstr = '&TOKEN=' . $orderDetails['TOKEN'] . '&PAYERID=' . $orderDetails['PAYERID'] . '&PAYMENTREQUEST_0_AMT=' . $orderDetails['PAYMENTREQUEST_0_AMT'] . '&PAYMENTREQUEST_0_CURRENCYCODE=' . $orderDetails['PAYMENTREQUEST_0_CURRENCYCODE'] . '&PAYMENTREQUEST_0_PAYMENTACTION=Sale'; $resArray = $this->hash_call('DoExpressCheckoutPayment', $nvpstr); if ($resArray['ACK'] == self::ACK_SUCCESS) { return $resArray; } //Dao_Abstract::getLogger()->log( // "Acd_Payment_PayPal: doExpressCheckoutPayment() failed\n" . print_r($resArray, true), Zend_Log::DEBUG); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processPayment();", "protected function doExecutePayment() {\n // This method is empty so child classes can override it and provide their\n // own implementation.\n }", "abstract protected function handlePayment();", "public function success_payment() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n\n // Verify if the get param pay-return exits\n if ( get_instance()->input->get('pay-return', TRUE) ) {\n \n $pay = get_instance()->input->get('pay-return', TRUE);\n\n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n\n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n\n $get->save();\n\n } else {\n\n display_mess(47);\n\n }\n \n }\n \n }", "public function make3DPayPayment()\n {\n $status = 'declined';\n $response = 'Declined';\n $proc_return_code = $this->request->get('procreturncode');\n\n $transaction_security = 'MPI fallback';\n if (in_array($this->request->get('mdstatus'), [1, 2, 3, 4])) {\n if ($this->request->get('mdstatus') == '1') {\n $transaction_security = 'Full 3D Secure';\n } elseif (in_array($this->request->get('mdstatus'), [2, 3, 4])) {\n $transaction_security = 'Half 3D Secure';\n }\n\n $status = 'approved';\n $response = 'Approved';\n }\n\n $this->response = (object) [\n 'id' => (string) $this->request->get('authcode'),\n 'order_id' => (string) $this->request->get('oid'),\n 'trans_id' => (string) $this->request->get('transid'),\n 'auth_code' => (string) $this->request->get('authcode'),\n 'host_ref_num' => (string) $this->request->get('hostrefnum'),\n 'response' => $response,\n 'transaction_type' => $this->type,\n 'transaction' => $this->order->transaction,\n 'transaction_security' => $transaction_security,\n 'proc_return_code' => $proc_return_code,\n 'code' => $proc_return_code,\n 'md_status' => $this->request->get('mdStatus'),\n 'status' => $status,\n 'status_detail' => isset($this->codes[$this->request->get('ProcReturnCode')]) ? (string) $this->request->get('ProcReturnCode') : null,\n 'hash' => (string) $this->request->get('secure3dhash'),\n 'rand' => (string) $this->request->get('rnd'),\n 'hash_params' => (string) $this->request->get('hashparams'),\n 'hash_params_val' => (string) $this->request->get('hashparamsval'),\n 'masked_number' => (string) $this->request->get('MaskedPan'),\n 'amount' => (string) $this->request->get('amount'),\n 'currency' => (string) $this->request->get('currency'),\n 'tx_status' => (string) $this->request->get('txstatus'),\n 'eci' => (string) $this->request->get('eci'),\n 'cavv' => (string) $this->request->get('cavv'),\n 'xid' => (string) $this->request->get('xid'),\n 'error_code' => (string) $this->request->get('errcode'),\n 'error_message' => (string) $this->request->get('errmsg'),\n 'md_error_message' => (string) $this->request->get('mderrormessage'),\n 'campaign_url' => null,\n 'name' => (string) $this->request->get('firmaadi'),\n 'email' => (string) $this->request->get('Email'),\n 'extra' => $this->request->get('Extra'),\n 'all' => $this->request->all(),\n ];\n\n return $this;\n }", "public function payment(){\n\n\t}", "public function calculatePayment()\n {\n }", "function _exp_checkout_do_payment() {\n global $event_details;\n $event_id = $event_details['ID'];\n\n if ( is_null( $event_id ) ) {\n return false;\n }\n\n $regis_id = $this->erm->get_regis_id();\n $post_ID = $_SESSION['__epl']['post_ID'];\n $this->ecm->setup_event_details( $event_id );\n $_totals = $this->erm->calculate_totals();\n $total = $_totals['money_totals']['grand_total'];\n\n $this->epl->load_file( 'libraries/gateways/twocheckout/twocheckout.php' );\n $twocheckout_response = new TCO_Payment();\n $twocheckout_response->setAcctInfo();\n $response = $twocheckout_response->getResponse();\n if ( is_array( $response )) {\n $data['post_ID'] = $post_ID;\n $data['_epl_regis_status'] = '5';\n $data['_epl_grand_total'] = $total;\n $data['_epl_payment_amount'] = $response['total'];\n $data['_epl_payment_date'] = current_time( 'mysql' );\n $data['_epl_payment_method'] = '_tco';\n $data['_epl_transaction_id'] = $response['order_number'];\n\n $data = apply_filters( 'epl_tco_response_data', $data, $response );\n\n $this->erm->update_payment_data( $data );\n\n return true;\n } else {\n $error = 'ERROR: ' . 'MD5 Hash does not match! Contact the seller!';\n }\n }", "public function paymentAction()\n {\n try {\n $session = $this->_getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n $order->setState(Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING, Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING,\n Mage::helper('payanyway')->__('The customer was redirected to Payanyway.')\n );\n $order->save();\n\n $session->setPayanywayQuoteId($session->getQuoteId());\n $session->setPayanywayRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(false)->save();\n $session->clear();\n\n $this->loadLayout();\n $this->renderLayout();\n } catch (Exception $e){\n Mage::logException($e);\n parent::_redirect('checkout/cart');\n }\n }", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "public function callback3dAction()\n {\n $boError = false;\n $szMessage = '';\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $boCartIsEmpty = false;\n \n try\n {\n $szPaRes = $this->getRequest()->getPost('PaRes');\n $szMD = $this->getRequest()->getPost('MD');\n \n // check if the cart is not empty, ie: after successful completion back button clicked in the browser\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n // cart is not empty\n // complete the 3D Secure transaction with the 3D Authorization result\n $checkout->saveOrderAfter3dSecure($szPaRes, $szMD);\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n Mage::logException($exc);\n \n if( isset($_SESSION['paymentsensegateway_message']) )\n {\n $szMessage = $_SESSION['paymentsensegateway_message'];\n unset($_SESSION['paymentsensegateway_message']);\n }\n else\n {\n $szMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_7655;\n }\n }\n \n if ($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szMessage .= '<br/>'.$szPaymentProcessorResponse;\n }\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_threed_secure';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('3D Secure Authentication Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szMessage);\n }\n \n $this->_clearSessionVariables();\n // report out an fatal error\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n \n // if the cart is empty do not attempt to update the invoices\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n Mage::getModel('paymentsensegateway/direct')->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function pay_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$order_id = $_GET['osc_order_id'];\n\n\t\t\t$payment = self::get_api()->payments->create(array(\n\t\t\t\t\"amount\" => $this->get_order_total($order_id),\n\t\t\t\t\"method\" => isset($_GET['method']) ? $_GET['method'] : NULL,\n\t\t\t\t\"description\" => MODULE_PAYMENT_MOLLIE_PAYMENT_DESCRIPTION . \" \" . $order_id,\n\t\t\t\t\"redirectUrl\" => $this->get_return_url($order_id),\n\t\t\t\t\"metadata\" => array(\"order_id\" => $order_id),\n\t\t\t\t\"webhookUrl\" => $this->get_webhook_url($order_id),\n\t\t\t\t\"issuer\" => !empty($_GET['issuer']) ? $_GET['issuer'] : NULL\n\t\t\t));\n\n\t\t\t$this->log($payment->id, $payment->status, $order_id);\n\n\t\t\theader(\"Location: \" . $payment->getPaymentUrl());\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\t}", "public function payAction()\n\t{\n\t\t$paylanecreditcard = Mage::getSingleton(\"paylanecreditcard/standard\");\n\t\t$data = $paylanecreditcard->getPaymentData();\n\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\n\t\t// connect to PayLane Direct System\n\t\t$paylane_client = new PayLaneClient();\n\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanecreditcard/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanecreditcard/direct_password');\n\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \tsession_write_close();\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\n\t\t$secure3d = Mage::getStoreConfig('payment/paylanecreditcard/secure3d');\n\n\t\tif ($secure3d == true)\n\t\t{\n\t\t\t$back_url = Mage::getUrl('paylanecreditcard/standard/back', array('_secure' => true));\n\n\t\t\t$result = $paylane_client->checkCard3DSecureEnrollment($data, $back_url);\n\n\t\t\tif ($result == false)\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->ERROR))\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t \treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->OK))\n\t\t\t{\n\t\t\t\t$paylanecreditcard->setIdSecure3dAuth($result->OK->secure3d_data->id_secure3d_auth);\n\n\t\t\t\tif (isset($result->OK->is_card_enrolled))\n\t\t\t\t{\n\t\t\t\t\t$is_card_enrolled = $result->OK->is_card_enrolled;\n\n\t\t\t\t\t// card is enrolled in 3-D Secure\n\t\t\t\t\tif (true == $is_card_enrolled)\n\t\t\t\t\t{\n\t\t\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect($result->OK->secure3d_data->paylane_url);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// card is not enrolled, perform normal sale\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['secure3d'] = array();\n\t\t\t\t\t\t$data['id_secure3d_auth'] = $result->OK->secure3d_data->id_secure3d_auth;\n\n\t\t\t\t\t\t$result = $paylane_client->multiSale($data);\n\t\t\t\t\t\tif ($result == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// an error message\n\t\t\t\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($result->ERROR))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// an error message\n\t\t\t\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\t\t \treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($result->OK))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$paylanecreditcard->setCurrentOrderPaid();\n\t\t\t\t\t\t\t$paylanecreditcard->addComment('id_sale=' . $result->OK->id_sale);\n\t\t\t\t\t\t\t$paylanecreditcard->addTransaction($result->OK->id_sale);\n\n\t\t\t\t\t \tsession_write_close();\n\t\t\t\t\t \t$this->_redirect('checkout/onepage/success');\n\t\t\t\t\t \treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $paylane_client->multiSale($data);\n\t\t\tif ($result == false)\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->ERROR))\n\t\t\t{\n\t\t\t\t// an error message\n\t\t \t$paylanecreditcard->addComment($result->ERROR->error_description, true);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/failure');\n\t\t \treturn;\n\t\t\t}\n\n\t\t\tif (isset($result->OK))\n\t\t\t{\n\t\t\t\t$paylanecreditcard->setCurrentOrderPaid($result->OK->id_sale);\n\n\t\t \tsession_write_close();\n\t\t \t$this->_redirect('checkout/onepage/success');\n\t\t \treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "function _postPayment($data)\n {\n $vars = new JObject();\n //\n $order_id = $data['order_id'];\n JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_k2store/tables');\n $orderpayment = JTable::getInstance('Orders', 'Table');\n @$orderpayment->load(array('order_id' => $order_id));\n //\n try {\n if (!$orderpayment)\n throw new Exception('order_not_found');\n\n if ($data['Status'] != 'OK')\n throw new Exception('cancel_return', 1); // 1 == payment failed exception\n\n $MerchantID = $this->params->get('merchant_id');\n $Amount = $this->zarinpalAmount($orderpayment->get('orderpayment_amount'));\n $Authority = $data['Authority'];\n\n $verifyContext = compact('MerchantID', 'Amount', 'Authority');\n $verify = $this->zarinpalRequest('verification', $verifyContext);\n\n if (!$verify)\n throw new Exception('connection_error');\n\n $status = $verify->Status;\n if ($status != 100)\n throw new Exception('status_' . $status);\n\n // status == 100\n $RefID = $verify->RefID;\n\n $orderpayment->transaction_id = $RefID;\n $orderpayment->order_state = JText::_('K2STORE_CONFIRMED'); // CONFIRMED\n $orderpayment->order_state_id = 1; // CONFIRMED\n $orderpayment->transaction_status = 'Completed';\n\n $vars->RefID = $RefID;\n $vars->orderID = $order_id;\n $vars->id = $orderpayment->id;\n if ($orderpayment->save()) {\n JLoader::register('K2StoreHelperCart', JPATH_SITE . '/components/com_k2store/helpers/cart.php');\n // remove items from cart\n K2StoreHelperCart::removeOrderItems($order_id);\n\n // let us inform the user that the payment is successful\n require_once(JPATH_SITE . '/components/com_k2store/helpers/orders.php');\n try{\n @K2StoreOrdersHelper::sendUserEmail(\n $orderpayment->user_id,\n $orderpayment->order_id,\n $orderpayment->transaction_status,\n $orderpayment->order_state,\n $orderpayment->order_state_id\n );\n } catch (Exception $e) {\n // do nothing\n // prevent phpMailer exception\n }\n }\n } catch (Exception $e) {\n $orderpayment->order_state = JText::_('K2STORE_PENDING'); // PENDING\n $orderpayment->order_state_id = 4; // PENDING\n if ($e->getCode() == 1) { // 1 => trnsaction canceled\n $orderpayment->order_state = JText::_('K2STORE_FAILED'); // FAILED\n $orderpayment->order_state_id = 3; //FAILED\n }\n $orderpayment->transaction_status = 'Denied';\n $orderpayment->save();\n $vars->error = $this->zarinpalTranslate($e->getMessage());\n }\n\n $html = $this->_getLayout('postpayment', $vars);\n return $html;\n }", "public function payAction()\n\t{\n\t\t$paylanedirectdebit = Mage::getSingleton(\"paylanedirectdebit/standard\");\n\t\t$data = $paylanedirectdebit->getPaymentData();\n\t\t\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\t\t\n\t\techo \"Your payment is being processed...\";\n\t\t\n\t\t// connect to PayLane Direct System\t\t\n\t\t$paylane_client = new PayLaneClient();\n\t\t\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanedirectdebit/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanedirectdebit/direct_password');\n\t\t\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$result = $paylane_client->multiSale($data);\n\t\tif ($result == false)\n\t\t{\n\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->ERROR))\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment($result->ERROR->error_description, true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t \treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->OK))\n\t\t{\n\t\t\t$paylanedirectdebit->setPendingStatus($result->OK->id_sale);\n\t\n\t \tsession_write_close(); \n\t \t$this->_redirect('checkout/onepage/success');\n\t \treturn;\n\t\t}\n\t}", "public function run()\n {\n $this->checkoutOnepage->getPaymentBlock()->getSelectedPaymentMethodBlock()->clickPlaceOrder();\n\n $this->checkoutOnepage->getBraintree3dSecureBlock()->fill($this->secure3d);\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function execute()\n {\n $request = $this->getRequest()->getParams();\n $responseContent = [\n 'success' => false,\n 'redirect_url' => 'checkout/#payment',\n 'parameters' => []\n ];\n\n if(empty($request['cf_id']) === false) {\n $resultRedirect = $this->resultRedirectFactory->create();\n $orderIncrementId = $request['cf_id'];\n $order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);\n $validateOrder = $this->checkRedirectOrderStatus($orderIncrementId, $order);\n if ($validateOrder['status'] == \"SUCCESS\") {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($validateOrder['transaction_id'], $order);\n }\n $this->messageManager->addSuccess(__('Your payment was successful'));\n $resultRedirect->setPath('checkout/onepage/success');\n return $resultRedirect;\n\n } else if ($validateOrder['status'] == \"CANCELLED\") {\n $this->messageManager->addWarning(__('Your payment was cancel'));\n $this->checkoutSession->restoreQuote();\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else if ($validateOrder['status'] == \"FAILED\") {\n $this->messageManager->addErrorMessage(__('Your payment was failed'));\n $order->cancel()->save();\n $resultRedirect->setPath('checkout/onepage/failure');\n return $resultRedirect;\n } else if($validateOrder['status'] == \"PENDING\"){\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addWarning(__('Your payment is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else{\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addErrorMessage(__('There is an error. Payment status is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n }\n } else {\n $order = $this->checkoutSession->getLastRealOrder();\n $code = 400;\n \n $transactionId = $request['additional_data']['cf_transaction_id'];\n \n if(empty($transactionId) === false && $request['additional_data']['cf_order_status'] === 'PAID')\n {\n $orderId = $order->getIncrementId();\n $validateOrder = $this->validateSignature($request, $order);\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($transactionId, $order);\n }\n\n $responseContent = [\n 'success' => true,\n 'redirect_url' => 'checkout/onepage/success/',\n 'order_id' => $orderId,\n ];\n\n $code = 200;\n } else {\n $responseContent['message'] = $validateOrder['errorMsg'];\n }\n\n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n } else {\n $responseContent['message'] = \"Cashfree Payment details missing.\";\n }\n }\n\n //update/disable the quote\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $quote = $objectManager->get('Magento\\Quote\\Model\\Quote')->load($order->getQuoteId());\n $quote->setIsActive(true)->save();\n $this->checkoutSession->setFirstTimeChk('0');\n \n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n }", "function _postPayment( $data )\n {\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n\t\t\n\t\tif ($vars->inline_creditcard_form == 1) \n\t\t{\n\t\t\t$data = $this->_getInlinePaymentResponse($data);\n\t\t\t$result = $data['ssl_result'];\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// Process the payment\n\t\t\t$result = JFactory::getApplication()->input->getString('ssl_result');\n\t\t}\n\n $vars = new JObject();\n\n switch ($result)\n {\n case \"0\":\n \t$errors = $this->_process( $data );\n\n \t// No errors\n \tif($errors == '')\n \t{\n\t $vars->message = JText::_('VIRTUALMERCHANT PAYMENT OK');\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n \t// Errors\n \telse\n \t{\n \t\t$vars->message = $errors;\n\t $html = $this->_getLayout('message', $vars);\n\t $html .= $this->_displayArticle();\n \t}\n break;\n default:\n case \"1\":\n $vars->message = JText::_('VIRTUALMERCHANT PAYMENT FAILED').': '.$data['ssl_result_message'];\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n break;\n }\n\n return $html;\n }", "public function threeAction(){\n $isAjax = Mage::app()->getRequest()->isAjax();\n if($isAjax){\n $response = array();\n\n $payment_data = array(\n 'payment_m' => Mage::app()->getRequest()->getPost('payment_m'), // método de pago - value\n 'payment_t' => Mage::app()->getRequest()->getPost('payment_t'), // método de pago - text\n 't_payment_m' => Mage::app()->getRequest()->getPost('t_payment_m'), // forma de pago - value\n 't_payment_t' => Mage::app()->getRequest()->getPost('t_payment_t'), // forma de pago - text\n 'num_cta_m' => Mage::app()->getRequest()->getPost('num_cta_m') // num de cuenta\n );\n\n //helpers\n $facturahelper = Mage::helper('facturacom_facturacion/factura');\n\n $invoice = $facturahelper->createInvoice(\n $payment_data['payment_m'],\n $payment_data['payment_t'],\n $payment_data['t_payment_m'],\n $payment_data['t_payment_t'],\n $payment_data['num_cta_m']\n );\n\n if (isset($invoice->response) && $invoice->response == \"success\") {\n $response = array(\n 'error' => 200,\n 'message' => 'Factura creada exitósamente',\n 'data' => array(\n 'invoice' => $invoice\n )\n );\n } else {\n $response = array(\n 'error' => 400,\n 'message' => 'Ha ocurrido un error.',\n 'data' => $invoice,\n );\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }else{\n die('AJAX request only');\n }\n }", "function _prePayment( $data )\n {\n\t\t// prepare the payment form\n $vars = new JObject();\n \n $vars->ssl_merchant_id = $this->params->get('ssl_merchant_id', '');\n $vars->ssl_user_id = $this->params->get('ssl_user_id', '');\n $vars->ssl_pin = $this->params->get('ssl_pin', '');\n $vars->test_mode = $this->params->get('test_mode', '0');\n\t\t$vars->merchant_demo_mode = $this->params->get('merchant_demo_mode', '0');\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n \n\t\t$vars->ssl_customer_code = JFactory::getUser()->id;\n $vars->ssl_invoice_number = $data['orderpayment_id'];\n $vars->ssl_description = JText::_('Order Number: ').$data['order_id'];\n \n // Billing Info\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->address_1 = $data['orderinfo']->billing_address_1;\n $vars->address_2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip \t\t= $data['orderinfo']->billing_postal_code;\n \n $vars->amount = @$data['order_total'];\n\n\t\tif ($vars->merchant_demo_mode == 1)\n\t\t{\n\t\t\t$vars->payment_url = \"https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars->payment_url = \"https://www.myvirtualmerchant.com/VirtualMerchant/process.do\";\n\t\t}\n\n\t\tif ( $vars->inline_creditcard_form == 0)\n\t\t{\n\t\t\t$vars->receipt_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->failed_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$html = $this->_getLayout('prepayment', $vars);\n\t\t}\n\t\telseif ( $vars->inline_creditcard_form == 1)\n\t\t{\n\t\t\t$vars->action_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->order_id\t = $data['order_id'];\n\t\t\t$html = $this->_getLayout('paymentcreditcard', $vars);\n\t\t}\n\n return $html;\n }", "public function execute() {\r\n \r\n $resultRedirect = $this->getResultRedirect();\r\n $paymentToken = $this->getRequest()->getParam('cko-payment-token');\r\n $quote = $this->session->getQuote();\r\n \r\n try {\r\n $response = $this->verifyPaymentService->verifyPayment($paymentToken);\r\n $cardToken = $response['card']['id'];\r\n \r\n if(isset($response['description']) && $response['description'] == 'Saving new card'){\r\n return $this->vaultCardAfterThreeDSecure( $response );\r\n }\r\n \r\n $this->validateQuote($quote);\r\n $this->assignGuestEmail($quote, $response['email']);\r\n\r\n if($response['status'] === 'Declined') {\r\n throw new LocalizedException(__('The transaction has been declined.'));\r\n }\r\n\r\n $this->orderService->execute($quote, $cardToken, []);\r\n\r\n return $resultRedirect->setPath('checkout/onepage/success', ['_secure' => true]);\r\n } catch (\\Exception $e) {\r\n $this->messageManager->addExceptionMessage($e, $e->getMessage());\r\n }\r\n \r\n return $resultRedirect->setPath('checkout/cart', ['_secure' => true]);\r\n }", "public function _postPayment( $data )\n {\n // Process the payment\n $vars = new JObject();\n\n $app =JFactory::getApplication();\n $paction = JRequest::getVar( 'paction' );\n\n switch ($paction)\n {\n case \"display_message\":\n $session = JFactory::getSession();\n $session->set('j2store_cart', array());\n $vars->message = JText::_($this->params->get('onafterpayment', ''));\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n\n break;\n case \"success_payment\":\n \n // Check User loged in\n $user = JFactory::getUser();\n if($user->id > 0){\n $jinput = JFactory::getApplication()->input;\n include(\"lib/nusoap.php\");\n $url = $this->_getPaysbuyUrl(true);\n $client = new nusoap_client($url, true);\n\n // Get this post from Paysbuy\n $inv = $jinput->post->get('apCode', 0);\n $params = array(\n \"psbID\"=>$this->params->get('psbid',''),\n \"biz\"=>$this->params->get('username',''),\n \"secureCode\"=>$this->params->get('secureCode',''),\n \"invoice\"=>$inv,\n \"flag\"=>\"\"\n );\n\n $result = $client->call(\n 'getTransactionByInvoiceCheckPost',\n array('parameters' => $params),\n 'http://tempuri.org/',\n 'http://tempuri.org/getTransactionByInvoiceCheckPost',\n false,\n true\n );\n\n $result = $result[\"getTransactionByInvoiceCheckPostResult\"];\n $info = $result[\"getTransactionByInvoiceReturn\"];\n\n JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_j2store/tables');\n $tOrder = JTable::getInstance('Orders', 'Table');\n $tOrder->load($inv);\n $order_id = intval($tOrder->id);\n\n // Check $inv from Paysbuy and owner orderinfo\n if($info['result']===\"00\" && !is_null($tOrder->id) && $tOrder->user_id==$user->id){\n \n // Update Status from Paysbuy\n $tOrder->order_state = \"Confirmed\";\n $tOrder->order_state_id = 1;\n $tOrder->store();\n }\n\n }\n\n break;\n \n default:\n $vars->message = JText::_( 'J2STORE_SAGEPAY_MESSAGE_INVALID_ACTION' );\n $html = $this->_getLayout('message', $vars);\n break;\n }\n\n return $html;\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function processPayment() {\n\n\t\t//create the GTPayConnector instance\n\t\t$gtpayConnector = new GTPayConnector();\n\n\t\t//create the VpcConfig instance\n\t\t$vpcConfig = new VpcConfig();\n\n\t\t//get the vpc xml object\n\t\t$vpcXMLConf = \"\";\n\t\t$vpcXMLConf = $vpcConfig->loadVpcConfig();\n\n\t\t// confirm that the configurations of vpc were loaded;\n\t\tif($vpcXMLConf == null) {\n\n\t\t\t//go to the error interface\n\t\t\t$data['error_msg'] = \"Could not Load the Virtual Payment client Details\";\n\t\t\t$data['page_titile'] = \"xxOnline shoe | error\";\n\t\t\t$data['responseData'] = \"\";\n\n\t\t\t$this->load->view(\"error-page\", $data);\n\t\t\t$this->load->view(\"partials/footer\");\n\t\t\treturn;\n\t\t}\n\n\t\t//get the vpc details\n\t\t$vpcUrl = $vpcConfig->getVpcURL($vpcXMLConf);\n\t\t$vpcSalt = $vpcConfig->getVpvSalt($vpcXMLConf);\n\t\t$vpcSaltType = $vpcConfig->getVpcSaltType($vpcXMLConf);\n\t\t$marchantcode = $vpcConfig->getCustomerCode($vpcXMLConf);\n\n\t\t//the transaction log\n\t\t$transactionLog = array();\n\n\t\t// set the salt\n\t\t$gtpayConnector->setSalt($vpcSalt);\n\n\t\t//remove the data that you dont need to send to the payment client\n\t\tunset($_POST['shoeimage']);\n\t\tunset($_POST['submit']);\n\t\t// add the customer code to the post data\n\t\t$_POST['gtp_CustomerCode'] = $marchantcode;\n\n\t\t//sort the post data before encrypting\n\t\tksort($_POST);\n\n\t\t//add the Virtual Payment Client post data to the transaction data\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t\n\t\t\tif(strlen($value) > 0) {\n\t\t\t\t$gtpayConnector->addTransactionFields($key, $value);\n\n\t\t\t\t// add the post data to the transactionLog\n\t\t\t\t$transactionLog[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//get the date and time when the payment request is made\n\t\t$date = new DateTime();\n\t\t$date->setTimeZone(new DateTimeZone('UTC'));\n\t\t$transactionDate = $date->format('Y-m-d\\TH-i-s\\Z');\n\n\t\t//add the date of the transaction\n\t\t$transactionLog[\"transactDate\"] = $transactionDate;\n\n\t\t//log the trasaction on your database\n\t\t$this->transactions->logTransaction($transactionLog);\n\n\t\t// set the salt type\n\t\t$gtpayConnector->setSaltType($vpcSaltType);\n\n\t\t// make oneway hash of the Transaction and add it to the digital order\n\t\t$transactionHash = $gtpayConnector->hashAllTransactionData();\n\n\t\t$gtpayConnector->addTransactionFields(\"gtp_TransDate\", $transactionDate);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHash\", $transactionHash);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHashType\", $vpcSaltType);\n\n\t\t//obtain the redirection url\n\t\t$vpcUrl = $gtpayConnector->getDigitalOrderURL($vpcUrl);\n\n\t\t// send the payment request\n\t\theader(\"Location: \".$vpcUrl);\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public function hookPaymentReturn()\n {\n }", "public function paymentAction()\r\n {\r\n if($this->Request()->getParam('confimOffer',false)) {\r\n return $this->redirect(array(\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'finish'\r\n ));\r\n }\r\n\r\n try{\r\n $agbChecked = $this->Request()->getParam('sAGB', false);\r\n $offerCheckAGB = Shopware()->Plugins()->Backend()->sKUZOOffer()->Config()->offerCheckAGB;\r\n if(!$agbChecked && (isset($offerCheckAGB) && !empty($offerCheckAGB))) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $this->prepareBasket();\r\n if (empty($this->session['sOrderVariables'])) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $offerId = $this->Request()->getParam('offerId');\r\n Shopware()->Session()->offerId = $offerId;\r\n\r\n if (empty($this->View()->sPayment['embediframe'])\r\n && empty($this->View()->sPayment['action'])) {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'finish',\r\n 'sAGB' => 1,\r\n 'offerAcception' => 1\r\n ));\r\n\r\n } else {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'payment',\r\n 'sAGB' => 1\r\n ));\r\n }\r\n\r\n } catch (Exception $e) {\r\n $order = Shopware()->Modules()->Order();\r\n $order->sDeleteTemporaryOrder();\r\n $this->sDeleteBasketOrder();\r\n throw new Enlight_Exception(\"Error making Order:\" . $e->getMessage(), 0, $e);\r\n }\r\n\r\n }", "public function processPayment(){\r\n return true;\r\n }", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "public function hookPaymentReturn($params)\n {\n if ($this->active == false)\n return;\n\n $order = $params['order'];\n\n $logger = new FileLogger(); //0 == nivel de debug. Sin esto logDebug() no funciona.\n $logger->setFilename(_PS_ROOT_DIR_.\"/kushkiLogs/\".date('Y-m-d').\".log\");\n\n\n if ($order->getCurrentOrderState()->id != Configuration::get('PS_OS_ERROR')){\n $this->smarty->assign('status', 'ok');\n\n\n // asignación sesiones normal\n $cookie = new Cookie('cookie_ticket_number');\n $cookiePdfUrl = new Cookie('cookie_kushkiPdfUrl');\n $cookie_flag = new Cookie('cookie_flag');\n\n // asignación sesiones transfer\n $cookie_transfer_flag = new Cookie('transfer_flag');\n // asignación sesiones card_async\n $cookie_card_async_flag = new Cookie('card_async_flag');\n\n\n if(isset($cookie_card_async_flag->variable_name) and (int)$cookie_card_async_flag->variable_name === 1){\n $this->smarty->assign('is_card_async', $cookie_card_async_flag->variable_name);\n $cookie_card_async_ticketNumber = new Cookie('card_async_ticketNumber');\n $cookie_card_async_status = new Cookie('card_async_status');\n $cookie_card_async_transactionReference = new Cookie('card_async_transactionReference');\n $_body_main_card_async = new Cookie('_body_main_card_async');\n\n $var_card_async_created = date('Y/m/d', $_body_main_card_async->variable_name);\n $this->smarty->assign('card_async_created', $var_card_async_created);\n\n if(isset($cookie_card_async_ticketNumber->variable_name) ) {\n $this->smarty->assign('card_async_ticketNumber', $cookie_card_async_ticketNumber->variable_name);\n }\n if(isset($cookie_card_async_transactionReference->variable_name) ) {\n $this->smarty->assign('card_async_transactionReference', $cookie_card_async_transactionReference->variable_name);\n }\n\n if(isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name===1) {\n\n $logger->logInfo(\" * Payment status on card_async: \".$cookie_card_async_status->variable_name.\", ticket number: \" . $cookie_card_async_ticketNumber->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago status: '.$cookie_card_async_status->variable_name.' en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie_card_async_ticketNumber->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n }\n\n\n if(isset($cookie_transfer_flag->variable_name) and (int)$cookie_transfer_flag->variable_name === 1){\n\n // asignación sesiones transfer\n $cookie_transfer_ticketNumber = new Cookie('transfer_ticketNumber');\n $cookie_transfer_status = new Cookie('transfer_status');\n $cookie_transfer_statusDetail = new Cookie('transfer_statusDetail');\n $cookie_transfer_trazabilityCode = new Cookie('transfer_trazabilityCode');\n $_body_main = new Cookie('_body_main');\n $_bankName = new Cookie('_bankName');\n\n if(isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name === 1) {\n\n $logger->logInfo(\" * Payment status: \".$cookie_transfer_status->variable_name.\", ticket number: \" . $cookie_transfer_ticketNumber->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago status: '.$cookie_transfer_status->variable_name.' en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie_transfer_ticketNumber->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n\n\n // mandamos variables a la plantilla\n $_body_main_array = unserialize( $_body_main->variable_name);\n\n\n //razon social\n $var_transfer_razon_social = Configuration::get('KUSHKIPAGOS_RAZON_SOCIAL');\n if (!$var_transfer_razon_social) {\n $var_transfer_razon_social = 'Sin razon social';\n }\n $this->smarty->assign('var_transfer_razon_social', $var_transfer_razon_social);\n\n //estado\n if ($cookie_transfer_status->variable_name == 'approvedTransaction') {\n $var_transfer_status = 'Aprobada';\n } elseif ($cookie_transfer_status->variable_name == 'initializedTransaction') {\n $var_transfer_status = 'Pendiente';\n } elseif ($cookie_transfer_status->variable_name == 'declinedTransaction') {\n $var_transfer_status = 'Denegada';\n } else {\n $var_transfer_status = 'Denegada';\n }\n $this->smarty->assign('var_transfer_status', $var_transfer_status);\n\n //documentNumbre\n $var_transfer_documentNumber = $_body_main_array->documentNumber;\n $this->smarty->assign('var_transfer_documentNumber', $var_transfer_documentNumber);\n\n //bank name\n $var_transfer_bankName = $_bankName->variable_name;\n $this->smarty->assign('var_transfer_bankName', $var_transfer_bankName);\n\n //paymentDescription\n $var_transfer_paymentDescription = $_body_main_array->paymentDescription;\n $this->smarty->assign('var_transfer_paymentDescription', $var_transfer_paymentDescription);\n\n //fecha\n $var_transfer_created= date('Y/m/d', $_body_main_array->created/1000);\n $this->smarty->assign('var_transfer_created', $var_transfer_created);\n\n\n if(isset($cookie_transfer_flag->variable_name) ) {\n $this->smarty->assign('is_transfer', $cookie_transfer_flag->variable_name);\n }\n if(isset($cookie_transfer_status->variable_name) ) {\n $this->smarty->assign('cookie_transfer_status', $cookie_transfer_status->variable_name);\n }\n if(isset($cookie_transfer_ticketNumber->variable_name) ) {\n $this->smarty->assign('ticketNumber', $cookie_transfer_ticketNumber->variable_name);\n }\n if(isset($cookie_transfer_statusDetail->variable_name) ) {\n $this->smarty->assign('transfer_statusDetail', $cookie_transfer_statusDetail->variable_name);\n }\n if(isset($cookie_transfer_trazabilityCode->variable_name) ) {\n $this->smarty->assign('transfer_trazabilityCode', $cookie_transfer_trazabilityCode->variable_name);\n }\n\n }else {\n\n if(isset($cookie->variable_name) ) {\n $this->smarty->assign('ticketNumber', $cookie->variable_name);\n }\n if(isset($cookiePdfUrl->variable_name) ) {\n $this->smarty->assign('pdfUrl', $cookiePdfUrl->variable_name);\n }\n\n if (isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name === 1) {\n\n $logger->logInfo(\" * Payment DONE, ticket number: \" . $cookie->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago CORRECTO en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n }\n\n }else{\n $logger->logError(\" * FAIL whit reference: \".$order->reference.\" - orden id: \".$order->id.\" - amount: \".Tools::displayPrice(\n $params['order']->getOrdersTotalPaid(),\n new Currency($params['order']->id_currency),\n false\n ) );\n PrestaShopLogger::addLog('Kushki pago FALLIDO en orden '.$order->id.' con referencia '.$order->reference, 3);\n\n }\n\n $this->smarty->assign(array(\n 'shop_name' => $this->context->shop->name,\n 'id_order' => $order->id,\n 'reference' => $order->reference,\n 'params' => $params,\n 'total_to_pay' => Tools::displayPrice(\n $params['order']->getOrdersTotalPaid(),\n new Currency($params['order']->id_currency),\n false\n )\n ));\n\n return $this->fetch('module:kushkipagos/views/templates/hook/confirmation.tpl');\n }", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $execution->setPayerId($payerId);\n \n $transaction = new Transaction();\n $amount = new Amount();\n\n $details = new Details();\n $details->setShipping(0)\n ->setTax(0)\n ->setSubtotal(Cart::subtotal());\n\n $amount->setCurrency('BRL');\n $amount->setTotal(Cart::total());\n $amount->setDetails($details);\n\n $transaction->setAmount($amount);\n\n $execution->addTransaction($transaction);\n\n try{\n // Execute payment\n $result = $payment->execute($execution, $this->_apiContext);\n \n try{\n\n $payment = Payment::get($paymentId, $this->_apiContext);\n }catch(Exception $ex){\n\n die($ex);\n }\n }catch(PayPalConnectionException $ex){\n\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n }catch(Exception $ex){\n\n die($ex);\n }\n\n Session::flash('status', 'Pagamento realizado');\n Session::put('token-paypal', $_GET['token']);\n return redirect('/paypal/transaction/complete');\n }", "public function process_payment() {\n\n\t\t$this->get_handler()->log( 'Processing payment' );\n\n\t\tcheck_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_apple_pay_process_payment', 'nonce' );\n\n\t\t$response = stripslashes( SV_WC_Helper::get_post( 'payment' ) );\n\n\t\t$this->get_handler()->store_payment_response( $response );\n\n\t\ttry {\n\n\t\t\t$result = $this->get_handler()->process_payment();\n\n\t\t\twp_send_json_success( $result );\n\n\t\t} catch ( \\Exception $e ) {\n\n\t\t\t$this->get_handler()->log( 'Payment failed. ' . $e->getMessage() );\n\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'code' => $e->getCode(),\n\t\t\t) );\n\t\t}\n\t}", "function commerce_oz_eway_3p_redirect_form_submit($order, $payment_method) {\n \n// // dsm($payment_method, 'method');\n// \t// dsm($pane_form, 'pane');\n// \t// dsm($pane_values, 'values');\n// // dsm($order, 'order');\n// // dsm($charge, 'charge');\n \n // dsm($_POST, 'post'); \n // dsm($order, '$order'); \n // dsm($payment_method, '$payment_method'); \n \n if($_POST){\n// return;\n \n }\n \t \t \t\n // Get the order\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $order_id = $order->order_id;\n \n /*\n \n $credit_card = $pane_values['commerce_oz_3p_head']['credit_card'];\n // // dsm($pane_values);\n \n // Get the settings and set some vars for same\n // $settings = $payment_method['settings'];\n $debugmode = 'debug'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_debug'];\n $livemode = 'test'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_mode'];\n \n\t// Transaction record\n\t// Prepare a transaction object to log the API response.\n $transaction = _commerce_oz_open_transaction($payment_method['base'], $order->order_id);\n \n module_load_include('php', 'commerce_oz', 'includes/api/EwayPayment');\n\n\t$eway = new EwayPayment( '87654321', 'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp' );\n\t\n\t// Card Details\n\t\n\t$eway->setCardNumber( $credit_card['number'] );\n\t$eway->setCardExpiryMonth( $credit_card['exp_month'] );\n\t$eway->setCardExpiryYear( substr($credit_card['exp_year'], -2) );\n//\t$eway->setTotalAmount( $charge['amount'] );\n\t$eway->setTotalAmount\t(1000);\n\n\t$eway->setCVN( $credit_card['code'] );\n\t\n\t// Invoice & Transaction Details\n\t\n\t$eway->setCustomerInvoiceDescription( 'Testing' );\n\t$eway->setCustomerInvoiceRef( $order_id );\n\t$eway->setTrxnNumber( $transaction->transaction_id );\n\n \n $request_map = array_filter((array)$eway);\n \n $error = $eway->doPayment();\n \n $response_map = array_filter((array)$eway);\n */\n \n// // dsm($request_map);\n// // dsm($response_map);\n \n // _commerce_oz_eway_3p_close_transaction($transaction, $request_map, $response_map);\n\t\n//\t_commerce_oz_debug_transaction($transaction, $request_map, $response_map, TRUE);\n\t\n\t// Fire completion Rule\n\t//rules_invoke_event('commerce_oz_transaction_complete', $transaction);\n\t\n\t// return _commerce_oz_handle_payment_response($transaction, $request_map, $response_map);\n \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 checkout_done($order_id, $payment)\n {\n $order = Order::findOrFail($order_id);\n $order->payment_status = 'paid';\n $order->payment_details = $payment;\n $order->save();\n\n if (\\App\\Addon::where('unique_identifier', 'affiliate_system')->first() != null && \\App\\Addon::where('unique_identifier', 'affiliate_system')->first()->activated) {\n $affiliateController = new AffiliateController;\n $affiliateController->processAffiliatePoints($order);\n }\n\n if (\\App\\Addon::where('unique_identifier', 'club_point')->first() != null && \\App\\Addon::where('unique_identifier', 'club_point')->first()->activated) {\n $clubpointController = new ClubPointController;\n $clubpointController->processClubPoints($order);\n }\n if (\\App\\Addon::where('unique_identifier', 'seller_subscription')->first() == null || !\\App\\Addon::where('unique_identifier', 'seller_subscription')->first()->activated) {\n if (BusinessSetting::where('type', 'category_wise_commission')->first()->value != 1) {\n $commission_percentage = BusinessSetting::where('type', 'vendor_commission')->first()->value;\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $commission_percentage = $orderDetail->product->category->commision_rate;\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + $orderDetail->price + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n\n $order->commission_calculated = 1;\n $order->save();\n\n Session::put('cart', collect([]));\n // Session::forget('order_id');\n Session::forget('payment_type');\n Session::forget('delivery_info');\n Session::forget('coupon_id');\n Session::forget('coupon_discount');\n\n\n flash(translate('Payment completed'))->success();\n return view('frontend.order_confirmed', compact('order'));\n }", "public function _postPayment( $data )\n{\n\t// Process the payment\n\t$vars = new JObject;\n\t$jinput = JFactory::getApplication()->input;\n\t$app = JFactory::getApplication();\n\t$paction = $jinput->get('paction');\n\n\tswitch ($paction)\n\t{\n\t\tcase 'process_recurring':\n\t\t\t// TODO Complete this\n\t\t\t$app->close();\n\t\tbreak;\n\t\tcase 'process':\n\t\t\t$vars->message = $this->_process();\n\t\t\t$html = $this->_getLayout('message', $vars);\n\t\tbreak;\n\t\tdefault:\n\t\t\t$vars->message = JText::_('COM_TIENDA_INVALID_ACTION');\n\t\t\t$html = $this->_getLayout('message', $vars);\n\t\tbreak;\n\t}\n\n\treturn $html;\n}", "public function execute(){\n return $this->payment(); \n }", "public function processPayment()\n\t{\n\t\t$objOrder = new IsotopeOrder();\n\t\tif (!$objOrder->findBy('cart_id', $this->Isotope->Cart->id))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($objOrder->date_payed > 0 && $objOrder->date_payed <= time())\n\t\t{\n\t\t\tunset($_SESSION['PAYMENT_TIMEOUT']);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!isset($_SESSION['PAYMENT_TIMEOUT']))\n\t\t{\n\t\t\t$_SESSION['PAYMENT_TIMEOUT'] = 60;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['PAYMENT_TIMEOUT'] = $_SESSION['PAYMENT_TIMEOUT'] - 5;\n\t\t}\n\n\t\tif ($_SESSION['PAYMENT_TIMEOUT'] === 0)\n\t\t{\n\t\t\tglobal $objPage;\n\t\t\t$this->log('Payment could not be processed.', __METHOD__, TL_ERROR);\n\t\t\t$this->redirect($this->generateFrontendUrl($objPage->row(), '/step/failed'));\n\t\t}\n\n\t\t// Reload page every 5 seconds and check if payment was successful\n\t\t$GLOBALS['TL_HEAD'][] = '<meta http-equiv=\"refresh\" content=\"5,' . $this->Environment->base . $this->Environment->request . '\">';\n\n\t\t$objTemplate = new FrontendTemplate('mod_message');\n\t\t$objTemplate->type = 'processing';\n\t\t$objTemplate->message = $GLOBALS['TL_LANG']['MSC']['payment_processing'];\n\t\treturn $objTemplate->parse();\n\t}", "public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}", "public function complete(){\n\n\t\tif (isset($_GET[\"paymentId\"]) && $_GET[\"paymentId\"] == session('paypal_payment_id')) {\n\t\t\t$result = $this->paypal->execute_payment($_GET[\"paymentId\"], $_GET[\"PayerID\"], $this->mode);\n \n\t\t\t// get amount\n\t\t\t$amount = $result->transactions[0]->amount;\n\t\t\t$amount = $amount->total;\n\n\t\t\t// get Transaction Id\n\t\t\t$transactions = $result->getTransactions();\n\t\t\t$related_resources = $transactions[0]->getRelatedResources();\n\t\t\t$sale = $related_resources[0]->getSale();\n\t\t\t$get_transaction_fee = $sale->getTransactionFee();\n\t\t\t$sale_id = $sale->getId();\n\n\n\t\t\tif(!empty($result) && $result->state == 'approved'){\n\n\t\t\t\trequire_once 'orders.php';\n\t\t\t\t$data_order = (object)array(\n\t\t\t\t\t'payment_type' => $this->payment_type,\n\t\t\t\t\t'amount' => $amount,\n\t\t\t\t\t'txt_id' => $sale_id,\n\t\t\t\t\t'transaction_fee' => $get_transaction_fee->getValue(),\n\t\t\t\t\t'order_details' => session('order_details'),\n\t\t\t\t);\n\t\t\t\tunset_session('order_details');\n\t\t\t\tunset_session('paypal_payment_id');\t\n\t\t\t\t$order = new orders();\n\t\t\t\tif(!$order->save_order($data_order)){\n\t\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t\t};\n\t\t\t\t/*---------- Add funds to user balance ----------*/\n\t\t\t\tredirect(cn(\"checkout/success\"));\n\t\t\t}else{\n\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t}\n\n\t\t}else{\n\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t}\n\t}", "public function makePaymentAction()\n {\n if ($_SESSION['actionAvailable']) {\n try {\n $id = $_SESSION['id'];\n $account = new BankAccountModel(null, $id);\n $toAccountID = $_POST['accountTo'];\n\n\n $fromAccountID = $account->findID($_POST['accountFrom']);\n $transaction = new TransactionModel();\n $transaction->validateTransfer($toAccountID, $fromAccountID);\n $transaction->makeTransfer();\n $transaction->save();\n\n $view = new View('transactionComplete');\n echo $view->render();\n $_SESSION['actionAvailable'] = false;\n } catch (\\UnexpectedValueException $e) {\n $_SESSION['emptyField'] = true;\n $this->redirect('paymentPage');\n } catch (\\LogicException $e) {\n $_SESSION['validTransaction'] = false;\n $this->redirect('paymentPage');\n }\n }\n }", "public function process_payment(){\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get all field values.\n $form_fields = $this->input->post(NULL);\n \n //Set Requiered parameter to be pass to merchant payment process\n $parameter = array(\n 'schedule_id' => $form_fields['schedule_id'],\n 'exception_id' => $form_fields['exception_id'],\n 'school_id' => $form_fields['school_id'],\n 'percentage' => $form_fields['percentage'],\n 'schedule_type' => $form_fields['schedule_type'],\n 'session_name' => $form_fields['session_name'],\n 'session_id' => $form_fields['session_id'],\n 'penalty' => $form_fields['penalty'],\n 'user_id' => $form_fields['user_id'],\n 'amount' => $form_fields['amount'],\n 'revenue_head' => $form_fields['revhead']\n );\n \n //initiate pay process : Send the parameter to pay merchant\n $this->pay->process($parameter);\n \n \n }else{\n \n //Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg);\n \n // Redirect to payment set, showing notifiction messages if there are.\n redirect(site_url('payment/myschedule'));\n } \n \n }", "public function processPayment(Payment $payment): void\n {\n }", "public function process_pct_payment($payload)\n\t{\n\t \n\t # Load user model\n\t $this->load->model('user');\n\t $result = $this->user->sign_in($this->input->post('username'), $this->input->post('userpassword'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnNum = \"PCTINT\".time();\n\t $userId = $result;\n\t $itemNumber = $this->input->post('item_id');\n\t $itemName = $this->input->post('item_name');\n\t $itemCategory = $this->input->post('category_id');\n\t $grossAmount = $this->input->post('invoice_amount');\n\t \n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $email = $profile->{User::_EMAIL};\n\t \n\t \n\t $this->load->model('psss_purchase_history','psss');\n\t \n\t $this->psss->create_purchase_history($txnNum, $userId, $itemNumber, $itemName, $itemCategory, $grossAmount, \"PCT\", $email, 'Internal Wallet');\n// \t $this->message->setFlashMessage(Message::PAYMENT_SUCCESS, array('id'=>'1'));\n\t $response = array('flag'=>1, 'message'=>Message::PAYMENT_SUCCESS);\n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($userId, 1, $txnNum, 'Data Purchase', $grossAmount);\n\t \n\t \n\t # Now since the payment is done, we need to subtract gross amount\n\t \n\t $profile = $this->user->getUserProfile($userId);\n\t $walletAmount = $profile->{user::_PCT_WALLET_AMOUNT};\n\t $updatedAmount = ($walletAmount - $grossAmount);\n\t \n\t $this->user->update_pct_wallet_amount($userId, $updatedAmount); \n\t \n\t return $response;\n\t}", "public function paymentAction()\n {\n try {\n /* @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n\n /**\n * @var $order Mage_Sales_Model_Order\n */\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n\n $paymentMethod = $order->getPayment()->getMethodInstance();\n\n $url = $paymentMethod->getGatewayUrl($order);\n\n if(!$order->getEmailSent()) {\n $order->sendNewOrderEmail();\n $order->setEmailSent(true);\n }\n\n /**\n * @var $quote Mage_Sales_Model_Quote\n */\n $quote = Mage::getSingleton('sales/quote');\n $quote->load($order->getQuoteId());\n $quote->setIsActive(true);\n $quote->save();\n\n // redirect customer to the cart (dirty)\n $block = new Mage_Core_Block_Template();\n $block->setTemplate('mcpservice/redirect.phtml');\n $block->assign('url',$url);\n $block->assign('media_url',Mage::getBaseUrl().'../media/micropayment/');\n $block->assign('year',date('Y'));\n $block->assign('payment_method',$order->getPayment()->getMethod());\n $block->assign('payment_title',$order->getPayment()->getMethodInstance()->getConfigData('title'));\n $block->assign('shop_title', Mage::getStoreConfig('general/store_information/name', Mage::app()->getStore()->getId()));\n\n echo $block->renderView();\n } catch (Exception $e) {\n\n }\n }", "function process_payment( $order_id ) {\n global $woocommerce;\n \n // Create the order object\n $order = new WC_Order( $order_id );\n // Get response object template\n $successResponse = $this->getResponseTemplate( $order );\n // Get data for charge to midtrans API\n $params = $this->getPaymentRequestData( $order_id );\n // Add acquiring bank params\n if (strlen($this->get_option('acquring_bank')) > 0)\n $params['credit_card']['bank'] = strtoupper ($this->get_option('acquring_bank'));\n\n // Empty the cart because payment is initiated.\n $woocommerce->cart->empty_cart();\n try {\n $snapResponse = WC_Midtrans_API::createSnapTransaction( $params, $this->id );\n } catch (Exception $e) {\n $this->setLogError( $e->getMessage() );\n WC_Midtrans_Utils::json_print_exception( $e, $this );\n exit();\n }\n\n // If `enable_redirect` admin config used, snap redirect\n if(property_exists($this,'enable_redirect') && $this->enable_redirect == 'yes'){\n $redirectUrl = $snapResponse->redirect_url;\n }else{\n $redirectUrl = $order->get_checkout_payment_url( true ).\"&snap_token=\".$snapResponse->token;\n }\n\n // Store snap token & snap redirect url to $order metadata\n $order->update_meta_data('_mt_payment_snap_token',$snapResponse->token);\n $order->update_meta_data('_mt_payment_url',$snapResponse->redirect_url);\n $order->save();\n\n if(property_exists($this,'enable_immediate_reduce_stock') && $this->enable_immediate_reduce_stock == 'yes'){\n // Reduce item stock on WC, item also auto reduced on order `pending` status changes\n wc_reduce_stock_levels($order);\n }\n\n $successResponse['redirect'] = $redirectUrl;\n return $successResponse;\n }", "public function finish()\n\t{\n\t\t//first we deactivate the quote\n\t\t$this->_getQuote()->setIsActive(false)->save();\n\t\t\n\t\t//now we add the payment information to the order payment\n\t\t$this->_getMethodInstance()->addRequestData($this->getResponse());\n\t\t\n\t\t//now we authorise the payment\n\t\tif(false === $this->_getMethodInstance()->authPayment($this->getResponse())){\n\t\t\tMage::throwException(\"Payment Failure\");\n\t\t}\n\t\t\n\t\t//now we shift the order to either pending state, \n\t\t// or processing state (with invoice) depending on the capture settings.\n\t\t$this->_getMethodInstance()->process($this->getResponse());\n\t\t\n\t\t//send off the new order email\n\t\t$this->_getOrder()->sendNewOrderEmail();\n\t}", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "public function run()\n {\n $this->checkoutOnepage->getVaultPaymentBlock()->saveCreditCard(\n $this->payment['method'],\n $this->creditCardSave\n );\n }", "function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\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 (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}", "public function execute()\n {\n // debug mode\n $this->_helper->debug('Start \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute() with request ' . $this->_jsonHelper->jsonEncode($this->getRequest()->getParams()));\n\n $query = $this->getRequest()->getParams();\n $order = $this->_checkoutSession->getLastRealOrder();\n\n // Check if not fraud detected not doing anything (let cron update the order if payment successful)\n if ($this->_afterpayConfig->getPaymentAction() == AbstractMethod::ACTION_AUTHORIZE_CAPTURE) {\n //Steven - Bypass the response and do capture\n $redirect = $this->_processAuthCapture($query);\n } elseif (!$this->response->validCallback($order, $query)) {\n $this->_helper->debug('Request redirect url is not valid.');\n }\n // debug mode\n $this->_helper->debug('Finished \\Afterpay\\Afterpay\\Controller\\Payment\\Response::execute()');\n\n // Redirect to cart\n $this->_redirect($redirect);\n }", "function _exp_checkout_payment_success() {\n return true;\n }", "public function takePayment() {\r\n if ($this->payment instanceof PayPal) {\r\n $this->payment->payByPayPal();\r\n }elseif ($this->payment instanceof SagePay) {\r\n $this->payment->payBySagePay();\r\n } elseif ($this->payment instanceof WorldPay) {\r\n $this->payment->payByWorldPay();\r\n }\r\n }", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "public function Payment(){\r\n \r\n echo \"class QuarterlyInt : <br />\";\r\n\r\n $tuitionCycle = (($this->ProgramTuition / 100)*25);\r\n\t\t$firstPayment = $tuitionCycle; \r\n \r\n\t\techo \"First payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: \" . $this->StartDate . \"<br /><br />\";\r\n \t\r\n\t\t\r\n\t\t$secondPayment = $tuitionCycle;\r\n\r\n\t\techo \"Second payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: Three Months Later $ <br /><br />\";\r\n\t\r\n\r\n\t\t$thirdPayDate = $tuitionCycle; \r\n\r\n\t\techo \"Third payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: six Months Later $ <br /><br />\";\r\n\r\n\r\n\t\t$forthPayDate = $tuitionCycle;\r\n\r\n\t\techo \"Forth payment : \" . $tuitionCycle .\"$ <br />\";\r\n\t\techo \" date: nine Months Later \";\r\n\r\n\t\t\techo \"<hr/>\";\r\n }", "public function success_payment(){\n\n\t\tif ( !empty( $_GET['paymentId'] ) && !empty( $_GET['PayerID'] ) ) {\n\n\t\t\ttry{\n\t\t\t\t$result = $this->paypal->execute_payment( $_GET['paymentId'], $_GET['PayerID'] );\n\t\t\t\t$result = json_decode($result, true);\n\t\t\t\t$paidAmount = $result['transactions'][0]['amount']['total'];\n\t\t\t\t\n\t\t\t\tif ($this->advertiser_model->check_exist($paymentId) == FALSE)\n\t\t\t\t{\n\t\t\t\t\t$user=$this->advertiser_model->get_advertiser_by_id($_SESSION['id']);\n\t\t\t\t\t$previous_bal = $user['account_bal'];\n\t\t\t\t\t$new_bal = $paidAmount+$previous_bal;\n\t\t\t\t\t$this->advertiser_model->credit_balance(array('account_bal' =>$new_bal ));\n\t\t\t\t\t$this->advertiser_model->insert_to_payment_record(array('method'=>'paypal',\n\t\t\t\t\t'payment_type'=>'deposit','amount'=> $paidAmount,'user_type'=>'advertiser','user_id' => $_SESSION['id'],\n\t\t\t\t\t'time'=>time(), 'txn_id'=>$_GET['paymentId'], 'payer_id'=>$_GET['PayerID'], 'payment_token'=>$_GET['token']));\n\n\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-green'>Payment Successfully Processed</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. The transaction already exist.</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. Error is: \" . $e->getMessage() . \"</span>\";\n\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t}\n\n\t\t}\n\n\t\treturn;\n\n\t}", "private function payOrder($order){\r\n $this->log('Paying order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'Pagado con flow');\r\n $order->payment_complete();\r\n }", "function payment_success()\n {\n\t\t\t/*log_message('INFO', 'Inside order2/payment_success');\n\t\t\t$this->morder->equateProductsQuantities();\n\t\t\tlog_message('INFO', 'end equateProductsQuantities()______________________________________________________');*/\n\t\t\t/* END ADDED BY SHAMMI SHAILAJ */\n\t\t\t\n //print \"<p>inside payments success</p>\";\n include('header_include.php');\n $data['email'] = $this->session->userdata('email');\n $this->session->unset_userdata('email');\n $txnid= $this->session->userdata('e_txn_id');\n $data['transID'] = $txnid;\n //print \"<p>transID = \".$txnid.\"</p>\";\n if(is_null($this->session->userdata('e_txn_id')) || strcmp($this->session->userdata('e_txn_id'), \"\") === 0)\n {\n $data['transID'] = NULL;\n }\n $this->session->unset_userdata('e_txn_id');\n \n //purchase email\n $this->load->model('vc_orders');\n /* following code added by shammi to generate data for sokrati and ecommerce tracking */\n if(!is_null($data['transID']))\n {\n $transDataDB = $this->vc_orders->orderDetails($data['transID']);\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n //exit();\n if($transDataDB !== FALSE)\n {\n $data['prodsCount'] = count($transDataDB);\n $data ['buyerFName'] = $transDataDB[0]->shipping_fname;\n $data ['buyerLName'] = $transDataDB[0]->shipping_lname;\n $data['buyerAddress'] = $transDataDB[0]->shipping_address;\n $data['buyerCity'] = $transDataDB[0]->shipping_city;\n $data['buyerPinCode'] = $transDataDB[0]->shipping_pincode;\n $data['buyerState'] = $transDataDB[0]->shipping_state;\n $data['buyerCountry'] = $transDataDB[0]->shipping_country;\n $data['buyerUserID'] = $transDataDB[0]->user_id;\n $data['tax'] = 0;\n $grandTotal = 0;\n $products = array();\n if(is_array($products))\n {\n for($j=0;$j < $data['prodsCount']; $j++)\n {\n $product = new productInfo;\n $product->storeID = $transDataDB[$j]->store_id;\n $product->storeName = $transDataDB[$j]->store_name;\n $order_no = $transDataDB[$j]->order_id;\n $product->orderID = $transDataDB[$j]->order_id;\n $product->productName = $transDataDB[$j]->product_name;\n $product->vSize = $transDataDB[$j]->vsize;\n $product->vColor = $transDataDB[$j]->vcolor;\n $product->unitPrice = $transDataDB[$j]->amt_paid;\n $product->quantity = $transDataDB[$j]->quantity;\n $grandTotal += $transDataDB[$j]->amt_paid * $transDataDB[$j]->quantity;\n $product->productID = $transDataDB[$j]->product_id; \n $product->cid = $transDataDB[$j]->couponid;\n $products[$j] = $product;\n /* ADDED BY SHAMMI SHAILAJ to keep quantities in the new and old products table EQUAL (NEW METHOD)*/\n\t\t\t\t\t\t\t//log_message('INFO', 'Inside order2/payment_success');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' => 1, 'msg' => 'Inside order2/payment_success'));\n\t\t\t\t\t\t\t$this->morder->equateProductsQuantities2($product->productID);\n\t\t\t\t\t\t\t//log_message('INFO', 'end equateProductsQuantities2()______________________________________________________');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' =>1, 'msg' => 'end equateProductsQuantities2()______________________________________________________'));\n /* END ADDED BY SHAMMI SHAILAJ */\n }\n }\n else\n {\n $product = new productInfo;\n $product->storeID = $transDataDB->store_id;\n $product->storeName = $transDataDB->store_name;\n $order_no = $transDataDB->order_id;\n $product->orderID = $transDataDB->order_id;\n $product->productName = $transDataDB->product_name;\n $product->vSize = $transDataDB->vsize;\n $product->vColor = $transDataDB->vcolor;\n $product->unitPrice = $transDataDB->amt_paid;\n $product->quantity = $transDataDB->quantity;\n $product->productID = $transDataDB->product_id;\n $product->cid = $transDataDB->couponid;\n $grandTotal += $transDataDB->amt_paid * $transDataDB->quantity;\n $products[] = $product;\n }\n $data['grandTotal'] = $grandTotal;\n $data['products'] = $products;\n }\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n }\n /* end code added by shammi to generate data for sokrati and ecommerce tracking */\n $base_url = base_url();\n $ip_address = (string)$this->input->ip_address();\n //log_message('Info',\"Ipaddress = $ip_address\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Ipaddress = $ip_address\"));\n if($ip_address!='127.0.0.1')\n {\n //log_message('Info',\"Allow mail as the Ip is not 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' =>1, 'msg' => \"Allow mail as the Ip is not 127.0.0.1\"));\n $mail_info = $this->vc_orders->purchaseMailDetails($txnid);\n $this->slog->write(array('level' =>1 ,'msg' => \"mail_info FROM ORDERS2/PAYMENT_SUCCESS_____\".print_r($mail_info, TRUE)));\n if($mail_info!=0)\n {\n $count_prod = count($mail_info);\n $buyer_name = $mail_info[0]['shipping_fname'].' '.$mail_info[0]['shipping_lname'];\n $shipping_address = $mail_info[0]['shipping_address'];\n $shipping_city = $mail_info[0]['shipping_city'];\n $pin_code = $mail_info[0]['shipping_pincode'];\n $couponcode = $mail_info[0]['couponid'];\n $payment_mode = $mail_info[0]['pg_type'];\n if ($payment_mode=='COD')\n {\n $payment_mode = 'Cash on Delivery';\n }\n elseif ($payment_mode=='CC')\n {\n $payment_mode = 'Credit Card';\n }\n elseif ($payment_mode=='DC')\n {\n $payment_mode = 'Debit Card';\n }\n elseif ($payment_mode=='NB')\n {\n $payment_mode = 'Net Banking';\n }\n \n for($j=0;$j<$count_prod;$j++)\n {\n $order_no = $mail_info[$j]['order_id'];\n $product_name = $mail_info[$j]['product_name'];\n $variant_size = \"Size: \".$mail_info[$j]['variant_size'];\n $variant_color = \"Color: \".$mail_info[$j]['variant_color'];\n $variant_details = \"\";\n $this->slog->write(array('level' => 1,'msg' => \"INDEX MAIL VALUE\".print_r($mail_info[$j]['sent_email_id'],TRUE)));\n if ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \"\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \" - (\".$variant_size.\")\";\n }\n elseif ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_color.\")\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_size.\",\".$variant_color.\")\";\n }\n $process_days = (int)$mail_info[$j]['process_days'];\n $productImagePath = './assets/images/stores/'.$mail_info[$j]['store_id'].'/'.$mail_info[$j]['product_id'].'/';\n if(file_exists($productImagePath.'fancy3.jpg'))\n {\n $productImage = $productImagePath.'fancy3.jpg';\n }\n elseif(file_exists($productImagePath.'fancy3.JPG'))\n {\n $productImage = $productImagePath.'fancy3.JPG';\n }\n else\n {\n $productImage = '';\n }\n //log_message('INFO', 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']));\n include 'mail_4.php';\n //Buyer Purchase Email\n $this->load->model('automate_model');\n\t\t\t\t\t\t\t$jobType = 1; // an email job\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate email\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 66); // current time + 1 minute 6 seconds\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => $mail_info[$j]['sent_email_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $purchase_message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>An Email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A (P)', $jobScheduledTime).\" </p>\" ) );\n\n\t\t\t\t\t\t\t$smsMsg = \"Dear \".$mail_info[$j]['shipping_fname'].' '.$mail_info[$j]['shipping_lname'].\", \\r\\n Thank you for placing an order with us. Your order ID \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$smsMsg .= \" will be dispatched by \".date( \"d-M-Y\", ( strtotime($mail_info[$j]['date_of_pickup']) ) ).\". Once dispatched, it will reach you in 1-5 working days. Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$smsNo = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\tif($smsNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$smsNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->load->model('smsc');\n\t\t\t\t\t\t\t$this->smsc->sendSMS($smsNo, $smsMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent an SMS to '.json_encode($smsNo).'. The msg sent is <p>'.$smsMsg.'</p>' ) );\n\n\t\t\t\t\t\t\t// now set an email job to be executed only after 24 hours if the seller has not sent the mail\n\t\t\t\t\t\t\t$orderEmail11Data = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerName'] = $mail_info[$j]['owner_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['orderID'] = $mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['dispatchDate'] = $mail_info[$j]['date_of_pickup'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerEmail'] = $mail_info[$j]['contact_email'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeName'] = $mail_info[$j]['store_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productName'] = $mail_info[$j]['product_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productID'] = $mail_info[$j]['product_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['bnbProductCode'] = $mail_info[$j]['bnb_product_code'];\n\t\t\t\t\t\t\t$orderEmail11Data['amountPaid'] = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n\t\t\t\t\t\t\t$orderEmail11Data['paymentType'] = $mail_info[$j]['pg_type'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerName'] = $mail_info[$j]['shipping_fname'].\" \".$mail_info[$j]['shipping_lname'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerAddress'] = $mail_info[$j]['shipping_address'].\"<br/>\".$mail_info[$j]['shipping_city'].\"<br/>\".$mail_info[$j]['shipping_pincode'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerContactNumber'] = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\t$orderEmail11Data['processingTime'] = $mail_info[$j]['process_days'];\n\n\t\t\t\t\t\t\t$orderEmail11 = $this->load->view('emailers/orderEmail11', $orderEmail11Data, TRUE);\n\n\t\t\t\t\t\t\t$jobType = 4; // a check and then send email job depending upon the result of the check\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate index\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 86460); // current time + 1 day (24 hrs 1 minute)\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'orderID' => $order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => ( (empty($mail_info[$j]['contact_email']) )? $mail_info[$j]['contact_email'] : '[email protected]'),\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $orderEmail11\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>A check and then email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A T (P)', $jobScheduledTime).\" </p>\" ) );\n\t\t\t\t\t\t\t/* OLD EMAIL SENDING CODE\n $this->load->library('email');\n $mailArraylog = array();\n $this->email->from('[email protected]','BuynBrag');\n $this->email->to($mail_info[$j]['sent_email_id']);\n $this->email->bcc('[email protected],[email protected]');\n $this->email->subject(\"BuynBrag: Order Success,Order Id:$order_no\");\n\n $this->email->message($purchase_message);\n $this->email->set_newline(\"\\r\\n\");\n if($this->email->send())\n {\n log_message('Info', 'SUCCESSFULLY SENT EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $mailArraylog = array('level' => 1, 'send status' => 1,'to' => $mail_info[$j]['sent_email_id'],'bcc' =>'[email protected],[email protected]','From' => '[email protected]','mail content' => $purchase_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog);\n }\n else\n {\n log_message('Info', 'FAILED SENDING EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n }*/\n\n //////////////////////////////\n $owner_name = $mail_info[$j]['owner_name'];\n $owner_email = $mail_info[$j]['contact_email'];\n $total_amount = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n include 'mail_7.php';\n\n $sellerSMSMsg = \"Dear \".$mail_info[$j]['owner_name'].\", \\r\\n You have recieved a new order for \".$mail_info[$j]['product_name'].\". The order ID is \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$sellerSMSMsg .= \" and the quantity ordered is \".$mail_info[$j]['quantity'].\". Please make sure that the product is dispatched by \".date( \"d-M-Y\", ( ( strtotime($mail_info[$j]['date_of_pickup']) ) - 86400) ).\". Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$sellerSMSNo = $mail_info[$j]['contact_number'];\n\t\t\t\t\t\t\tif($sellerSMSNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sellerSMSNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->smsc->sendSMS($sellerSMSNo, $sellerSMSMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent seller SMS to '.json_encode($sellerSMSNo).'. The msg sent is <p>'.$sellerSMSMsg.'</p>' ) );\n\n //Seller New Order Email\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$config['protocol'] = 'smtp';\n\t\t\t\t\t\t\t$config['smtp_host'] = 'ssl://smtp.googlemail.com';\n\t\t\t\t\t\t\t$config['smtp_port'] = 465;\n\t\t\t\t\t\t\t$config['smtp_user'] = '[email protected]';\n\t\t\t\t\t\t\t$config['smtp_pass'] = '';*/\n\n $this->load->library('email');\n $mailArraylog2 = array();\n $this->email->clear(TRUE);\n $this->email->from('[email protected]','BuynBrag');\n if(empty($owner_email))\n {\n \t//log_message('INFO', 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]');\n \t$this->load->model('slog');\n \t$this->slog->write(array('level' => 1 , 'msg' => 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]'));\n $owner_email = '[email protected]';\n }\n\n $this->email->to($owner_email);\n $this->email->bcc('[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]');\n $this->email->subject(\"New Order from BuynBrag,Order Id:\".$order_no);\n $this->email->message($new_order_message);\n $this->email->attach('./invoice/'.$txnid.'/buyer_invoice_order_'.$order_no.'.pdf');\n \n if(!empty($productImage))\n {\n $this->email->attach($productImage);\n }\n\n $this->email->set_newline(\"\\r\\n\");\n \n if($this->email->send())\n {\n //log_message('Info',\"Seller eMail sent to $owner_email for order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => \"Seller eMail sent to $owner_email for order no: $order_no\" ));\n $mailArraylog2 = array('level' => 1, 'send status' => 1,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n if($j==($count_prod-1))\n {\n $this->vc_orders->purchase_mail_success($txnid);\n }\n }\n else\n {\n //log_message('Info',\"ERROR occurred while sending Seller email to $owner_email order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write( array('level' => 1, 'msg' => \"ERROR occurred while sending Seller email to $owner_email order no: \".$order_no, 'debug' => $this->email->print_debugger() ) );\n $mailArraylog2 = array('level' => 1, 'send status' => 0,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n \n }\n $this->email->clear(TRUE);\n //end email send\n }//end for\n \n }//end if mail_info !=0\n }\n else\n {\n log_message('Info',\"Don't Allow mail as the Ip is 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Don't Allow mail as the Ip is 127.0.0.1\"));\n }\n $this->load->view('order_success',$data);\n }", "function plgVmOnPaymentResponseReceived(&$html) {\r\n\t\r\n\t\t$tm_ref = vRequest::getString ('s', 0);\r\n\t\tif (!isset($tm_ref)) {\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$q = 'SELECT * FROM `#__virtuemart_payment_plg_hellaspay` WHERE `hellaspay_OrderCode`=\"' . $tm_ref . '\" ';\r\n\t\t$db->setQuery($q);\r\n\t\tif (!($paymentTable = $db->loadObject())) {\r\n\t \treturn NULL;\r\n\t\t}\r\n\t\t\r\n\t\t//start processing\r\n\t\t$virtuemart_paymentmethod_id = $paymentTable->virtuemart_paymentmethod_id;\r\n\t\t$virtuemart_order_id = $paymentTable->virtuemart_order_id;\r\n\t\t$order_number = $paymentTable->order_number;\r\n\t\t$vendorId = 0;\r\n\t\t\r\n\t\tif (!($method = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {\r\n\t\t\treturn NULL; // Another method was selected, do nothing\r\n\t\t}\r\n\t\tif (!$this->selectedThisElement($method->payment_element)) {\r\n\t\t\treturn NULL;\r\n\t\t}\t\t\r\n\r\n\t\tif(preg_match(\"/bnkact=fail/i\", $_SERVER['REQUEST_URI'])) { //fail routine\r\n\t \r\n\t\t$hellaspay_data = vRequest::getGet();\r\n\t\tif (!isset($hellaspay_data['s']) || $hellaspay_data['s']=='') {\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t\t$tm_ref = addslashes($hellaspay_data['s']);\r\n\t\t$tm_error = ' Payment failed or cancelled';\r\n\r\n\t\tif (!isset($tm_ref)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$q = 'SELECT * FROM `#__virtuemart_payment_plg_hellaspay` WHERE `hellaspay_OrderCode`=\"' . $tm_ref . '\" ';\r\n\t\t$db->setQuery($q);\r\n\t\tif (!($paymentTable = $db->loadObject())) {\r\n\t \tvmWarn(500, $q . \" \" . $db->getErrorMsg());\r\n\t \treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$virtuemart_paymentmethod_id = $paymentTable->virtuemart_paymentmethod_id;\r\n\t\t$order_number = $paymentTable->\torder_number;\r\n\t\t$virtuemart_order_id = $paymentTable->virtuemart_order_id;\r\n\t\t$vendorId = 0;\r\n\t\t\r\n\t\tif (!($method = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {\r\n\t\t\treturn null; // Another method was selected, do nothing\r\n\t\t}\r\n\t\tif (!$this->selectedThisElement($method->payment_element)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($paymentTable as $key => $value) {\r\n\t\t\tif ($key!='hellaspay_order_state') {\r\n\t\t\t\t$dbValues[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$dbValues['hellaspay_order_state'] = \"F\";\r\n\t\t$dbValues['hellaspayresponse_raw'] = \"OrderCode: \" . $tm_ref;\r\n\t\t$this->storePSPluginInternalData($dbValues, 'virtuemart_order_id', FALSE);\r\n\r\n\t\t// Order not found\r\n\t\tif (!$virtuemart_order_id) {\r\n\t\t\t$html = $this->_getHtmlPaymentResponse('VMPAYMENT_HELLASPAY_FAILURE_MSG', false);\r\n\t\t\tvRequest::setVar ('html', $html);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tif (!class_exists('VirtueMartModelOrders')) {\r\n\t\t\trequire( VMPATH_ADMIN . DS . 'models' . DS . 'orders.php' );\r\n\t\t}\r\n\t\t\r\n\t\t$order = VirtueMartModelOrders::getOrder($virtuemart_order_id);\r\n\t\t$order_status_code = $order['items'][0]->order_status;\r\n\t\t\r\n\t\tif ($order_status_code == 'P') { // not processed\r\n\t\t$html = '<h2>'.$this->_getHtmlPaymentResponse('VMPAYMENT_HELLASPAY_FAILURE_MSG', false).'</h2>';\r\n\t\t$html .= '<p align=\"center\"><a href=\"' . JURI::base(true) . '\" title=\"' . vmText::_('VMPAYMENT_HELLASPAY_HOME') . '\">' . vmText::_('VMPAYMENT_HELLASPAY_HOME') . '&raquo;</a></p>';\t\t\r\n\t\t\r\n\t\tvRequest::setVar ('html', $html);\r\n\t\t$new_status = $method->status_canceled;\r\n\t\t$resp = \"FAILED\";\r\n\t\t\r\n\t\t$this->managePaymentResponse($virtuemart_order_id, $paymentTable->hellaspay_OrderCode . $tm_result . $tm_error, $resp, $new_status, $paymentTable->hellaspay_custom, $paymentTable->order_number);\r\n\t\t $this->_clearHellaspaySession();\r\n\t\t} //end fail routine\r\n\t\t}//end not processed fail routine\r\n\r\n\r\n\t\tif(preg_match(\"/bnkact=success/i\", $_SERVER['REQUEST_URI'])) { //success routine\r\n\t\t$hellaspay_data = vRequest::getGet();\r\n\t\tif (!isset($hellaspay_data['s']) || $hellaspay_data['s']=='') {\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\t\r\n\t\t$tm_ref = addslashes($hellaspay_data['s']);\r\n\r\n\t\tif (!isset($tm_ref)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$q = 'SELECT * FROM `#__virtuemart_payment_plg_hellaspay` WHERE `hellaspay_OrderCode`=\"' . $tm_ref . '\" ';\r\n\t\t$db->setQuery($q);\r\n\t\tif (!($paymentTable = $db->loadObject())) {\r\n\t \tvmWarn(500, $q . \" \" . $db->getErrorMsg());\r\n\t \treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$virtuemart_paymentmethod_id = $paymentTable->virtuemart_paymentmethod_id;\r\n\t\t$order_number = $paymentTable->\torder_number;\r\n\t\t$virtuemart_order_id = $paymentTable->virtuemart_order_id;\r\n\t\t$vendorId = 0;\r\n\t\tif (!($method = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {\r\n\t\t\treturn null; // Another method was selected, do nothing\r\n\t\t}\r\n\t\tif (!$this->selectedThisElement($method->payment_element)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($paymentTable as $key => $value) {\r\n\t\t\tif ($key!='hellaspay_order_state') {\r\n\t\t\t\t$dbValues[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\t\t$dbValues['hellaspay_order_state'] = \"S\";\r\n\t\t$dbValues['hellaspayresponse_raw'] = \"OrderCode: \" . $tm_ref;\r\n\t\t$this->storePSPluginInternalData($dbValues, 'virtuemart_order_id', FALSE);\r\n\t\t\r\n\t\t// Order not found\r\n\t\tif (!$virtuemart_order_id) {\r\n\t\t\t$html = $this->_getHtmlPaymentResponse('VMPAYMENT_HELLASPAY_FAILURE_MSG', false);\r\n\t\t\tvRequest::setVar ('html', $html);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tif (!class_exists('VirtueMartModelOrders')) {\r\n\t\t\trequire( VMPATH_ADMIN . DS . 'models' . DS . 'orders.php' );\r\n\t\t}\t\t\r\n\t\t\r\n\t\t$order = VirtueMartModelOrders::getOrder($virtuemart_order_id);\r\n\t\t$order_status_code = $order['items'][0]->order_status;\r\n\t\t\r\n\t\tif ($order_status_code == 'P') { // not processed\r\n\t\t$html = $this->_getHtmlPaymentResponse('VMPAYMENT_HELLASPAY_SUCCESS_MSG', true,$paymentTable->order_number,$paymentTable->virtuemart_order_id, number_format($paymentTable->payment_order_total, 2, '.', ''), $paymentTable->hellaspay_ref, $paymentTable->hellaspay_instalments, $paymentTable->modified_on, $paymentTable->virtuemart_paymentmethod_id);\r\n\t\t\r\n\t\tvRequest::setVar ('html', $html);\r\n\t\t$new_status = $method->status_success;\r\n\t\t$resp = \"SUCCESS\";\r\n\r\n\t\t$this->managePaymentResponse($virtuemart_order_id, 'TxId: ' . $paymentTable->hellaspay_ref, $resp, $new_status, $paymentTable->hellaspay_custom, $paymentTable->order_number, $paymentTable->hellaspay_instalments);\r\n\t\t $this->_clearHellaspaySession();\r\n\t\t} //end success routine\r\n\t\t}//end not processed success routine\r\n\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "public function step_3()\n {\n }", "public function testPaymentSuccess() {\n\t\t$this->processor->capture($this->data);\n\n\t\t//Test redirect to gateway\n\t\t$response = Controller::curr()->getResponse();\n\t\t$gatewayURL = $this->processor->gateway->gatewayURL;\n\t\t\n\t\t$queryString = http_build_query(array(\n\t\t\t'Amount' => $this->data['Amount'],\n\t\t\t'Currency' => $this->data['Currency'],\n\t\t\t'ReturnURL' => $this->processor->gateway->returnURL\n\t\t));\n\t\t$this->assertEquals($response->getHeader('Location'), '/dummy/external/pay?' . $queryString);\n\t\t\n\t\t//Test payment completion after redirect from gateway\n\t\t$queryString = http_build_query(array('Status' => 'Success'));\n\t\tDirector::test($this->processor->gateway->returnURL . \"?$queryString\");\n\t\t\n\t\t$payment = $payment = Payment::get()->byID($this->processor->payment->ID);\n\t\t$this->assertEquals($payment->Status, Payment::SUCCESS);\n\t}", "public function makePayment() {\n\t\tLoggerRegistry::debug('CustomerModule::makePayment()');\n\t\t// TODO Payment gateway integration\n\t}", "public function PaymentProcess()\n { \n $currency_result = $this->session->userdata('currency_result');\n $product_id = $this->input->post('product_id');\n $enquiryid = $this->input->post('enquiryid');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $this->load->library('paypal_class');\n $item_name = $this->input->post('product_name');\n $totalAmount = $this->input->post('price');\n //echo $totalAmount;exit();\n $currencyCode = $this->input->post('currencycode'); \n $user_currencycode = $this->input->post('user_currencycode');\n $loginUserId = $this->checkLogin('U');\n\t\t\t$currency_cron_id = $this->input->post('currency_cron_id');\n $quantity = 1;\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" and status != \"Paid\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'price' => $totalAmount, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmount, 'user_id' => $loginUserId, 'sell_id' => $product->row()->user_id, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Pending', 'shipping_status' => 'Pending', 'total' => $totalAmount, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id(); \n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $lastFeatureInsertId = $dealCodeNumber;\n $this->session->set_userdata($paymtdata);\n $paypal_settings = unserialize($this->config->item('payment_0'));\n $paypal_settings = unserialize($paypal_settings['settings']);\n if ($paypal_settings['mode'] == 'sandbox') {\n $this->paypal_class->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n } else {\n $this->paypal_class->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url\n }\n if ($paypal_settings['mode'] == 'sandbox') {\n $ctype = 'USD';\n } else {\n $ctype = 'USD';\n }\n $logo = base_url() . 'images/logo/' . $this->data['logo_img'];\n $CurrencyType = $this->checkout_model->get_all_details(CURRENCY, array('currency_type' => $ctype));\n $this->paypal_class->add_field('currency_code', $CurrencyType->row()->currency_type);\n $this->paypal_class->add_field('image_url', $logo);\n $this->paypal_class->add_field('business', $paypal_settings['merchant_email']); // Business Email\n $this->paypal_class->add_field('return', base_url() . 'order/success/' . $loginUserId . '/' . $lastFeatureInsertId); // Return URL\n $this->paypal_class->add_field('cancel_return', base_url() . 'order/failure'); // Cancel URL\n $this->paypal_class->add_field('notify_url', base_url() . 'order/ipnpayment'); // Notify url\n $this->paypal_class->add_field('custom', 'Product|' . $loginUserId . '|' . $lastFeatureInsertId); // Custom Values\n $this->paypal_class->add_field('item_name', $item_name); // Product Name\n $this->paypal_class->add_field('user_id', $loginUserId);\n $this->paypal_class->add_field('quantity', $quantity); // Quantity\n if ($user_currencycode != 'USD') {\n /*if ($currency_result->$currencyCode) {\n $totalAmount = $totalAmount / $currency_result->$currencyCode;\n } else {\n $totalAmount = currency_conversion($currencyCode, 'USD', $totalAmount);\n }*/\n\t\t\t\t$totalAmount = currency_conversion($user_currencycode, 'USD', $totalAmount,$currency_cron_id);\n // echo $totalAmount;exit();\n }\n\t\t\t\n $this->paypal_class->add_field('amount', $totalAmount); // Price\n $this->paypal_class->submit_paypal_post();\n }", "public function paymentAction()\n {\n\n $this->initUnipagosPaymentStep();\n $this->loadLayout(); \n $this->getLayout()->getBlock(\"head\")->setTitle($this->__(\"Unipagos Payment\"));\n $this->renderLayout(); \n }", "public function handlePayment ()\n {\n /**\n * Die $baseUrl können wir weit nach oben ziehen, weil wir sie weiter unten an mehreren Stellen verwenden und\n * sie nicht unten jedes Mal definieren möchten, sondern einmal und dann wiederverwenden.\n */\n $baseUrl = Config::get('app.baseUrl');\n\n /**\n * Wir verzichten der Übersichtlichkeit halber auf eine Validierung. Eigentlich müsste hier eine Daten-\n * validierung durchgeführt werden und etwaige Fehler an den User zurückgespielt werden. Im Login machen wir das\n * beispielsweise und auch bei der Bearbeitung eines Produkts. Der nachfolgende Code dürfte gar nicht mehr\n * ausgeführt werden, wenn Validierungsfehler aufgetreten sind.\n */\n\n /**\n * Eingeloggten User abfragen\n */\n $user = User::getLoggedInUser();\n\n /**\n * Wurde das linke Formular abgeschickt und ein Wert ausgewählt?\n */\n if (isset($_POST['payment']) && $_POST['payment'] !== '_default') {\n /**\n * Ausgefüllte PaymentId in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt wieder\n * verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$_POST['payment']);\n }\n\n /**\n * Wurde das rechte Formular abgeschickt und ein Wert in das Name-Feld eingegeben?\n */\n if (isset($_POST['name']) && !empty($_POST['name'])) {\n /**\n * Neue Payment Methode erstellen und in die Datenbank speichern.\n */\n $payment = new Payment();\n $payment->name = $_POST['name'];\n $payment->number = $_POST['number'];\n $payment->expires = $_POST['expires'];\n $payment->ccv = $_POST['ccv'];\n $payment->user_id = $user->id;\n $payment->save();\n\n /**\n * ID der neu erstellten Zahlungsmethode in die Session speichern, damit wir sie in einem weiteren Checkout-\n * Schritt wieder verwenden können.\n */\n Session::set(self::PAYMENT_KEY, (int)$payment->id);\n }\n\n /**\n * Oben sind folgende Fälle abgedeckt:\n * + Ein existierendes Payment wurde aus dem Dropdown gewählt\n * + Ein neues Payment wurde in das Formular eingegeben\n * Was noch nicht abgedeckt ist, wenn weder ein Payment ausgewählt wurde noch ein neues Payment angelegt wurde.\n *\n * Hier prüfen wir also, ob KEIN payment geschickt wurde oder der Standard Wert aus dem Formular übergeben wurde\n * UND ob das Namens feld NICHT oder LEER übergeben wurde. Das ist eine relativ komplexe Bedingung, daher habe\n * ich sie zur besseren Übersicht in mehrere Zeilen aufgeteilt.\n */\n if (\n (\n !isset($_POST['payment']) ||\n $_POST['payment'] === '_default'\n )\n &&\n (\n !isset($_POST['name']) ||\n empty($_POST['name'])\n )\n ) {\n /**\n * Wurde weder ein Payment ausgewählt noch ein neues eingegeben, so schreiben wir einen Error und leiten zu\n * dem Formular zurück, von dem wir gekommen sind.\n */\n Session::set('errors', [\n 'Payment auswählen ODER ein neues anlegen.'\n ]);\n\n header(\"Location: {$baseUrl}checkout\");\n exit;\n }\n\n /**\n * Weiterleiten auf den nächsten Schritt im Checkout Prozess.\n */\n header(\"Location: {$baseUrl}checkout/address\");\n exit;\n }", "private function _expressCheckoutPayment()\r\n\t{\r\n\t\t/* Verifying the Payer ID and Checkout tokens (stored in the customer cookie during step 2) */\r\n\t\tif (isset($this->context->cookie->paypal_express_checkout_token) && !empty($this->context->cookie->paypal_express_checkout_token))\r\n\t\t{\r\n\t\t\t/* Confirm the payment to PayPal */\r\n\t\t\t$currency = new Currency((int)$this->context->cart->id_currency);\r\n\t\t\t$result = $this->paypal_usa->postToPayPal('DoExpressCheckoutPayment', '&TOKEN='.urlencode($this->context->cookie->paypal_express_checkout_token).'&PAYERID='.urlencode($this->context->cookie->paypal_express_checkout_payer_id).'&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_AMT='.$this->context->cart->getOrderTotal(true).'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($currency->iso_code).'&IPADDRESS='.urlencode($_SERVER['SERVER_NAME']));\r\n\r\n\t\t\tif (strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING')\r\n\t\t\t{\r\n\t\t\t\t/* Prepare the order status, in accordance with the response from PayPal */\r\n\t\t\t\tif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'COMPLETED')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYMENT');\r\n\t\t\t\telseif (strtoupper($result['PAYMENTINFO_0_PAYMENTSTATUS']) == 'PENDING')\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_PAYPAL');\r\n\t\t\t\telse\r\n\t\t\t\t\t$order_status = (int)Configuration::get('PS_OS_ERROR');\r\n\r\n\t\t\t\t/* Prepare the transaction details that will appear in the Back-office on the order details page */\r\n\t\t\t\t$message =\r\n\t\t\t\t\t\t'Transaction ID: '.$result['PAYMENTINFO_0_TRANSACTIONID'].'\r\n\t\t\t\tTransaction type: '.$result['PAYMENTINFO_0_TRANSACTIONTYPE'].'\r\n\t\t\t\tPayment type: '.$result['PAYMENTINFO_0_PAYMENTTYPE'].'\r\n\t\t\t\tOrder time: '.$result['PAYMENTINFO_0_ORDERTIME'].'\r\n\t\t\t\tFinal amount charged: '.$result['PAYMENTINFO_0_AMT'].'\r\n\t\t\t\tCurrency code: '.$result['PAYMENTINFO_0_CURRENCYCODE'].'\r\n\t\t\t\tPayPal fees: '.$result['PAYMENTINFO_0_FEEAMT'];\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_EXCHANGERATE']) && !empty($result['PAYMENTINFO_0_EXCHANGERATE']))\r\n\t\t\t\t\t$message .= 'Exchange rate: '.$result['PAYMENTINFO_0_EXCHANGERATE'].'\r\n\t\t\t\tSettled amount (after conversion): '.$result['PAYMENTINFO_0_SETTLEAMT'];\r\n\r\n\t\t\t\t$pending_reasons = array(\r\n\t\t\t\t\t'address' => 'Customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually accept or deny each of these payments.',\r\n\t\t\t\t\t'echeck' => 'The payment is pending because it was made by an eCheck that has not yet cleared.',\r\n\t\t\t\t\t'intl' => 'You hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.',\r\n\t\t\t\t\t'multi-currency' => 'You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.',\r\n\t\t\t\t\t'verify' => 'You are not yet verified, you have to verify your account before you can accept this payment.',\r\n\t\t\t\t\t'other' => 'Unknown, for more information, please contact PayPal customer service.');\r\n\r\n\t\t\t\tif (isset($result['PAYMENTINFO_0_PENDINGREASON']) && !empty($result['PAYMENTINFO_0_PENDINGREASON']) && isset($pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']]))\r\n\t\t\t\t\t$message .= \"\\n\".'Pending reason: '.$pending_reasons[$result['PAYMENTINFO_0_PENDINGREASON']];\r\n\r\n\t\t\t\t/* Creating the order */\r\n\t\t\t\t$customer = new Customer((int)$this->context->cart->id_customer);\r\n\t\t\t\tif ($this->paypal_usa->validateOrder((int)$this->context->cart->id, (int)$order_status, (float)$result['PAYMENTINFO_0_AMT'], $this->paypal_usa->displayName, $message, array(), null, false, $customer->secure_key))\r\n\t\t\t\t{\r\n\t\t\t\t\t/* Store transaction ID and details */\r\n\t\t\t\t\t$this->paypal_usa->addTransactionId((int)$this->paypal_usa->currentOrder, $result['PAYMENTINFO_0_TRANSACTIONID']);\r\n\t\t\t\t\t$this->paypal_usa->addTransaction('payment', array('source' => 'express', 'id_shop' => (int)$this->context->cart->id_shop, 'id_customer' => (int)$this->context->cart->id_customer, 'id_cart' => (int)$this->context->cart->id,\r\n\t\t\t\t\t\t'id_order' => (int)$this->paypal_usa->currentOrder, 'id_transaction' => $result['PAYMENTINFO_0_TRANSACTIONID'], 'amount' => $result['PAYMENTINFO_0_AMT'],\r\n\t\t\t\t\t\t'currency' => $result['PAYMENTINFO_0_CURRENCYCODE'], 'cc_type' => '', 'cc_exp' => '', 'cc_last_digits' => '', 'cvc_check' => 0,\r\n\t\t\t\t\t\t'fee' => $result['PAYMENTINFO_0_FEEAMT']));\r\n\r\n\t\t\t\t\t/* Reset the PayPal's token so the customer will be able to place a new order in the future */\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/* Redirect the customer to the Order confirmation page */\r\n\t\t\t\tif (_PS_VERSION_ < 1.4)\r\n\t\t\t\t\tTools::redirect('order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\telse\r\n\t\t\t\t\tTools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->paypal_usa->id.'&id_order='.(int)$this->paypal_usa->currentOrder.'&key='.$customer->secure_key);\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t\t/* If PayPal is returning an error code equal to 10486, it means either that:\r\n\t\t\t\t *\r\n\t\t\t\t * - Billing address could not be confirmed\r\n\t\t\t\t * - Transaction exceeds the card limit\r\n\t\t\t\t * - Transaction denied by the card issuer\r\n\t\t\t\t * - The funding source has no funds remaining\r\n\t\t\t\t *\r\n\t\t\t\t * Therefore, we are displaying a new PayPal Express Checkout button and a warning message to the customer\r\n\t\t\t\t * He/she will have to go back to PayPal to select another funding source or resolve the payment error\r\n\t\t\t\t */\r\n\t\t\t\tif (isset($result['L_ERRORCODE0']) && (int)$result['L_ERRORCODE0'] == 10486)\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($this->context->cookie->paypal_express_checkout_token, $this->context->cookie->paypal_express_checkout_payer_id);\r\n\t\t\t\t\t$this->context->smarty->assign('paypal_usa_action', $this->context->link->getModuleLink('paypalusa', 'expresscheckout', array('pp_exp_initial' => 1)));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function pay();", "public function _prePayment( $data )\n {\n // prepare the payment form\n $vars = new JObject();\n\n $params = JComponentHelper::getParams('com_j2store');\n $currency_code = $params->get('currency_code');\n $curr_type = \"764\";\n $lang = \"t\";\n\n // Convert to thai Baht before send to Paysbuy\n if($currency_code===\"USD\"){\n $xml = JFactory::getXML( 'http://www2.bot.or.th/RSS/fxrates/fxrate-usd.xml' );\n $pre_usd = (float)$xml->item->children('cb', true)->value;\n $data['orderpayment_amount'] = $data['orderpayment_amount']*$pre_usd;\n }\n\n switch ($data['paytype']) {\n case 'cash':\n $paytype = \"cs=true\";\n break;\n \n case 'credit':\n $paytype = \"c=true\";\n break;\n\n case 'bank':\n $paytype = \"ob=true\";\n break;\n\n case 'paysbuy':\n default:\n $paytype = \"psb=true\";\n break;\n }\n\n $vars->form_url = $this->_getPaysbuyUrl().\"?\".$paytype.\"&lang=$lang\";\n $vars->username = $this->params->get('username','');\n $vars->inv = $data['orderpayment_id'];\n $vars->itm = $data['order_id'];\n $vars->amt = $data['orderpayment_amount'];\n $vars->curr_type = $curr_type;\n\n //Change to your URL\n $vars->resp_front_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n $vars->resp_back_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n\n //lets check the values submitted\n $html = $this->_getLayout('prepayment', $vars);\n return $html;\n }", "public function payment()\n {\n $total_price = number_format($_GET['price'],2);\n //get cart from session\n $cart = $_SESSION['shopping_cart'];\n\n\n //check if user is logged with userID else user send to log in\n if(isset($_SESSION['userID'])){\n\n //get userID from session\n $userId = $_SESSION['userID'];\n //API mollie payment setup\n $mollie = new MollieApiClient();\n $mollie->setApiKey('test_ajQEAHf8StBWg3dnW9VxWvcz26j5jh');\n $description = 'Payment for Haarlem Festival order' ;\n\n $payment = $mollie->payments->create([\n \"amount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"$total_price\",\n ],\n \"description\" => \"$description\",\n \"redirectUrl\" => \"http://localhost/PHP/HaarlemFestivalG4/carts/confirmationPage\",\n \"webhookUrl\" => \"\",\n \"metadata\" => \"\",\n ]);\n\n\n\n\n //set status $payment->status only returns open and api wont continue unless paid is selected\n $statusPay = \"paid\";\n //sends information to payment model\n $this->paymentModel->createOrder($statusPay,$userId,$total_price);\n\n //get the orderID from model\n $id= $this->paymentModel->getOrderId();\n //makes ID readable\n $data = $id->orderID;\n //make a session for orderID so it can be fetched from another page\n $_SESSION['orderID']= $data;\n\n //continue with payment\n header('location: '.$payment->getCheckoutUrl(), true, 303);\n\n\n //sends every item in order to orderItems in the db\n foreach ($cart as $item){\n $quantity = $item[\"quantity\"];\n $eventID = $item[\"event_id\"];\n $price = $item[\"price\"];\n\n //because the database was not created according to the schema we had made 2 different tables had to be created thus the different methods\n //each ticket has a type and the statement underneath checks whether the type is either Dance or otherwise (History)\n if($item[\"type\"]==\"Dance\"){\n //get the ticket based on dance\n $result = $this->paymentModel->searchDanceTicket($eventID,$price);\n\n }\n else{\n //get ticket based on history\n $result = $this->paymentModel->searchHistoryTicket($eventID,$price);\n }\n //sets tickID\n $tickID = $result->ticketID;\n //sends the ticket to orderItem\n $this->paymentModel->addOrderItem($data,$tickID,$quantity);\n }\n //clears shopping cart session after payment\n $data='';\n unset($_SESSION['shopping_cart']);\n\n $this->view('payments/index',$data);\n\n\n }\n else{\n //when the user is directed to the login page when not logged in\n $data = [\n 'email'=> '',\n 'password' => '',\n 'emailError' => '',\n 'passwordError' => ''\n ];\n $this->view('/users/login',$data);\n }\n\n\n\n }", "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 }", "function _postPayment($data) {\r\n\t\t// Process the payment\r\n\t\t$app = JFactory::getApplication ();\r\n\t\t$vars = new JObject ();\r\n\t\t$html = '';\r\n\t\t$order_id = $_POST[\"order_id\"];\r\n\t\t\r\n\t\t/* APC Code */\r\nif ($_POST[\"order_id\"] != \"\"){\r\n// Payment confirmation from http post \r\nini_set(\"SMTP\",\"mail.nochex.com\" ); \r\n$header = \"From: [email protected]\";\r\n\r\n$your_email = $_POST[\"from_email\"]; // your merchant account email address\r\n \r\n// uncomment below to force a DECLINED response \r\n//$_POST['order_id'] = \"1\"; \r\n\r\n$url = \"https://secure.nochex.com/apc/apc.aspx\";\r\n$postvars = http_build_query($_POST);\r\n\r\n$ch = curl_init ();\r\ncurl_setopt ($ch, CURLOPT_URL, $url);\r\ncurl_setopt ($ch, CURLOPT_POST, true); \r\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, $postvars);\r\ncurl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\ncurl_setopt ($ch, CURLOPT_TIMEOUT, 60);\r\n//curl_setopt ($ch, CURLOPT_SSLVERSION, 0);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n$response = curl_exec ($ch);\r\ncurl_close ($ch);\r\n\r\n// stores the response from the Nochex server \r\n$debug = \"IP -> \" . $_SERVER['REMOTE_ADDR'] .\"\\r\\n\\r\\nPOST DATA:\\r\\n\"; \r\nforeach($_POST as $Index => $Value) \r\n$debug .= \"$Index -> $Value\\r\\n\"; \r\n$debug .= \"\\r\\nRESPONSE:\\r\\n$response\";\r\n// Retrieves the order_id and save it as a variable which can be used in the update query to find a particular record in a database or datatable.\t\r\n\t $order_ID = $_POST['order_id']; \r\n// An email to check the order_ID\r\n\t$order = F0FTable::getInstance ( 'Order', 'J2StoreTable' )->getClone ();\r\n\t\tif ($order->load ( array (\r\n\t\t\t\t'order_id' => $order_id\r\n\t\t) )) {\r\n\t\t\r\n\t$order->transaction_id = $_POST[\"transaction_id\"];\r\n\t$order->transaction_status = $response;\r\n\t\t\t\t\t\r\nif (!strstr($response, \"AUTHORISED\")) { // searches response to see if AUTHORISED is present if it isn’t a failure message is displayed\r\n $msg = \"APC was not AUTHORISED.\\r\\n\\r\\n$debug\"; // displays debug message\t\r\n\t\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n} else { \r\n\t$msg = \"APC was AUTHORISED\";\r\n\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n\t$order->reduce_order_stock();\r\n\t$order->payment_complete();\r\n\t$order->empty_cart();\r\n\t}\r\n}\r\n}else{\r\n\r\n$html = \"<div style=\\\"padding:20px;box-shadow:1px 1px 1px #666;border:1px solid #666;margin:20px;\\\"><i class=\\\"icon-star\\\" style=\\\"color:gold;float:right\\\"></i><h3>Congratulation's</h3><p>Your order: \" . $data['order_id'] . \" has been successful</p></div>\";\r\n\r\nreturn $html;\r\n\t \r\n\t}\r\n}", "public function payment_scripts() {\n \n\t \t}", "public static function geoCart_payment_choicesProcess()\n {\n //VARIABLES TO SEND\n //sid\n //product_id\n //quantity\n //merchant_order_id\n //demo\n trigger_error('DEBUG TRANSACTION: Top of process 2checkout.');\n $cart = geoCart::getInstance();\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n $user_data = $cart->user_data;\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $due = $invoice->getInvoiceTotal();\n\n if ($due >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n\n $transaction = new geoTransaction();\n $transaction->setGateway(self::gateway_name);\n $transaction->setUser($cart->user_data['id']);\n $transaction->setStatus(0); //for now, turn off until it comes back from paypal IPN.\n $transaction->setAmount(-1 * $due);//set amount that it affects the invoice\n $msgs = $cart->db->get_text(true, 183);\n $transaction->setDescription($msgs[500575]);\n\n $transaction->setInvoice($invoice);\n\n $transaction->save();\n\n $testing = $gateway->get('testing_mode');\n $sid = geoString::specialChars($gateway->get('sid'));\n $responseURL = self::_getResponseURL();\n\n\n //build redirect\n $formdata = $cart->user_data['billing_info'];\n $cc_url = \"https://www.2checkout.com/2co/buyer/purchase?\";\n\n $cc_url .= \"sid=\" . $sid;\n $cc_url .= \"&fixed=Y\";\n $cc_url .= \"&x_receipt_link_url=\" . urlencode($responseURL);\n $cc_url .= \"&cart_order_id=\" . $transaction->getId();\n $cc_url .= \"&total=\" . sprintf(\"%01.2f\", $transaction->getAmount());\n if ($testing) {\n $cc_url .= \"&demo=Y\";\n }\n $cc_url .= \"&card_holder_name=\" . urlencode($formdata['firstname'] . \" \" . $formdata['lastname']);\n $cc_url .= \"&street_address=\" . urlencode($formdata['address'] . \" \" . $formdata['address_2']);\n $cc_url .= \"&city=\" . urlencode($formdata['city']);\n $cc_url .= \"&state=\" . urlencode($formdata['state']);\n $cc_url .= \"&zip=\" . urlencode($formdata['zip']);\n $cc_url .= \"&country=\" . urlencode($formdata['country']);\n $cc_url .= \"&email=\" . urlencode($formdata['email']);\n $cc_url .= \"&phone=\" . urlencode($formdata['phone']);\n $cc_url .= \"&merchant_order_id=\" . $cart->order->getId() . self::ORDER_SEP . $transaction->getId();\n\n //remember URL for debugging if needed\n $transaction->set('cc_url', $cc_url);\n $transaction->save();\n\n //add transaction to invoice\n $invoice->addTransaction($transaction);\n\n //set order to pending\n $cart->order->setStatus('pending');\n\n //stop the cart session\n $cart->removeSession();\n trigger_error('DEBUG TRANSACTION: 2checkout URL: ' . $cc_url);\n require GEO_BASE_DIR . 'app_bottom.php';\n //go to 2checkout to complete\n header(\"Location: \" . $cc_url);\n exit;\n }", "public function execute()\n {\n try{\n $order = $this->checkoutSession->getLastRealOrder();\n if(!$order){\n $msg = __('Order not found.');\n $this->redpayPayHelper->addTolog('error', $msg);\n $this->_redirect('checkout/cart');\n return;\n }\n $payment = $order->getPayment();\n if(!isset($payment) || empty($payment)){\n $this->redpayPayHelper->addTolog('error', 'Order Payment is empty');\n $this->_redirect('checkout/cart');\n return;\n }\n $method = $order->getPayment()->getMethod();\n $methodInstance = $this->paymentHelper->getMethodInstance($method);\n if($methodInstance instanceof \\Redpayments\\Magento2\\Model\\AbstractPayment){\n $redirectUrl = $methodInstance->startTransaction($order);\n /**\n * @var Http $response\n */\n if('redpayments_alipay' === $method){\n echo $redirectUrl;\n }else if('redpayments_wechatpay' === $method){\n if(Utils::isMobile()){\n if(Utils::isWeixin() === false){\n die('Please open the page within Wechat');\n }\n $response = $this->getResponse();\n $response->setRedirect($redirectUrl);\n }else{\n $response = $this->getResponse();\n $wechatWebUrl = '';\n if ($this->redpayPayHelper->getIsDev()) {\n $wechatWebUrl = 'https://dev-web.redpayments.com.au/';\n } else {\n $wechatWebUrl = 'https://web.redpayments.com.au/';\n }\n $wechatWebUrl = $wechatWebUrl . '?mchNo=' . $this->redpayPayHelper->getMchNo();\n $wechatWebUrl = $wechatWebUrl . '&mchOrderNo=' . $order->getId();\n $wechatWebUrl = $wechatWebUrl . '&qrCode=' . \\urlencode($redirectUrl);\n $response->setRedirect($wechatWebUrl);\n }\n }else{\n echo 'Unsupported payment method';\n }\n }else{\n $msg = __('Paymentmethod not found.');\n $this->messageManager->addErrorMessage($msg);\n $this->redpayPayHelper->addTolog('error', $msg);\n $this->checkoutSession->restoreQuote();\n $this->_redirect('checkout/cart');\n }\n }catch(\\Exception $e){\n $this->messageManager->addExceptionMessage(\n $e, __($e->getMessage())\n );\n $this->redpayPayHelper->addTolog('error', $e->getMessage());\n $this->checkoutSession->restoreQuote();\n $this->_redirect('checkout/cart');\n }\n }", "function handleSinglePayment(&$input, &$ids, &$objects) {\r\n $contribution =& $objects['contribution'];\r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaction();\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n $this->completeTransaction($input,$ids,$objects,$transaction,false);// false= not recurring\r\n $output = '<div id=\"logo\"><h1>Thank you</h1><p>Your payment was successful.</p><p>Please <a href=\"' . $ids[\"thankyoupage\"] . '\">click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n $this->cancelled($objects,$transaction);\r\n $output = '<h1>Transaction Cancelled</h1><p>Your payment was cancelled or rejected.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else {\r\n CRM_Core_Error::debug_log_message(\"Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n $output = '<h1>Error</h1><p>There was an error while processing your payment.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n return false;\r\n }\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }", "function toPay()\r\n {\r\n try {\r\n $this->mKart->setPaidKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('310', 'No s`ha pogut realitzar el pagament.', $e);\r\n }\r\n }", "public function payment_scripts() {\n\n \t}", "public function thankyou_page_kdbayar() {\n\t\tglobal $woocommerce;\n \n\t\t$invoice = $_POST['invoice'];\n\t\t$result_code = $_POST['result_code'];\n\t\t\n\t\t$customer_order = new WC_Order( $invoice );\n\t\t\n\t\tif($result_code == '00'){\n\t\t\t// Payment successful\n\t\t\t$customer_order->add_order_note( __( 'Finnet processing payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// paid order marked\n\t\t\t$customer_order->update_status('processing');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}elseif ($result_code == '05') {\n\t\t\t// Payment expired\n\t\t\t$customer_order->add_order_note( __( 'Finnet expired payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// expired order marked\n\t\t\t$customer_order->update_status('failed');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}\n\t}", "public function finishPurchase() {}", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "function PaymentWallet()\n {\n //echo '<pre>';print_r($_POST);\n //echo $this->input->post('total_price');exit;\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $loginUserId = $this->checkLogin('U');\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n $currency_code = $this->input->post('currencycode');\n $response = 'yes';\n {\n //echo '<pre>';print_r($response);die;\n if ($response != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $seller = $this->checkout_model->get_all_details(USERS, array('id' => $product->row()->user_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\n }\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n //echo $user_booked->num_rows();\n if ($user_booked->num_rows() == 0) {\n $booked_data_Q = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'dealCodeNumber' => $randomId));\n $totalAmount = $booked_data_Q->row()->total;\n $currencyCode = $booked_data_Q->row()->currency_code;\n //Commission percent\n // $book_commission_query = 'SELECT * FROM ' . COMMISSION . ' WHERE seo_tag = \"guest_invite_accept\" AND status=\"Active\"';\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n //echo $this->db->last_query();\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n //echo $book_commission->row()->commission_percentage.'--'.$referal_commission;\n //Commission amount currency conversion\n if ($currencyCode != 'USD') {\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n //referred user existing data\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n /* referal user commission payment ends */\n //echo $this->db->last_query();exit;\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $currency_code);\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n //redirect('order/failure/'.$response->response_reason_text);\n }\n }\n }", "public function execute()\n {\n try {\n $paymentResponse = $this->getRequest()->getPost();\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $messageMessenger = $objectManager->get('Magento\\Framework\\Message\\ManagerInterface');\n\n if ($paymentResponse) {\n $responseCode = (string)$paymentResponse['TURKPOS_RETVAL_Sonuc'];\n $orderId = (string)$paymentResponse['TURKPOS_RETVAL_Siparis_ID'];\n $order = $this->orderFactory->create()->load($orderId, 'increment_id');\n\n if ($this->config->isAllowDebug()) {\n $this->logger->info(__('Response from Param for order id %1', $order->getId()));\n $this->logger->info(__('Response code: %1', $responseCode));\n }\n\n if ($order->getId()) {\n if ($responseCode == self::SUCCESS_STATUS) {\n $transactionId = (string)$paymentResponse['TURKPOS_RETVAL_Islem_ID'];\n $order->getPayment()->addData([\n 'cc_trans_id' => $transactionId, \n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranAmount' => $paymentResponse['TURKPOS_RETVAL_Tahsilat_Tutari'],\n 'docId' => $paymentResponse['TURKPOS_RETVAL_Dekont_ID'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->getMethodInstance()->capture($order->getPayment(), $order->getGrandTotal());\n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/success');\n $messageMessenger->addSuccess($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n } else {\n $order->getPayment()->addData([\n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->setAdditionalInformation('tranRes', $order->getPayment()->getData('tranRes'));\n $order->getPayment()->setAdditionalInformation('tranDate', $order->getPayment()->getData('tranDate'));\n $order->getPayment()->setAdditionalInformation('tranResponseCode', $order->getPayment()->getData('tranResponseCode'));\n $this->paymentResource->save($order->getPayment());\n \n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/failure');\n $messageMessenger->addError($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n }\n }\n } catch (Exception $e) {\n $this->logger->critical($e->getMessage());\n }\n\n if ($checkoutFailPage = $this->config->getCheckoutFailurePage()) {\n $redirectUrl = $this->pageHelper->getPageUrl($checkoutFailPage);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n\n return $this->resultRedirectFactory->create()->setPath('checkout/onepage/failure');\n }", "public function finishAction()\n {\n // if the user has not logged in, login fristly\n if (!$this->session['sUserId']){\n return $this->forward('login', 'account', null, array(\n 'sTarget' => 'paymentpilipay',\n 'sTargetAction' => 'finish',\n 'sUseSSL' => true,\n ));\n }\n\n Shopware()->Modules()->Basket()->sRefreshBasket();\n\n $orderNo = intval($this->Request()->getParam('orderNo'));\n if (!$orderNo){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n if (!is_object($this->session['sOrderVariables'])){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view = $this->View();\n $view->assign($this->session['sOrderVariables']->getArrayCopy());\n if ($orderNo != $view->sOrderNumber){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n // fetch order data\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n /**@var $order Shopware\\Models\\Order\\Order */\n $order = $builder->getQuery()->getOneOrNullResult();\n if (!$order){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view->sOrderNumber = $order->getNumber();\n $view->sTransactionnumber = $order->getTransactionId();\n $view->sPayment = array(\n 'description' => $order->getPayment()->getDescription() ?: $order->getPayment()->getName()\n );\n\n// $view->sDispatch = null;\n\n // fetch user data\n $userData = $view->sUserData;\n $userData['shippingaddress'] = array(\n 'company' => '',\n 'salutation' => 'mr',\n 'firstname' => $userData['shippingaddress']['firstname'],\n 'lastname' => $userData['shippingaddress']['lastname'],\n 'street' => '(最终的收货地址是您在霹雳爸爸上所填写的地址)',\n );\n $userData['additional'] = null;\n $view->sUserData = $userData;\n\n\n return $view->loadTemplate('frontend/checkout/finish.tpl');\n }", "public function createPayment()\n\t{\n\n\t}", "public function compliteAction()\n {\n\n $config = $this->get('plugins')->Frontend()->PilibabaPilipaySystem()->Config();\n $merchantNO = $this->Request()->getParam('merchantNO');\n $orderNo = $this->Request()->getParam('orderNo');\n $orderAmount = $this->Request()->getParam('orderAmount');\n $signType = $this->Request()->getParam('signType');\n $payResult = $this->Request()->getParam('payResult');\n $signMsg = $this->Request()->getParam('signMsg');\n $dealId = $this->Request()->getParam('dealId');\n $fee = $this->Request()->getParam('fee');\n $sendTime = $this->Request()->getParam('sendTime');\n\n\n if ($config->get('merchantNo') == $merchantNO\n && md5($merchantNO . $orderNo . $orderAmount . $sendTime . $config->get('appSecrect')) == $signMsg\n ) {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n $order = $builder->getQuery()->getOneOrNullResult();\n\n if ($payResult == 10) {\n\n $this->setPaymentStatus($order->getTransactionId(), 12);\n $url = $this->basePathUrl . '/paymentpilipay/finish?orderNo='.$orderNo;\n\n echo '<result>1</result><redirecturl>' . $url . '</redirecturl>';\n $this->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if ($order->getOrderStatus() && $order->getOrderStatus()->getId() == 0) {\n $this->setOrderStatus($order->getTransactionId(), 0); // in process\n }\n } elseif ($payResult == 11) {\n $this->setPaymentStatus($order->getTransactionId(), 21);\n\n }\n }\n\n }", "public function process_payment( $order_id ) {\n \n global $woocommerce;\n \n\t\t$customer_order = new WC_Order( $order_id );\n\t\t\n\t\t// checking for transiction\n\t\t$environment = ( $this->environment == \"yes\" ) ? 'TRUE' : 'FALSE';\n\n\t\t// Decide which URL to post to\n\t\t$environment_url = $this->environtment_url;//'https://sandbox.finpay.co.id/servicescode/api/apiFinpay.php';\n\n\t\t\n\t\t$add_info1 = $customer_order->billing_first_name.' '.$customer_order->billing_last_name;\n\t\t$amount = $customer_order->order_total;\n\t\t$invoice = $order_id;\n\t\t$merchant_id = $this->merchant_id;\n\t\t$return_url = add_query_arg(array('utm_nooverride'=>'1', 'jenis' => 'kdbayar'),$this->get_return_url($customer_order));\n\t\t$sof_id = 'finpay021';\n\t\t$sof_type = 'pay';\n\t\t$timeout = '2880';\n\t\t$trans_date = date('Ymdhis');\n\t\t$password = $this->password;\n\t\t\n\t\t$mer_signature = hash('sha256', strtoupper($add_info1).'%'.strtoupper($amount).'%'.strtoupper($invoice).'%'.strtoupper($merchant_id).'%'.strtoupper($return_url).'%'.strtoupper($sof_id).'%'.strtoupper($sof_type).'%'.strtoupper($timeout).'%'.strtoupper($trans_date).'%'.strtoupper($password));\n\t\t$ref = strtoupper($add_info1).'%'.strtoupper($amount).'%'.strtoupper($invoice).'%'.strtoupper($merchant_id).'%'.strtoupper($return_url).'%'.strtoupper($sof_id).'%'.strtoupper($sof_type).'%'.strtoupper($timeout).'%'.strtoupper($trans_date).'%'.strtoupper($password);\n\t\t// This is where the fun stuff begins\n\t\t$payload = array(\n\t\t\t'add_info1' => $add_info1,\n\t\t\t'amount' => $amount,\n\t\t\t'invoice' => $invoice,\n\t\t\t'mer_signature' => $mer_signature,\n\t\t\t'merchant_id' => $merchant_id,\n\t\t\t'return_url' => $return_url,\n\t\t\t'sof_id' => $sof_id,\n\t\t\t'sof_type' => $sof_type,\n\t\t\t'timeout' => $timeout,\n\t\t\t'trans_date' => $trans_date\n\t\t\t\n\t\t);\n\t\t\n\t\t// Send this payload to Authorize.net for processing\n\t\t$response = wp_remote_post( $environment_url, array(\n\t\t\t'method' => 'POST',\n\t\t\t'body' => http_build_query( $payload ),\n\t\t\t'timeout' => 90,\n\t\t\t'sslverify' => true,\n ) );\n \n\n\t\tif ( is_wp_error( $response ) ){\n\t\t\tthrow new Exception( __( 'There is issue for connectin payment gateway. Sorry for the inconvenience.', 'finnet-tcash' ) );\n\t\t}else{\n\t\t\tupdate_post_meta( $order_id, '_finpay_ref_kdbayar', $ref);\n\t\t}\n\t\tif ( empty( $response['body'] ) )\n\t\t\tthrow new Exception( __( 'Finnet Response was not get any data.', 'finnet-kode-bayar' ) );\n\t\t\t\n\t\t// get body response while get not error\n\t\t$response_body = wp_remote_retrieve_body( $response );\n\t\t\n\t\t$response = json_decode($response_body, true);\n\t\t\n\t\tif($response['status_code'] == 00){\n\t\t\t// Payment successful\n\t\t\t$customer_order->add_order_note( __( 'Finnet pending payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// paid order marked\n\t\t\t$customer_order->update_status('pending-payment');\n\n\t\t\t$to_email = $customer_order->billing_email;\n\t\t\t$headers .= \"MIME-Version: 1.0\";\n\t\t\t$headers .= \"Content-Type: text/html; charset=UTF-8\";\n\t\t\t$message = '<div style=\" display: block;position: relative;max-width: 50%;min-width: 300px;height: auto;margin: 25px auto;background: #ffffff;box-shadow: 0px 0px 10px #888888;font-family: Lato, sans-serif;font-size: 14px;\">\n\t\t\t\t\t<div style=\" text-align:center;\">\n\t\t\t\t\t<img src=\"https://www.sarinahonline.co.id/wp-content/uploads/2017/12/sarinah-thewindowofinonesia-02-1.png\" style=\"width:40%; margin: 15px 15px \" >\n\t\t\t\t\t</div> \n\t\t\t\t\t<h2 style=\"padding: 15px;background: #ff0000;color: #ffffff;text-align: center;border-bottom: 5px solid #cc9933;\">\n\t\t\t\t\t\tPetunjuk Pembayaran\n\t\t\t\t\t</h2>\n\t\t\t\t\t\t<p style=\"padding: 15px 5%;color: #333333;\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<b>Silakan ikuti langkah-langkah berikut untuk menyelesaikan pembayaran :</b><br>\n\t\t\t\t\t\t\t<ul style=\"list-style:decimal; padding-left: 10%;\">\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Pilih Menu Bayar / Beli</li>\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Pilih Menu Telepon / HP</li>\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Pilih CDMA / Telkom</li>\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Pilih Telkom / Speedy Vision</li>\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Masukkan Kode 12 Digit \"'.$response['payment_code'].'\" kode pembayaran yang anda dapatkan</li>\n\t\t\t\t\t\t\t\t<li style=\"margin-bottom: 10px;color: #333333;\"> Pilih YA untuk melanjutkan pembayaran</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div style=\"display: block;width: auto;background: #f2f2f2;border-top: 1px solid #eeeeee;padding: 25px 5%;text-align: center;color: #888888;\">\n\t\t\t\t\t\t\t\t&copy;2017<a href=\"https://www.sarinahonline.co.id/\" style=\"color: #888888;\"> Sarinah Online.</a> All rights Reserved\n\t\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t</div>';\n\t\t\t\n\t\t\twp_mail($to_email, 'Your order is Pending', $message, $headers );\n\n\t\t\t// this is important part for empty cart\n\t\t\t$woocommerce->cart->empty_cart();\n\n\t\t\t$kode_bayar = add_query_arg('payment_code', $response['payment_code'], $this->get_return_url($customer_order));\n\t\t\t// Redirect to thank you page\n\t\t\treturn array(\n\t\t\t\t'result' => 'success',\n\t\t\t\t'redirect' => $kode_bayar,\n\t\t\t);\n\t\t} else {\n\t\t\t//transiction fail\n\t\t\twc_add_notice( $r['response_reason_text'], 'error' );\n\t\t\t$customer_order->add_order_note( 'Error: '. $r['response_reason_text'] );\n\t\t}\n\t\t\n\t}", "public function process_payment($order_id){\r\n\r\n $order = wc_get_order( $order_id );\r\n // Mark as on-hold (we're awaiting the cheque)\r\n $order->update_status( 'on-hold', _x( 'Awaiting check payment', 'Check payment method', 'azericard' ) );\r\n\r\n // Reduce stock levels\r\n wc_reduce_stock_levels( $order_id );\r\n\r\n // Remove cart\r\n WC()->cart->empty_cart();\r\n\r\n // Return thankyou redirect\r\n return array(\r\n 'result' => 'success',\r\n 'redirect' => $this->get_return_url( $order ),\r\n );\r\n\r\n }", "function action_done()\n\t{\n\t\t$class=str_replace('hook_pointstore_','',strtolower(get_class($this)));\n\n\t\tpost_param_integer('confirm'); // Make sure POSTed\n\t\t$id=get_param_integer('sub_id');\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('id','c_title','c_cost','c_one_per_member'),array('id'=>$id,'c_enabled'=>1));\n\t\tif (!array_key_exists(0,$rows)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\t\t$cost=$rows[0]['c_cost'];\n\n\t\t$c_title=get_translated_text($rows[0]['c_title']);\n\t\t$title=get_page_title('PURCHASE_SOME_PRODUCT',true,array(escape_html($c_title)));\n\n\t\t// Check points\n\t\t$points_left=available_points(get_member());\n\t\tif (($points_left<$cost) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('_CANT_AFFORD',integer_format($cost),integer_format($points_left)));\n\t\t}\n\n\t\tif ($rows[0]['c_one_per_member']==1)\n\t\t{\n\t\t\t// Test to see if it's been bought\n\t\t\t$test=$GLOBALS['SITE_DB']->query_value_null_ok('sales','id',array('purchasetype'=>'PURCHASE_CUSTOM_PRODUCT','details2'=>strval($rows[0]['id']),'memberid'=>get_member()));\n\t\t\tif (!is_null($test))\n\t\t\t\twarn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n\t\t}\n\n\t\trequire_code('points2');\n\t\tcharge_member(get_member(),$cost,$c_title);\n\t\t$sale_id=$GLOBALS['SITE_DB']->query_insert('sales',array('date_and_time'=>time(),'memberid'=>get_member(),'purchasetype'=>'PURCHASE_CUSTOM_PRODUCT','details'=>$c_title,'details2'=>strval($rows[0]['id'])),true);\n\n\t\trequire_code('notifications');\n\t\t$subject=do_lang('MAIL_REQUEST_CUSTOM',comcode_escape($c_title),NULL,NULL,get_site_default_lang());\n\t\t$username=$GLOBALS['FORUM_DRIVER']->get_username(get_member());\n\t\t$message_raw=do_lang('MAIL_REQUEST_CUSTOM_BODY',comcode_escape($c_title),$username,NULL,get_site_default_lang());\n\t\tdispatch_notification('pointstore_request_custom','custom'.strval($id).'_'.strval($sale_id),$subject,$message_raw,NULL,NULL,3,true);\n\n\t\t// Show message\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_GENERAL_DONE'));\n\t}", "public function postProcess($cart,$pg) {\n\t\t$authorized = false;\n\t\tforeach (Module::getPaymentModules() as $module)\n\t\t\tif ($module['name'] == 'faspay') {\n\t\t\t\t$authorized = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tif (!$authorized)\n\t\t\tdie($this->l('This payment method is not available.', 'validation'));\n\n\t\n\t\t$customer = new Customer($cart->id_customer);\n\t\tif (!Validate::isLoadedObject($customer))\n\t\t\tTools::redirect('index.php?controller=order&step=1');\n\n\t\t$pg \t\t= Tools::getValue('pg');\n\t\t$fp \t\t= new Faspay();\n\t\t$pgName\t\t= $fp->pglist[$pg]['nm'].\" (via faspay)\";\n\t\t$currency \t= $this->context->currency;\n\t\t$total \t\t= (float)$cart->getOrderTotal(true, Cart::BOTH);\n\t\t$mailVars \t= array(\n\t\t\t'{bankwire_owner}' => Configuration::get('FASPAY_MERCHANT_NAME'),\n\t\t\t'{bankwire_details}' => nl2br(Configuration::get('FASPAY_MERCHANT_NAME')),\n\t\t\t'{bankwire_address}' => nl2br(Configuration::get('FASPAY_MERCHANT_NAME'))\n\t\t);\n\t\t$dat = $_POST;\n\t\t$concat = \"\";\n\t\tforeach($dat as $key => $value){\n\t\t\t$concat = $concat.\"&\".$key.\"=\".$value;\n\t\t}\n\t\t\n\t\t$this->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->displayName, $pgName, $mailVars, (int)$currency->id, false, $customer->secure_key);\t\t\n\t\tTools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$this->id.'&id_order='.$this->currentOrder.'&key='.$customer->secure_key.'&pg='.$pg.$concat);\n\n\t}", "public function action_paypal_callback()\n\t{\n $post = $this->request->post();\n\t\t$type = $this->request->param('id');\n\t\t$payment = new Model_Realexpayments; // Not actually \"Realex\"\n\t\t$data['purchase_time'] = date('Y-m-d H:i:s');\n\n\t\tIbHelpers::htmlspecialchars_array($post);\n\n\t\t$data['cart_details'] = json_encode(IbHelpers::iconv_array($post));\n\n try\n\t\t{\n $is_booking = ($type == 'booking' AND isset($post['custom']));\n\t\t\t$is_product = ($type == 'product' AND isset($post['custom']));\n\t\t\t$is_invoice = ($type == 'invoice' AND isset($post['custom']));\n\t\t\t$data['paid'] = 1;\n\t\t\t$data['payment_type'] = 'PayPal';\n\t\t\t$data['payment_amount'] = isset($post['mc_gross']) ? $post['mc_gross'] : '';\n\n\t\t\tif ($is_booking)\n\t\t\t{\n\t\t\t\t// Use contact details from the booking, which should also be the data filled out in the checkout form\n\t\t\t\t$booking = Model_CourseBookings::load(trim($post['custom'], '|'));\n $data['customer_name'] = $booking['student']['first_name'].' '.$booking['student']['last_name'];\n\t\t\t\t$data['customer_telephone'] = $booking['student']['phone'];\n\t\t\t\t$data['customer_address'] = $booking['student']['address'];\n\t\t\t\t$data['customer_email'] = $booking['student']['email'];\n\t\t\t}\n\t\t\telseif ($is_product OR $is_invoice)\n\t\t\t{\n\t\t\t\t$cart = new Model_Cart($post['custom']);\n\n\t\t\t\t// Set the cart item as paid\n\t\t\t\t$cart->set_paid(1)->save();\n\n\t\t\t\t// Send the emails\n\t\t\t\t$cart = $cart->get_instance();\n\t\t\t\t$form_data = json_decode($cart['form_data']);\n\t\t\t\t$cart_data = json_decode($cart['cart_data']);\n\t\t\t\t$cart_data = isset($cart_data->data) ? $cart_data->data : new stdClass();\n $cart_data->payment_type = 'Paypal';\n\n\t\t\t\t$data['customer_name'] = isset($form_data->ccName) ? $form_data->ccName : '';\n\t\t\t\t$data['customer_telephone'] = isset($form_data->phone) ? $form_data-> phone : '';\n\t\t\t\t$data['customer_address'] = isset($form_data->address_1) ? $form_data->address_1 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_2) ? ', '.$form_data->address_2 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_3) ? ', '.$form_data->address_3 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_4) ? ', '.$form_data->address_4 : '';\n\t\t\t\t$data['customer_email'] = isset($form_data->email) ? $form_data->email : '';\n\t\t\t\t$data['cart_id'] = isset($cart_data->id) ? $cart_data->id : '';\n\n\t\t\t\t$payment->send_mail_seller($form_data, (array) $cart_data);\n\t\t\t\t$payment->send_mail_customer($form_data, NULL, (array) $cart_data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Use contact details from the buyer's PayPal account\n\t\t\t\t$data['customer_name'] = trim((isset($post['first_name'])?$post['first_name']:'').' '.(isset($post['last_name'])?$post['last_name']:''));\n\t\t\t\t$data['customer_telephone'] = isset($post['contact_phone']) ? $post['contact_phone'] : '';;\n\t\t\t\t$data['customer_address'] = \"\".\n\t\t\t\t\t(isset($post['address_name']) ? $post['address_name'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_street']) ? $post['address_street'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_city']) ? $post['address_city'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_state']) ? $post['address_state'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_zip']) ? $post['address_zip'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_country']) ? $post['address_country'].\"\\n\" : '');\n\t\t\t\t$data['customer_email'] = isset($post['payer_email']) ? $post['payer_email'] : '';\n\t\t\t}\n\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\n if ($is_booking)\n\t\t\t{\n\t\t\t\tModel_CourseBookings::paypal_handler_old($booking['id'], $post['mc_gross'], $post['txn_id']);\n\n\t\t\t\t// send success emails regarding bookings\n\t\t\t\t$payment->send_mail_seller_bookings($post);\n\t\t\t\t$payment->send_mail_customer_bookings($post);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().\"\\n\".$e->getTraceAsString());\n\t\t\t$data['payment_type'] = 'Test/failed payment';\n\t\t\tModel_Errorlog::save($e);\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\t\t}\n\t}", "public function notifyPayment()\n {\n }", "private function ProcessOrderPayment()\n\t{\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t$order_token = \"\";\n\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t$order_token = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t}\n\n\t\t// If the order token is empty then something has gone wrong.\n\t\tif($order_token == '') {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Load the pending order\n\t\t$orders = LoadPendingOrdersByToken($order_token);\n\n\t\tif(!is_array($orders)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\tif ($orders['status'] != ORDER_STATUS_INCOMPLETE) {\n\t\t\t// has this order already been completed? redirect to finish order\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Get the payment module\n\t\tif(!GetModuleById('checkout', $provider, $orders['paymentmodule'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPathSSL'].\"/checkout.php?action=confirm_order\");\n\t\t\tdie();\n\t\t}\n\n\t\t$provider->SetOrderData($orders);\n\n\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($provider, 'DoExpressCheckoutPayment')) {\n\t\t\t$provider->DoExpressCheckoutPayment();\n\t\t\tdie();\n\t\t}\n\n\t\t// Does this method have it's own processing method?\n\t\tif(method_exists($provider, \"ProcessPaymentForm\")) {\n\t\t\t$result = $provider->ProcessPaymentForm();\n\t\t\tif($result) {\n\t\t\t\t$paymentStatus = $provider->GetPaymentStatus();\n\t\t\t\t$orderStatus = GetOrderStatusFromPaymentStatus($paymentStatus);\n\t\t\t\tif(CompletePendingOrder($order_token, $orderStatus)) {\n\t\t\t\t\t// Everything is fine, send the customer to the thank you page.\n\t\t\t\t\tredirect(getConfig('ShopPathSSL').'/finishorder.php');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise there was an error\n\t\t\t$this->ShowPaymentForm($provider);\n\t\t}\n\n\t\t// If we're still here then something from the above has gone wrong. Show the confirm page again\n\t\tredirect(getConfig('ShopPathSSL').'/checkout.php?action=confirm_order');\n\t}", "public function record_payment()\r\n {\r\n if (!has_permission('payments', '', 'create')) {\r\n access_denied('Record Payment');\r\n }\r\n if ($this->input->post()) {\r\n $this->load->model('payments_model');\r\n $id = $this->payments_model->process_payment($this->input->post(), '');\r\n if ($id) {\r\n set_alert('success', _l('invoice_payment_recorded'));\r\n redirect(admin_url('payments/payment/' . $id));\r\n } else {\r\n set_alert('danger', _l('invoice_payment_record_failed'));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $this->input->post('invoiceid')));\r\n }\r\n }", "function process_payment( $order_id )\n {\n\n //cuando hace click en proceder al pago, luego de elegir seguripago\n //finalizar-comprar/ 1\n\n $order = new WC_Order( $order_id );\n\n return array\n (\n 'result' => 'success',\n 'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('pay'))))\n );\n }" ]
[ "0.7516175", "0.714547", "0.6953258", "0.6879745", "0.6839262", "0.6812763", "0.68028784", "0.67768824", "0.67190826", "0.666666", "0.66434366", "0.66416097", "0.6614928", "0.6589211", "0.6583582", "0.65805745", "0.65764487", "0.65624136", "0.65274787", "0.6521082", "0.6483993", "0.6460101", "0.6454927", "0.6441906", "0.64400536", "0.6431905", "0.6428488", "0.6428488", "0.64273256", "0.6415016", "0.64090544", "0.6390967", "0.6375999", "0.63323885", "0.6328494", "0.6326802", "0.63001394", "0.6299114", "0.62864", "0.62839216", "0.62751067", "0.6273402", "0.62425214", "0.62399924", "0.62325114", "0.62297404", "0.62124854", "0.62027436", "0.6193923", "0.61915123", "0.6190551", "0.6180961", "0.61737454", "0.6173165", "0.61602694", "0.61557657", "0.61488616", "0.61480314", "0.61478055", "0.6142696", "0.61302865", "0.6127252", "0.6121354", "0.6118905", "0.6118081", "0.6117843", "0.6103355", "0.60964084", "0.60753787", "0.607457", "0.6074492", "0.60738665", "0.60726815", "0.6069589", "0.6067373", "0.60664284", "0.60499436", "0.6027663", "0.6023198", "0.60190374", "0.6016497", "0.6016228", "0.6015886", "0.60101974", "0.60097766", "0.6008115", "0.60074264", "0.6005166", "0.5983462", "0.59820104", "0.59764963", "0.59536266", "0.5952858", "0.59507227", "0.59485614", "0.5946749", "0.594488", "0.59439975", "0.5939482", "0.5936927", "0.5931802" ]
0.0
-1
Perform a transaction using reference Transaction ID
public function doReferenceTransaction($ref) { $nvpstr = '&REFERENCEID=' . $ref . '&AMT=10' . '&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0'; $this->hash_call('DoReferenceTransaction', $nvpstr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transaction();", "public function transaction();", "public function getTransactionID();", "public function doTransaction()\n\t{\n\t\t$this->initRequest();\n\n\t\t$this->setTransaction([\n\t\t\t'ReportTxnDetail' => [\n\t\t\t\t'TxnId' => $this->TxnId\n\t\t\t]\n\t\t]);\n\t\t\n\t\treturn $this->Transaction();\n\t}", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function performTransaction( $client_id, $toAccount, $amount,$transNo, $transactionType ) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call performTransaction(?, ?, ?, ?, ?)\" );\n $stmt->bind_param ( 'isdsi', $client_id, $toAccount, $amount, $transNo, $transactionType );\n $stmt->execute ();\n\n return $stmt->get_result ();\n }", "public function getTransactionId();", "public function getTransactionId();", "function insert_transaction_record()\n\t{\n\t\t$invoice_id = strtotime('now');\n\t\t\n\t\t$data = array(\n\t\t 'user_id' => $this->user_id,\n\t\t 'invoice_id' => $invoice_id,\n\t\t 'product_id' => $this->auction_id,\t\t \t\t\n\t\t 'credit_debit' => 'DEBIT',\t\t \n\t\t 'transaction_name' =>'Bid Fee For auction ID: '.$this->auction_id,\n\t\t 'transaction_date' => $this->general->get_local_time('time'),\n\t\t 'transaction_type' => 'bid',\n\t\t 'transaction_status' => 'Completed',\t\t \n\t\t 'payment_method' => 'direct',\n\t\t 'amount'=>$this->user_bid_amt,\n\t\t 'pay_type' => $this->payment_type,\n\t \t);\n\t\t\n\t\t$this->db->insert('transaction', $data);\n\t\treturn $this->db->insert_id(); \t\n\t}", "public function transaction(callable $callback);", "abstract protected function _start_transaction();", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "function get_transaction_id()\n {\n return $this->platnosci_post_vars['txn_id']; \n }", "public function getTransactionId() { return $this->transactionId; }", "public function getTxnId()\n {\n return $this->response['result']['id'];\n }", "public function getTransactionId()\n {\n return $this->transactionId++;\n }", "public function beginTransaction();", "public function beginTransaction();", "public function beginTransaction();", "abstract public function commitTransaction();", "public function getTransactionID()\n\t{\n\t\treturn $this->transaction_id;\n\t}", "public function transaction($id, array $optional = [])\n {\n return $this->client->resource('Bill.Transaction', $this->getVersion())\n ->show($id, $optional);\n }", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function transaction($transactionId) {\n //Get information on a single transaction\n\t\t\treturn self::get(self::transaction_index() . $transactionId);\n\t\t}", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "public function getTransactionReference()\n {\n if (!isset($this->data['error'])) {\n return $this->data['transactionResponse']['transactionId'];\n }\n\n return null;\n }", "public function beginTransaction():void;", "public function transaction(User $user)\n {\n }", "public function transaction(callable $run, $attempts=1);", "public function RefundTxn() {\r\n\r\n $ch = curl_init();\r\n\r\n $CURLParameters = http_build_query(array(\r\n // Our default parameters!\r\n \"key\" => $this->key,\r\n \"appid\" => $this->game,\r\n // This can vary from request to request, sometimes its steamid or steamids or even an array.\r\n \"steamid\" => $this->steamid,\r\n // Custom Queries below here.\r\n \"orderid\" => $this->orderid,\r\n ));\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://partner.steam-api.com/\" . $this->interface . \"/RefundTxn/v2/\");\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $CURLParameters);\r\n $CURLResponse = json_decode(curl_exec($ch));\r\n $CURLResponseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n\r\n // Error handling improved!\r\n\r\n if ($CURLResponseCode != 200) {\r\n if ($CURLResponseCode == 400) {\r\n throw new exceptions\\SteamRequestParameterException(\"The Order ID or another parameter is invalid!\");\r\n }\r\n if ($CURLResponseCode == 401) {\r\n throw new exceptions\\SteamException(\"App ID or API Key is invalid.\");\r\n }\r\n throw new exceptions\\SteamRequestException(\"$CURLResponseCode Request Error.\");\r\n }\r\n\r\n if ($CURLResponse->response->result == \"OK\") {\r\n return true;\r\n }\r\n\r\n throw new exceptions\\SteamRequestException(json_encode($CURLResponse->response->error));\r\n }", "public abstract function beginTransaction();", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "abstract public function determineTransaction();", "public function DoTransaction(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\tif(isset($_POST) && !empty($_POST)){\n\t\t\t\t$customer_id = $_POST['txn_data']['txn_customer_id'];\t\t\t\t\t\t\t\n\t\t\t\t$count=1;\n\t\t\t\tforeach($_POST['cart_data'] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif($key){\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// end\n\t\t\t\t$business_admin_id = $this->session->userdata['logged_in']['business_outlet_id'];\n\t\t\t\t$result = $this->CashierModel->BillingTransaction($_POST,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n\n\t\t\t\tif($result['success'] == 'true'){\n\t\t\t\t\t$transcation_detail = $this->CashierModel->GetBilledServicesByTxnId($result['res_arr']['res_arr']['insert_id']);\n\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_id'] = $result['res_arr']['res_arr']['insert_id'];\n\t\t\t\t\t$cart_data['outlet_admin_id'] = $business_admin_id;\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_time'] = $transcation_detail['res_arr'][0]['txn_datetime'];\n\t\t\t\t\t$cart_data['cart_data'] = json_encode($_POST['cart_data']);\n\t\t\t\t\t$cart_detail = $this->CashierModel->Insert($cart_data,'mss_transaction_cart');\n\t\t\t\t\tif($cart_detail['success'] == 'true'){\n\t\t\t\t\t\t$this->session->set_userdata('loyalty_point',$transcation_detail['res_arr'][0]['txn_loyalty_points']);\n\t\t\t\t\t\t$this->session->set_userdata('cashback',$transcation_detail['res_arr'][0]['txn_loyalty_cashback']);\n\t\t\t\t\t\t$detail_id = $cart_detail['res_arr']['insert_id'];\n\t\t\t\t\t\t$bill_url = base_url().\"Cashier/generateBill/$customer_id/\".base64_encode($detail_id);\n\t\t\t\t\t\t$bill_url = str_replace(\"https\", \"http\", $bill_url);\n\t\t\t\t\t\t$bill_url = shortUrl($bill_url);\n\t\t\t\t\t}\n\n\t\t\t\t\t//1.Unset the payment session\n\t\t \t\t\tif(isset($this->session->userdata['payment'])){\n\t\t \t\t\t\t$this->session->unset_userdata('payment');\n\t\t\t\t\t }\n\t\t\t\t\t //j\n\t\t\t\t\t //Memebership Package Loyalty Calculation\n if(isset($this->session->userdata['cart'][$customer_id]))\n { \n $data = $this->CashierModel->GetCustomerPackages($customer_id);\n if($data['success'] == 'false')\n {\n // $this->PrettyPrintArray(\"Customer Does not have special membership\");\n }\n else{\n if(!empty($data['res_arr']))\n {\n if(isset($this->session->userdata['cart'][$customer_id]))\n {\n $curr_sess_cart = $this->session->userdata['cart'][$customer_id];\n $cart_data = array();\n $i = 0;\n $j = 0;\n $total_product = 0;\n $total_points = 0;\n for($j;$j<count($curr_sess_cart);$j++)\n {\n $service_details = $this->CashierModel->DetailsById($curr_sess_cart[$j]['service_id'],'mss_services','service_id');\n if(isset($service_details['res_arr']))\n {\n // print_r($service_details['res_arr']);\n if($service_details['res_arr']['service_type'] == 'otc')\n {\n $total_product += $curr_sess_cart[$j]['service_total_value'];\n $total_points+= ($curr_sess_cart[$j]['service_total_value']*$data['res_arr'][$i]['service_discount'])/100;\n $curr_sess_cart[$j] += ['service_discount'=>$data['res_arr'][$i]['service_discount']];\n \n array_push($cart_data,$curr_sess_cart[$j]);\n // array_push($cart_data,$data['res_arr'][$i]['service_discount']);\n }\n }\n }\n \n if(!empty($cart_data))\n {\n foreach($cart_data as $key=>$value)\n {\n }\n }\n $update = array(\n 'total_points' => $total_points,\n 'txn_id' => $result['res_arr']['res_arr']['insert_id'],\n 'customer_id' => $customer_id\n );\n $result_2 = $this->CashierModel->SpecialLoyaltyPoints($update,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n // $this->PrettyPrintArray($cart_data);\n // exit;\n }\n }\n \n }\n \n }\n\t\t\t\t\t //end\n \n // 2.Then unset the cart session\n\t\t \t\t\tif(isset($this->session->userdata['cart'][$customer_id])){\n\t\t \t\t\t\t$curr_sess_cart_data = $this->session->userdata['cart'];\n\t\t \t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t \t\t\t\t$this->session->set_userdata('cart',$curr_sess_cart_data);\n\t\t \t\t\t}\n if(isset($this->session->userdata['recommended_ser'][$customer_id])){\n\t\t\t\t\t\t$curr_sess_cart_data = $this->session->userdata['recommended_ser'];\n\t\t\t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t\t\t\t\t$this->session->set_userdata('recommended_ser',$curr_sess_cart_data);\n\t\t\t\t\t}\n\t\t\t\t\t//3.Then unset the customer session from POS\n\t\t \t\t\tif(isset($this->session->userdata['POS'])){\n\t\t \t\t\t\t$curr_sess_cust_data = $this->session->userdata['POS'];\n\t\t \t\t\t\t\n\t\t \t\t\t\t$key = array_search($customer_id, array_column($curr_sess_cust_data, 'customer_id'));\n\t\t \t\t\t\t\n\t\t \t\t\t\tunset($curr_sess_cust_data[$key]);\n\t\t \t\t\t\t$curr_sess_cust_data = array_values($curr_sess_cust_data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t$this->session->set_userdata('POS',$curr_sess_cust_data);\n\t\t \t\t\t}\n\n\t\t \t\t\t//These 2 call will be used for the further enhancement of message sending architecture.\n\t\t \t\t\t$outlet_details = $this->GetCashierDetails();\n\t\t\t\t\t$customer_details = $this->GetCustomerBilling($_POST['customer_pending_data']['customer_id']);\n\t\t\t\t\t//4.Send a msg\n\t\t\t\t\t$this->session->set_userdata('bill_url',$bill_url);\n\t\t\t\t\t$sms_status = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$this->session->userdata['logged_in']['business_outlet_id'])->get()->row_array();\n\t\t\t\t\t\t// $this->PrettyPrintArray($sms_status);\n\t\t\t\t\tif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==0){\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']>0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']==0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\t\t\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==1){\n\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==0 && $sms_status['whats_app_sms_status']==1 ){\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t}\n\t\t\t\t\t//\n \n\t\t\t\t\t$this->ReturnJsonArray(true,false,\"Transaction is successful!\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t\telseif ($result['error'] == 'true') {\n\t\t\t\t\t$this->ReturnJsonArray(false,true,$result['message']);\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function transactional();", "public function createResourceBillTransaction($object_id, $bill_id, $params = array()) {\n\n $params['product_id'] = $object_id;\n $params['quantity'] = 1;\n $storeBillObj = Engine_Api::_()->getItem('sitestoreproduct_storebill', $bill_id);\n $params['amount'] = $storeBillObj->amount;\n $params['additionalinfo'] = \"Commission\";\n $params = $this->setExtraParams($params);\n\n // Create transaction\n $transaction = $this->createTransaction($params);\n\n return $transaction;\n }", "public function getTransaction($txid);", "public function transactionAction() {\n try {\n $this->datasource->beginTransaction();\n\n $article_id = $this->datasource->insertArticle('John Smith', 'Nice writing');\n\n $this->datasource->deleteArticle($article_id);\n\n $this->datasource->commit();\n\n return ['success' => true];\n\n } catch(Exception $ex) {\n $this->datasource->rollBack();\n throw $ex;\n }\n }", "public function transaction($settings = array())\n { \n $data = false;\n // MAKE API CALL\n $defaults = array(\n 'debug' => false,\n 'details' => false,\n 'method' => 'transaction/id',\n 'chain' => $this::$blockchain,\n 'base' => $this::$options['blockchains'][$this::$blockchain]['base'],\n 'id' => 0,\n 'showtxn' => 0,\n 'showtxnio' => 1\n );\n $options = array_merge($defaults, $settings);\n $key = 'transacton_'.$options['chain'].'_'.$options['id'];\n $results = $this::$cache->read($key, 'shortterm');\n $this->url($options);\n if(!$results){\n $results = $this->get($options);\n $this::$cache->write($key, $results, 'shortterm');\n }\n elseif($options['debug'] === true)\n {\n $this->url($options);\n }\n if($options['details'] === true)\n {\n $data = $results;\n }\n else if(isset($results['status']) && $results['status'] == 'success')\n {\n $tx = $results['data']['transaction'];\n $data = $tx;\n }\n return $data;\n }", "public function getTransactionReference()\n {\n return $this->getDataItem('transactionReference');\n }", "abstract public function startTransaction();", "public function setTransactionUid ($transUid);", "public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}", "public function startTransaction(): void;", "public function reverseTransaction($journalId) {\n \n }", "public function getTransactionReference()\n {\n return $this->transactionReference;\n }", "public function createTransaction()\n {\n }", "function commit ($transactionId = null)\n {\n $headers = array();\n if ( isset($transactionId) )\n {\n $headers['transaction'] = $transactionId;\n }\n $this->writeFrame(new StompFrame('COMMIT', $headers));\n }", "public function getTransactionId() {\n return $this->transactionId;\n }", "public function refundTransaction() {\n //not implemented\n }", "public static function commit_transaction()\n {\n global $wpdb;\n $wpdb->query('COMMIT;');\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }", "public function getTransactionId(): string;", "public static function commitTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->commit();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}", "public function commit($id);", "function getTxnId() {\n return $this->txn_id;\n }", "public function getTransaction();", "public function getTransactionId()\n {\n return $this->transactionIdentifier;\n }", "public function execute($options) {\n\t\t$this->dataAdders->addMerchantData(isset($options['orderId']) ? $options['orderId'] : false);\n\t\treturn $this->dataSource->runTransaction();\n\t}", "public function save_transaction($transaction)\r\n {\r\n\r\n $rcontact_id = DB::select('remote_contact_id')\r\n ->from(Model_Remoteaccounting::TABLE_RCONTACTS)\r\n ->where('local_contact_id', '=', $transaction['contact_id'])\r\n ->and_where('remote_api', '=', Model_Bigredcloud::API_NAME)\r\n ->execute()\r\n ->get('remote_contact_id');\r\n\r\n $params = array();\r\n $params['acEntries'] = [\r\n ['accountCode' => Settings::instance()->get('bigredcloud_account_invoice'), 'analysisCategoryId' => 319228, 'value' => $transaction['total']]\r\n ];\r\n $params['customFields'] = [];\r\n $params['customerId'] = $rcontact_id;\r\n $params['details'] = $transaction['details'];\r\n $params['entryDate'] = $transaction['created'];\r\n $params['note'] = @$transaction['note'] ?: '';\r\n $params['procDate'] = $transaction['created'];\r\n $params['reference'] = null;\r\n $params['total'] = $transaction['total'];\r\n $params['totalVAT'] = 0;\r\n $params['vatEntries'] = [['amount' => $transaction['total'], 'vatRateId' => '86010', 'vatTypeId' => 1]];\r\n $params['netGoods'] = 0;\r\n $params['netServices'] = 0;\r\n $params['vatTypeId'] = 1;\r\n $params['vatRateId'] = '86010';\r\n\r\n //print_r($params);exit;\r\n $this->request(\r\n 'POST',\r\n 'salesEntries',\r\n $params\r\n );\r\n $remote_id = null;\r\n if ($this->last_id) {\r\n $remote_id = $this->last_id;\r\n }\r\n\r\n if ($remote_id) {\r\n DB::insert(Model_Remoteaccounting::TABLE_RTRANSACTIONS)\r\n ->values(\r\n array(\r\n 'local_transaction_id' => $transaction['id'],\r\n 'local_transaction_table' => $transaction['table'],\r\n 'remote_transaction_id' => $remote_id,\r\n 'remote_api' => Model_Bigredcloud::API_NAME\r\n )\r\n )->execute();\r\n return $remote_id;\r\n }\r\n return null;\r\n }", "function trans_commit()\r\n\t{\r\n\t\treturn $this->db->trans_commit();\r\n\t}", "public function approveTransaction($id, $employee_id) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call approveTransaction (?, ?)\" );\n $stmt->bind_param ( 'ii', $id, $employee_id );\n $stmt->execute ();\n \n return $stmt->get_result ();\n }", "function ibase_commit_ret($link_or_trans_identifier = null): void\n{\n error_clear_last();\n if ($link_or_trans_identifier !== null) {\n $safeResult = \\ibase_commit_ret($link_or_trans_identifier);\n } else {\n $safeResult = \\ibase_commit_ret();\n }\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "public function commitTransaction() {\n\t\t//noop\n\t}", "function Post_Transaction($application_id, $transaction_register_id, $manual_override = false)\n{\n\t$log = get_log(\"scheduling\");\n\t$db = ECash::getMasterDb();\n\t/**\n\t * To prevent a possible case of mixed company id's, I'm pulling the Application\n\t * up and getting the company_id off of it rather than fetching it from the\n\t * ECash Object. [GF#17150][BR]\n\t */\n\t$application = ECash::getApplicationById($application_id);\n\t$company_id = $application->getCompanyId();\n\n\tif($manual_override == true)\n\t{\n\t\t$transaction_status_line = \"transaction_status IN ('new','pending', 'failed')\";\n\t}\n\telse\n\t{\n\t\t$transaction_status_line = \"transaction_status IN ('new','pending')\";\n\t}\n\n\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:{$application_id}] Posting transaction {$transaction_register_id}\");\n\t$rows_inserted = 0;\n\n\ttry\n\t{\n\t\t$query_sel = \"\n\t\t\t\t\tSELECT\n\t\t\t\t\t\ttransaction_type_id,\n\t\t\t\t\t\tamount,\n\t\t\t\t\t\tdate_effective\n\t\t\t\t\tFROM\n\t\t\t\t\t\ttransaction_register\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t$transaction_status_line\n\t\t\t\t\t\tAND company_id = {$company_id}\n\t\t\t\t\t\tAND application_id = {$application_id}\n\t\t\t\t\t\tAND transaction_register_id\t= {$transaction_register_id}\n\t\t\t\t\tFOR UPDATE \";\n\n\t\t$result = $db->query($query_sel);\n\t\tif ($row = $result->fetch(PDO::FETCH_OBJ))\n\t\t{\n\t\t\t$source_map = Get_Source_Map();\n\t\t\t$source_id = $source_map[DEFAULT_SOURCE_TYPE];\n\t\t\t$query_ins = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t\t\tINSERT INTO transaction_ledger\n\t\t\t\t\t(\n\t\t\t\t\t\tdate_created,\n\t\t\t\t\t\tcompany_id,\n\t\t\t\t\t\tapplication_id,\n\t\t\t\t\t\ttransaction_type_id,\n\t\t\t\t\t\ttransaction_register_id,\n\t\t\t\t\t\tamount,\n\t\t\t\t\t\tdate_posted,\n\t\t\t\t\t\tsource_id\n\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\tcurrent_timestamp,\n\t\t\t\t\t\t{$company_id},\n\t\t\t\t\t\t$application_id,\n\t\t\t\t\t\t{$row->transaction_type_id},\n\t\t\t\t\t\t$transaction_register_id,\n\t\t\t\t\t\t{$row->amount},\n\t\t\t\t\t\t'{$row->date_effective}',\n\t\t\t\t\t\t'$source_id'\n\t\t\t\t\t) \";\n\n\t\t\t$rows_inserted = $db->exec($query_ins);\n\t\t\t$agent_id = Fetch_Current_Agent();\n\n\t\t\tSet_Loan_Snapshot($transaction_register_id,\"complete\");\n\n\t\t\t$query_upd = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t\t\tUPDATE transaction_register\n\t\t\t\tSET\n\t\t\t\t\ttransaction_status = 'complete',\n\t\t\t\t\tmodifying_agent_id = '{$agent_id}'\n\t\t\t\tWHERE\n\t\t\t\t\t\ttransaction_register_id\t= $transaction_register_id\n\t\t\t\t\tAND $transaction_status_line \";\n\n\t\t\t$db->exec($query_upd);\n\t\t}\n\t}\n\tcatch(Exception $e)\n\t{\n\t\tthrow $e;\n\t}\n\n\tif ($rows_inserted < 1) return false;\n\n\treturn true;\n}", "function add_transaction($transaction_id, $date, $time, $customer, $value){\n $str_query=\"insert into pos_transaction set transaction_id='$transaction_id',date='$date',\n time='$time',customer='$customer',value='$value'\";\n return $this->query($str_query);\n }", "public function getTransactionId()\n {\n return $this->transactionId;\n }", "function _getTransactionDetails($transaction_id) {\t\t\n\t\t// Set request-specific fields.\n\t\t$transactionID = urlencode($transaction_id);\n\t\t$this->nvpStr = \"&TRANSACTIONID=$transactionID\";\t\n\t\t\t\n\t\treturn $this->query(\"RefundTransaction\");\n\t}", "function purchase($id = null) {\n\t\tif(!empty($this->data)) { //Credit card is submitted\n\t\t\t$travelerID = $this->Session->read('Traveler.id'); //Check that they are logged in\n\t\t\tif(is_null($travelerID)) {\n\t\t\t\t$this->Session->setFlash(__('Please log in or create an account to make a purchase.', true));\n\t\t\t}\n\t\t\telse {//They are logged in. \n\t\t\t\t//Validate the CC and make the purchase.\n\t\t\t\t//debug($this->Deal->DealPurchase->find('count', array('conditions' => array('DealPurchase.deal_id' => $id))));\n\t\t\t\t$this->loadModel('Traveler');\n\t\t\t\t$traveler = $this->Traveler->read(null, $travelerID);\n\t\t\t\t$this->loadModel('Transaction');\n\t\t\t\t$this->data['Transaction']['cost'] = $this->Session->read('Trip.cost');\n\t\t\t\t$this->Transaction->set($this->data);\n\t\t\t\t//Billing info was entered. Now process the credit card\n\t\t\t\tif($this->Transaction->validates()) { //If CC info entered correctly\n\t\t\t\t\t$result = $this->Transaction->MakeBTTransaction($this->data, $traveler);\n\t\t\t\t\t//$result = Braintree_Transaction::sale($this->Transaction->buildBrainTreeTransaction($this->data, $traveler));\n\t\t\t\t\tif ($result->success) { //Braintree validation Success\n\t\t\t\t\t\t$purchase['DealPurchase']['deal_id'] = $id;\n\t\t\t\t\t\t$random_hash = substr(md5(uniqid(rand(), true)), -10, 10);\n\t\t\t\t\t\t$purchase['DealPurchase']['confirmation_code'] = $random_hash;\n\t\t\t\t\t\t$purchase['DealPurchase']['traveler_id'] = $travelerID;\n\t\t\t\t\t\t$purchase['DealPurchase']['start_date'] = $this->Session->read('Trip.start_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['end_date'] = $this->Session->read('Trip.end_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['purchase_amount'] = $this->Session->read('Trip.cost');\n\t\t\t\t\t\t$transaction = $result->transaction;\n\t\t\t\t\t\t$purchase['DealPurchase']['braintree_id'] = $transaction->id;\n\t\t\t\t\t\t$reservationType = $this->Deal->GetReservationType($id);\n\t\t\t\t\t\t//Save record for DealType 1 & 2\n\t\t\t\t\t\tif($reservationType == Configure::read('ReservationType.Fixed') || $reservationType == Configure::read('ReservationType.Variable')) {\n\t\t\t\t\t\t\t$this->loadModel('DealPurchase');\n\t\t\t\t\t\t\tif ($this->DealPurchase->save($purchase)) {\n\t\t\t\t\t\t\t\t$this->sendPurchaseMail($id, $travelerID, $this->DealPurchase->id, 'dealConfirmation');\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Insert Passenger records for DealType 3\n\t\t\t\t\t\telseif($reservationType == Configure::read('ReservationType.Set')) {\n\t\t\t\t\t\t\t$this->loadModel('Passenger');\n\t\t\t\t\t\t\t$purchase['Passenger']['first_name'] = $traveler['Traveler']['first_name'];\n\t\t\t\t\t\t\t$purchase['Passenger']['last_name'] = $traveler['Traveler']['last_name'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//use $this->Passenger so that the deal_purchase_id is inserted correctly\n\t\t\t\t\t\t\tif ($this->Passenger->saveAll($purchase)) {\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->Session->setFlash(__('The deal purchase could not be saved. Please, try again.', true),'error_flash');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse { //Braintree validation failed\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->setFlash(__('Unable to process your transaction. Please check your billing information and try again', true),'error_flash');\n\t\t\t\t\t\t/* Debugging code\n\t\t\t\t\t\tprint_r(\"\\n message: \" . $result->message);\n\t\t\t\t\t\tprint_r(\"\\nValidation errors: \\n\");\n\t\t\t\t\t\tprint_r($result->errors->deepAll());\n\t\t\t\t\t\tprint_r($expirationDate);\n\t\t\t\t\t\t*/\n\t\t\t\t\t} \n\t\t\t\t\n\t\t\t\t} else {//CC info not entered correctly\n\t\t\t\t\t$this->Session->setFlash(__('Billing information missing or formatted incorrectly. Please fix the errors and try again', true), 'error_flash');\n\t\t\t\t}\t\n\t\t\t}\n\t\t}//No data submitted. Load the page.\n\t//If you haven't been redirected yet, load the page\n\t$deal = $this->Deal->read(null, $id);\n\t$deal['Deal']['trip_start_date'] = $this->Session->read('Trip.start_date');\n\t$deal['Deal']['trip_end_date'] = $this->Session->read('Trip.end_date');\n\t$deal['Deal']['days'] = $this->Session->read('Trip.days');\n\t$deal['Deal']['cost'] = $this->Session->read('Trip.cost');\n\t$this->set(compact('deal')); \n\n\t}", "public function run()\n {\n $borrow = new Transaction();\n $borrow->user_id = 1;\n $borrow->debit = 1000;\n $borrow->credit = 2000;\n $borrow->saldo = 2000;\n $borrow->total = 4000;\n $borrow->save();\n }", "function createTransaction( $hash=null ){\n global $mysqli;\n if(!isset($hash) || $hash=='')\n return;\n $hash = $mysqli->real_escape_string($hash);\n $results = $mysqli->query(\"SELECT id FROM index_transactions WHERE `hash`='{$hash}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_transactions (`hash`) values ('{$hash}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_transactions table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_transactions table');\n }\n}", "public function generateTransactionId()\n {\n if ($this->configurator->useOwnTransactionId()) {\n //TODO: this should be injected instead\n $transactionIdGenerator = new TransactionIdGenerator();\n $transactionId = $transactionIdGenerator->generate($this->configurator->getTransactionIdPrefix()); //THIS SHOULD BE CONFIGURABLE\n } else {\n $posId = $this->getPosId();\n\n $this->suppressLibraryErrors();\n $transactionId = $this->service->tranzakcioAzonositoGeneralas($posId);\n $this->restoreErrorReporting();\n }\n\n return $transactionId;\n }", "public function createExpressCheckoutOrder($tid){}", "public function delete_transaction($transaction_id){\n //delete any note suggestions for the deal\n\t\t/***********\n\t\tsng:30/apr/2012\n\t\tWe now have transaction_note_suggestions\n\t\t**************/\n $q = \"delete from \".TP.\"transaction_note_suggestions where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any notes for the deal\n $q = \"delete from \".TP.\"transaction_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any error reports for the deal\n $q = \"delete from \".TP.\"transaction_error_reports where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*****************************************************************/\n //delete any sources for the deal\n $q = \"delete from \".TP.\"transaction_sources where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*******************************************************************/\n //delete partner members assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partner_members where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete partner banks/law firms assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partners where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete the transaction/tombstone from tombstone_favorite_tombstones\n //tombstone_id is same as transaction id\n $q = \"delete from \".TP.\"favorite_tombstones where tombstone_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /******************************************************************************/\n /**********\n sng:22/sep/2010\n since there can be multiple logos for a transaction, need to delete the images first\n the logos field has the multiple logo images in serialised form\n an array each of which is an array (fileName, default)\n \n also, if those logos are chosen, those have to be deleted [tombstone_chosen_logos ]\n since this is a serialised list, how to update?\n This part should be handled by Mihai\n ************/\n $q = \"select logos from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $res = mysql_query($q);\n if($res){\n $cnt = mysql_num_rows($res);\n if($cnt > 0){\n $row = mysql_fetch_assoc($res);\n $logos = $row['logos'];\n if($logos!=NULL){\n $logos_arr = unserialize($logos);\n $logos_cnt = count($logos_arr);\n if($logos_cnt > 0){\n foreach($logos_arr as $key=>$value){\n @unlink(FILE_PATH.\"uploaded_img/logo/\".$value['fileName']);\n @unlink(FILE_PATH.\"uploaded_img/logo/thumbnails/\".$value['fileName']);\n }\n }\n }\n }\n }\n /***************************************\n sng:22/nov/2010\n Now it can happen that press release entry may store the deal id if that press release item talks about this deal\n So, before deleting this deal, we will set the deal id in press release to blank (because we cannot delete the press release, that is\n independent of deal)\n **********/\n $q = \"update \".TP.\"press_releases set deal_id='0' where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any private note for the deal\n ******************/\n $q = \"delete from \".TP.\"transaction_private_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/*************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any discussion for this deal\n\t\t************/\n\t\t$q = \"delete from \".TP.\"transaction_discussion where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any case studies for the deal. Before deleting the case study, get the filename and delete it first\n\t\t*****************************/\n\t\t$q = \"select filename from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$filename = $row['filename'];\n\t\t\tif(($filename!=\"\")&&file_exists(FILE_PATH.\"case_studies/\".$filename)){\n\t\t\t\tunlink(FILE_PATH.\"case_studies/\".$filename);\n\t\t\t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************\n\t\tsng:1/july/2011\n\t\tDelete any transaction correction for this deal. Before deleting it, delete the correcponding records\n\t\tfrom transaction suggestion partner\n\t\t*************/\n\t\t$q = \"select id from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$suggestion_id = $row['id'];\n\t\t\t$del_q = \"delete from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$suggestion_id.\"'\";\n\t\t\t$success = mysql_query($del_q);\n \tif(!$success){\n \treturn false;\n \t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************************\n\t\tsng:1/july/2011\n\t\tDelete the transaction extra detail for the deal\n\t\t********************/\n\t\t$q = \"delete from \".TP.\"transaction_extra_detail where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************/\n //now delete the transaction\n $q = \"delete from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************************/\n return true;\n }", "function add_transaction($angebotid, $useridKaeufer, $bewertungVerkaeuferT, $bewertungVerkaeuferV, $bewertungKaeuferT, $bewertungKaeuferV)\r\n {\r\n $stid = $this->parseSql(\"begin sp_addTransaction(:p1, :p2, :p3, :p4, :p5, :p6, :p7); end;\");\r\n oci_bind_by_name($stid, \":p1\", $angebotid);\r\n oci_bind_by_name($stid, \":p2\", $useridKaeufer);\r\n oci_bind_by_name($stid, \":p3\", $bewertungVerkaeuferT);\r\n oci_bind_by_name($stid, \":p4\", $bewertungVerkaeuferV);\r\n oci_bind_by_name($stid, \":p5\", $bewertungKaeuferT);\r\n oci_bind_by_name($stid, \":p6\", $bewertungKaeuferV);\r\n oci_bind_by_name($stid, \":p7\", $errorOut, 300);\r\n $stid = $this->executeParsedSql($stid);\r\n\r\n if (!$this->errorHappened($errorOut)) {\r\n return \"Transaction added!\";\r\n } else {\r\n return \"error\";\r\n }\r\n }", "public function store() //CreateRecurringTransactionRequest $request,\n {\n \\DB::transaction(function() use ($id) {\n \n });\n }", "public function getTxnID()\n\t{\n\t\treturn $this->get('TxnID');\n\t}", "public function run()\n {\n Transaction::factory()\n ->count(10)\n ->state(new Sequence(\n ['type' => 'transfer'],\n ['type' => 'receive'],\n ['type' => 'referral']\n ))->create();\n }", "public function createOrderReferenceForId($requestParameters = array());", "public function update_tranasction_record()\n\t{\n\t\t$data = array(\n\t\t 'amount'\t\t\t\t=> $this->user_bid_amt,\t\n\t\t 'pay_type' => $this->payment_type,\t\t \t\t\t \n\t\t 'transaction_date'\t=> $this->general->get_local_time('time'),\t\t \n\t \t);\n\t\t\n\t\t$this->db->where('user_id', $this->user_id);\n\t\t$this->db->where('product_id', $this->auction_id);\n\t\t$this->db->where('transaction_type', 'bid');\n\t\t$this->db->where('transaction_status', 'Completed');\n\t\t$this->db->where('payment_method', 'direct');\n\t\t$this->db->update('transaction', $data);\n\t}", "public function get_transaction_id() {\n\n\t\treturn $this->transaction_tag;\n\t}", "public function getTransactionNumber();", "public function setTransactionId($id)\n {\n $this->_data['trx_id'] = $id;\n }", "public function getTransactionId(): string\n {\n return $this->transactionId;\n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function getTransactionUid ();", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function getTransaction(Wallet $wallet, $id): Transaction;", "public function getTransactionIdentifier()\n {\n return $this->transactionIdentifier;\n }", "private function record_transaction( $details ) {\n\n\t\tglobal $wpdb;\n\n\t\t$sql_cols = \"user_id, timestamp, \";\n\t\t$sql_vals = \"'\" . $details['custom'] . \"','\" . current_time( 'mysql' ) . \"',\";\n\t\t$txn_cols = $this->record_transaction_columns();\n\t\tforeach ( $txn_cols as $column ) {\n\t\t\tif ( isset( $details[ $column ] ) ) {\n\t\t\t\t$sql_cols.= $column . \",\";\n\t\t\t\t$sql_vals.= \"'\" . $details[ $column ] . \"',\";\n\t\t\t}\n\t\t}\n\t\t$sql = \"INSERT INTO \" . $wpdb->prefix . $this->transaction_table . \" ( \" . rtrim( $sql_cols, ',' ) . \" ) VALUES ( \" . rtrim( $sql_vals, ',' ) . \" )\";\n\t\t\n\t\t$result = $wpdb->query( $sql );\n\t\t\n\t\treturn;\n\t}", "public function transactionProcess (&$errorMessage);", "public function starttrans(){\n\t\t$this->transaction = true;\n\t\t$this->query(\"START TRANSACTION\");\n\t}", "public static function insert_transaction( $args = array() ) {\n global $wpdb;\n\n $defaults = array(\n 'id' => null,\n 'created_at' => current_time( 'mysql' ),\n );\n\n $args = wp_parse_args( $args, $defaults );\n $table_name = $wpdb->prefix . 'barhanmedia_transactions';\n\n // some basic validation\n\n // remove row id to determine if new or update\n $row_id = (int) $args['id'];\n unset( $args['id'] );\n\n if ( ! $row_id ) {\n\n // insert a new\n if ( $wpdb->insert( $table_name, $args ) ) {\n return $wpdb->insert_id;\n }\n\n } else {\n\n // do update method here\n if ( $wpdb->update( $table_name, $args, array( 'id' => $row_id ) ) ) {\n return $row_id;\n }\n }\n\n return false;\n }", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public static function beginTransaction()\n {\n }", "public function getTxId()\n {\n return $this->tx_id;\n }", "public function inTransaction();" ]
[ "0.66291356", "0.66291356", "0.6206243", "0.6113751", "0.6025251", "0.601474", "0.58320236", "0.58320236", "0.58200777", "0.5808117", "0.5742156", "0.5729479", "0.5701541", "0.5692495", "0.56885374", "0.56446946", "0.56387526", "0.56387526", "0.56387526", "0.5631671", "0.56303483", "0.55863285", "0.55768955", "0.557597", "0.5575671", "0.5563249", "0.5562838", "0.55544317", "0.5535655", "0.55309916", "0.5523286", "0.5519823", "0.5517375", "0.55141", "0.55127364", "0.5500132", "0.5499984", "0.5492727", "0.5480518", "0.54766756", "0.5439338", "0.5429663", "0.5417313", "0.5408985", "0.5401074", "0.53953445", "0.5389843", "0.5387135", "0.53772205", "0.53771657", "0.5353765", "0.5352648", "0.53458685", "0.53458685", "0.53458685", "0.53432673", "0.53397566", "0.53377724", "0.5326638", "0.5316092", "0.5315734", "0.5309745", "0.5299189", "0.5296152", "0.5295941", "0.5281038", "0.5276154", "0.52741355", "0.52737635", "0.5255186", "0.5252111", "0.5243551", "0.5240369", "0.5233249", "0.523238", "0.5229775", "0.52287877", "0.522358", "0.52231675", "0.5212922", "0.52094054", "0.5208561", "0.52078515", "0.5198095", "0.51973635", "0.5197219", "0.51947296", "0.519131", "0.51852465", "0.51814383", "0.51791984", "0.517896", "0.5175712", "0.5175387", "0.5174151", "0.5170627", "0.5170229", "0.51674664", "0.51628715", "0.5161534" ]
0.6816867
0
hash_call: Function to perform the API call to PayPal using API signature returns an associative array containing the response from the server.
private function hash_call($methodName, $nvpStr) { // form header string $nvpheader = $this->nvpHeader(); //setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->_api_endpoint); //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); $nvpStr=$nvpheader.$nvpStr; $nvpStr = "&VERSION=" . urlencode(self::VERSION) . $nvpStr; $nvpreq="METHOD=".urlencode($methodName).$nvpStr; // set the nvpreq as POST FIELD to curl curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); //getting response from server $response = curl_exec($ch); if (curl_errno($ch) == 60) { curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/PayPal_cacert.pem'); $response = curl_exec($ch); } //converting NVPResponse to an Associative Array $nvpResArray = $this->deformatNVP($response); if (curl_errno($ch)) { throw new \Exception(curl_error($ch), curl_errno($ch)); } else { //closing the curl curl_close($ch); } return $nvpResArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hash_call($methodName, $nvpStr)\r\n {\r\n \r\n //declaring of global variables\r\n //global $API_Endpoint, $API_UserName, $API_Password, $API_Signature, $API_AppID;\r\n //global $USE_PROXY, $PROXY_HOST, $PROXY_PORT;\r\n \r\n $this->API_Endpoint .= \"/\" . $methodName;\r\n \r\n //setting the curl parameters.\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\r\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\r\n\r\n //turning off the server and peer verification(TrustManager Concept).\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n \r\n // Set the HTTP Headers\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\r\n 'X-PAYPAL-REQUEST-DATA-FORMAT: NV',\r\n 'X-PAYPAL-RESPONSE-DATA-FORMAT: NV',\r\n 'X-PAYPAL-SECURITY-USERID: ' . $this->API_UserName,\r\n 'X-PAYPAL-SECURITY-PASSWORD: ' .$this->API_Password,\r\n 'X-PAYPAL-SECURITY-SIGNATURE: ' . $this->API_Signature,\r\n 'X-PAYPAL-SERVICE-VERSION: 1.3.0',\r\n 'X-PAYPAL-APPLICATION-ID: ' . $this->API_AppID\r\n ));\r\n \r\n //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\r\n //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \r\n if($this->USE_PROXY)\r\n curl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST. \":\" . $this->PROXY_PORT); \r\n\r\n // RequestEnvelope fields\r\n $detailLevel = urlencode(\"ReturnAll\"); // See DetailLevelCode in the WSDL for valid enumerations\r\n $errorLanguage = urlencode(\"en_US\"); // This should be the standard RFC 3066 language identification tag, e.g., en_US\r\n\r\n // NVPRequest for submitting to server\r\n $nvpreq = \"requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel\";\r\n $nvpreq .= \"&$nvpStr\";\r\n\r\n //setting the nvpreq as POST FIELD to curl\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\r\n \r\n //getting response from server\r\n $response = curl_exec($ch);\r\n \r\n //converting NVPResponse to an Associative Array\r\n $nvpResArray=$this->deformatNVP($response);\r\n $nvpReqArray=$this->deformatNVP($nvpreq);\r\n $_SESSION['nvpReqArray']= $nvpReqArray;\r\n\r\n if (curl_errno($ch)) \r\n {\r\n // moving to display page to display curl errors\r\n $_SESSION['curl_error_no']=curl_errno($ch) ;\r\n $_SESSION['curl_error_msg']=curl_error($ch);\r\n\r\n //Execute the Error handling module to display errors. \r\n } \r\n else \r\n {\r\n //closing the curl\r\n curl_close($ch);\r\n }\r\n\r\n return $nvpResArray;\r\n }", "function hash_call($methodName,$nvpStr){\n\t\t//declaring of global variables\n\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->PAYPAL_API_ENDPOINT);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t\t//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \n\t\tif($this->PAYPAL_USE_PROXY)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PAYPAL_PROXY_HOST.\":\".$this->PAYPAL_PROXY_PORT); \n\t\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->PAYPAL_VERSION) . $nvpStr;\t\n\t\t}\n\t\t\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\t\t\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\t\t$nvpReqArray = $this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t}\n\t\n\treturn $nvpResArray;\n\t}", "protected function hash_call($methodName, $nvpStr) {\n $API_Endpoint = Config::get('paypal.api_endpoint');\n\n //'------------------------------------\n //' PayPal API Credentials\n //' Replace <API_USERNAME> with your API Username\n //' Replace <API_PASSWORD> with your API Password\n //' Replace <API_SIGNATURE> with your Signature\n //'------------------------------------\n $API_UserName = Config::get('paypal.api_username');\n $API_Password = Config::get('paypal.api_password');\n $API_Signature = Config::get('paypal.api_signature');\n\n // BN Code \tis only applicable for partners\n $sBNCode = \"PP-ECWizard\";\n\n $PROXY_HOST = '127.0.0.1';\n $PROXY_PORT = '808';\n\n $USE_PROXY = false;\n $version = \"93\";\n\n //setting the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n //turning off the server and peer verification(TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n if ($USE_PROXY)\n curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . \":\" . $PROXY_PORT);\n\n //NVPRequest for submitting to server\n $nvpreq = \"METHOD=\" . urlencode($methodName) . \"&VERSION=\" . urlencode($version) . \"&PWD=\" . urlencode($API_Password) . \"&USER=\" . urlencode($API_UserName) . \"&SIGNATURE=\" . urlencode($API_Signature) . $nvpStr . \"&BUTTONSOURCE=\" . urlencode($sBNCode);\n\n //setting the nvpreq as POST FIELD to curl\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n //getting response from server\n $response = curl_exec($ch);\n\n //convrting NVPResponse to an Associative Array\n $nvpResArray = $this->deformatNVP($response);\n $nvpReqArray = $this->deformatNVP($nvpreq);\n $_SESSION['nvpReqArray'] = $nvpReqArray;\n\n if (curl_errno($ch)) {\n // moving to display page to display curl errors\n $_SESSION['curl_error_no'] = curl_errno($ch);\n $_SESSION['curl_error_msg'] = curl_error($ch);\n\n //Execute the Error handling module to display errors.\n } else {\n //closing the curl\n curl_close($ch);\n }\n\n return $nvpResArray;\n }", "public function hash_call($method_name, $nvpstr)\n\t{\n\t $settings = $this->pex_settings;\n\t $nvpheader = \"&PWD=\".urlencode($settings['api_password']).\"&USER=\".urlencode($settings['api_username']).\"&SIGNATURE=\".urlencode($settings['api_signature']);\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$settings['api_endpoint']);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t$nvpstr=$nvpheader.$nvpstr;\n\t\t//check if version is included in $nvpstr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpstr))) == strlen($nvpstr)) {\n\t\t\t$nvpstr = \"&VERSION=\" . urlencode($settings['api_version']) . $nvpstr;\t\n\t\t}\n\t\t$nvpreq=\"METHOD=\".urlencode($method_name).$nvpstr;\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpresarray = $this->deformat_nvp($response);\n\t\t$nvpreqarray = $this->deformat_nvp($nvpreq);\n\t\t$_SESSION['nvpreqarray']=$nvpreqarray;\n\t\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no'] = curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg'] = curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} \n\t\telse {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\t\treturn $nvpresarray;\n\t}", "function hash_call($methodName,$nvpStr)\n\t{\n\t\tsession_start();\n\t\t// form header string\n\t\t$nvpheader=$this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//in case of permission APIs send headers as HTTPheders\n\t\tif(!empty($this->AUTH_token) && !empty($this->AUTH_signature) && !empty($this->AUTH_timestamp))\n\t\t {\n\t\t\t$headers_array[] = \"X-PP-AUTHORIZATION: \".$nvpheader;\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_array);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nvpStr=$nvpheader.$nvpStr;\n\t\t}\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n\t\tif($this->USE_PROXY == TRUE)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST.\":\".$this->PROXY_PORT);\n\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->version) . $nvpStr;\n\t\t}\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\t if (curl_errno($ch) == 60) {\n\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\tdirname(__FILE__) . '/cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray=$this->deformatNVP($response);\n\t\t$nvpReqArray=$this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t $_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t $_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t $this->APIerror();\n\t\t\t //$location = \"APIError.php\";\n\t\t\t //header(\"Location: $location\");\n\t\t } else {\n\t\t\t //closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t }\n\n\t\treturn $nvpResArray;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) \n\t{\n\t\tglobal $environment;\n\t\t$API_UserName = urlencode('fhefoto_api1.yahoo.no');\n\t\t$API_Password = urlencode('N6SEDXLJKPN6PPWY');\n\t\t$API_Signature = urlencode('AlVtORxlymlrQpGY-fnzOdIuxvT1A2nTmy.LlXvPkOP5oU0VdZitgeEV');\n\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\n\t\treturn $httpParsedResponseAr;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function refundCallBackIndex()\n{\n $refundCallbackVO = array(\n 'merchantId' => 'test_merchant',\n 'refundId' => 'test_456',\n 'tradeNo' => 'REFTRADE20190415060401022956957',\n 'orderId' => 'test_123',\n 'refundAmount' => '1000',\n 'currency' => 'INR',\n 'status' => '1',\n 'errorCode' => '',\n 'errorMsg' => '',\n 'sign' => '055E10F63AF852BDAC8FA174C65F2F8A',\n );\n\n //verify your sign\n $sign = $refundCallbackVO['sign'];\n // Use the test environment link: secretKey needs to be secretKey for the test environment\n // Use the production environment link: the secretKey needs to be secretKey for the production environment\n if (verifyForMd5('test_key', $refundCallbackVO, $sign)) {//change to your merchant secret key from SHAREit pay\n //Process the notify from SHAREit pay with your own logic\n if (true) {\n //default response format without modify\n $successResponse = array(\n 'result_code' => 200,\n 'message' => 'success',\n );\n return json_encode($successResponse, true);\n } else {\n //Exception\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n } else {\n echo 'sign error';\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n\n}", "public function wpp_hash($method = null, $nvp = null) {\n\t\t$HttpSocket = new HttpSocket();\n\n\t\t$required_nvp = 'METHOD='.$method;\n\t\t$required_nvp .= '&VERSION='.Configure::read('Paypal.version');\n\t\t$required_nvp .= '&USER='.Configure::read('Paypal.username');\n\t\t$required_nvp .= '&PWD='.Configure::read('Paypal.password');\n\t\t$required_nvp .= '&SIGNATURE='.Configure::read('Paypal.signature');\n\t\tdebug($required_nvp);\n\t\tdie();\n\t\t$http_responder = $HttpSocket->post(Configure::read('Paypal.endpoint'), $required_nvp.$nvp);\n\t\tif (!$http_responder) {\n\t\t\tthrow new BadRequestException($method.'failed: '.$http_responder['reasonPhrase']);\n\t\t}\n\t\t\n\t\t$responder = explode('&', $http_responder);\n\t\t$parsed_response = array();\n\t\t\n\t\tforeach($responder as $response) {\n\t\t\t$response_array = explode('=', $response);\n\t\t\tif (count($response_array) >= 1)\n\t\t\t\t$parsed_response[$response_array[0]] = urldecode($response_array[1]);\n\t\t}\n\t\t\n\t\tif ((count($parsed_response) < 1) || !array_key_exists('ACK', $parsed_response))\n\t\t\tthrow new BadRequestException('Invalid HTTP Response for POST request ('.$required_nvp.$nvp.') to '.Configure::read('Paypal.endpoint'));\n\t\t\n\t\treturn $parsed_response;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\n\t\n\t\t// Set up your API credentials, PayPal end point, and API version.\n\t\t$API_UserName = urlencode('eshop_1309605309_biz_api1.gmail.com');\n\t\t$API_Password = urlencode('1309605353');\n\t\t$API_Signature = urlencode('AiPC9BjkCyDFQXbSkoZcgqH3hpacA4TlLrMdwUVOcGq8BK4tNk9Rdji5');\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t\t\n\t\t$version = urlencode('51.0');\n\t\n\t\t// Set the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t// Turn off the server and peer verification (TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\n\t\t// Set the API operation, version, and API signature in the request.\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\t\t// Set the request as a POST FIELD for curl.\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\n\t\t// Get response from the server.\n\t\t$httpResponse = curl_exec($ch);\n\t\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\t\n\t\t// Extract the response details.\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\t\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\t\n\t\treturn $httpParsedResponseAr;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "public function getPayPalResponse(){\r\n\t\t\r\n\t}", "function PPHttpPost($methodName_, $nvpStr_, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode) {\n $API_UserName = urlencode($PayPalApiUsername);\n $API_Password = urlencode($PayPalApiPassword);\n $API_Signature = urlencode($PayPalApiSignature);\n\n $paypalmode = ($PayPalMode == 'sandbox') ? '.sandbox' : '';\n\n $API_Endpoint = \"https://api-3t\" . $paypalmode . \".paypal.com/nvp\";\n $version = urlencode('109.0');\n\n // Set the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // Turn off the server and peer verification (TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n // Set the API operation, version, and API signature in the request.\n $nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n // Set the request as a POST FIELD for curl.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Get response from the server.\n $httpResponse = curl_exec($ch);\n\n if (!$httpResponse) {\n exit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n }\n\n // Extract the response details.\n $httpResponseAr = explode(\"&\", $httpResponse);\n\n $httpParsedResponseAr = array();\n foreach ($httpResponseAr as $i => $value) {\n $tmpAr = explode(\"=\", $value);\n if (sizeof($tmpAr) > 1) {\n $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n }\n }\n\n if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n exit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n }\n\n return $httpParsedResponseAr;\n }", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "function buy_sell($pairing_id,$amount,$rate,$type){\n\tif($ch = curl_init ()){\n\t\t$data['pairing'] = $pairing_id;//btc/thb\n\t\t$data['amount'] = $amount;\n\t\t$data['rate'] = $rate;\n\t\t$data['type'] = $type;\n\t\t$data['key'] = 'xxx';\n\t\t$mt = explode(' ', microtime());\n\t\t$nonce = $mt[1].substr($mt[0], 2, 6);\n\t\t$data['nonce'] = $nonce;\n\t\t$data['signature'] = hash('sha256', 'xxx'.$nonce.'xxx');\n\t\t// if($this->twofa != ''){\n\t\t\t// $data['twofa'] = $this->twofa;\n\t\t// }\n\t\t\n\t\tcurl_setopt ( $ch, CURLOPT_URL, 'https://bx.in.th/api/order/');\n\t\tcurl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false ); \n\t\tcurl_setopt ( $ch, CURLOPT_POST, count($data));\n\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS,$data);\n\t\t\n\t\t$str = curl_exec ( $ch );\n\t\n\t\tcurl_close ( $ch );\n\t\t\n\t\t$str = json_decode($str);\n\t\n\t\treturn $str;\n\n\t}\n\n}", "public function verify($params = array())\r\n {\r\n $returnURL = \"http://localhost\"; \r\n $cancelURL = \"http://localhost\"; \r\n $currencyCode = \"USD\";\r\n $startingDate = \"2011-02-24T13:00:00\"; \r\n $endingDate = \"2011-02-28T13:00:00\"; \r\n $maxTotalAmountOfAllPayments = \"2000\"; \r\n $senderEmail = \"\"; \r\n $maxNumberOfPayments = \"\"; \r\n // NO_PERIOD_SPECIFIED\r\n // DAILY - each day\r\n // WEEKLY - each week\r\n // BIWEEKLY - every other week\r\n // SEMIMONTHLY - twice a month\r\n // MONTHLY - each month\r\n // ANNUALLY - each year \r\n $paymentPeriod = \"\"; \r\n \r\n $dateOfMonth = \"\"; \r\n $dayOfWeek = \"\";\r\n $maxAmountPerPayment = \"\"; \r\n $maxNumberOfPaymentsPerPeriod = \"\"; \r\n $pinType = \"\"; \r\n $resArray = $this->CallPreapproval ($returnURL, $cancelURL, $currencyCode, $startingDate, $endingDate, $maxTotalAmountOfAllPayments,\r\n $senderEmail, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, $dayOfWeek,\r\n $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType\r\n );\r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n if($ack==\"SUCCESS\")\r\n {\r\n $this->preapprovalKey = $resArray[\"preapprovalKey\"];\r\n $cmd = \"cmd=_ap-preapproval&preapprovalkey=\" . urldecode($resArray[\"preapprovalKey\"]);\r\n $this->Redirect( $cmd );\r\n //return $resArray[\"preapprovalKey\"];\r\n } \r\n else \r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('verify Error : '. $this->errors);\r\n return false;\r\n }\r\n }", "function _query($methodName) {\n \t// Set up your API credentials, PayPal end point, and API version.\n\t\t$API_UserName = urlencode($this->userName);\n\t\t$API_Password = urlencode($this->password);\n\t\t$API_Signature = urlencode($this->signature);\n\t\t\t\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\t\t\n\t\tif(\"sandbox\" === $this->environment || \"beta-sandbox\" === $this->environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$this->environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\t\n\t\t// Set the API operation, version, and API signature in the request.\n\t\t$this->nvpreq = \"METHOD=$methodName&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$this->nvpStr\";\n\t\t\n\t\t//call the web service\n\t\t$response = $this->Http->post($API_Endpoint, $this->nvpreq);\n\t\t\t\n\t\tif(!$response) {\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Extract the response details.\n\t\t$httpResponseAr = explode(\"&\", $response);\n\t\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\t\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $httpParsedResponseAr;\t\t\n }", "function parse_authorize_payment_response($response) {\n // check total length\n if (sizeof($response)<51){\n return result_response_parse_error('response length error :' . sizeof($response));\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_AUTHORIZE_PAYMENT) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,47);\n $checksum = calc_checksum(CMD_AUTHORIZE_PAYMENT,$data);\n if ($checksum!=$response[49]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[50]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array();\n // get ticket\n $ticket_data = array_slice($data,0,8);\n $rdata['ticket'] = bytes_to_string($ticket_data);\n // get receipt\n $receipt_data = array_slice($data,8,10);\n $rdata['receipt'] = bytes_to_string($receipt_data);\n // value, as parking fee, in sen\n $value_data = array_slice($data,18,6);\n $rdata['value'] = intval(bytes_to_string($value_data));\n // gst, as parking fee gst\n $gst_data = array_slice($data,24,4);\n $rdata['gst'] = intval(bytes_to_string($gst_data));\n // pdate, as payment datatime\n $pdate_data = array_slice($data,28,12);\n $rdata['pdate'] = bytes_to_string($pdate_data);\n // grace period,\n $grace_data = array_slice($data,40,3);\n $rdata['grace'] = intval(bytes_to_string($grace_data));\n // status\n $statu_data = array_slice($data,43,4);\n $rdata['status'] = bytes_to_string($statu_data);\n return result_success_data($rdata);\n}", "public function pay(): JsonResponse;", "function getHashes($txnid, $amount, $productinfo, $firstname, $email, $user_credentials, $udf1, $udf2, $udf3, $udf4, $udf5,$cardBin)\r\n{\r\n $key = 'uWnwLgWB';\r\n $salt = 'JEoXThKDZm';\r\n\r\n $payhash_str = $key . '|' . checkNull($txnid) . '|' .checkNull($amount) . '|' .checkNull($productinfo) . '|' . checkNull($firstname) . '|' . checkNull($email) . '|' . checkNull($udf1) . '|' . checkNull($udf2) . '|' . checkNull($udf3) . '|' . checkNull($udf4) . '|' . checkNull($udf5) . '||||||' . $salt;\r\n $paymentHash = strtolower(hash('sha512', $payhash_str));\r\n $arr['payment_hash'] = $paymentHash;\r\n\r\n $cmnNameMerchantCodes = 'get_merchant_ibibo_codes';\r\n $merchantCodesHash_str = $key . '|' . $cmnNameMerchantCodes . '|default|' . $salt ;\r\n $merchantCodesHash = strtolower(hash('sha512', $merchantCodesHash_str));\r\n $arr['get_merchant_ibibo_codes_hash'] = $merchantCodesHash;\r\n\r\n $cmnMobileSdk = 'vas_for_mobile_sdk';\r\n $mobileSdk_str = $key . '|' . $cmnMobileSdk . '|default|' . $salt;\r\n $mobileSdk = strtolower(hash('sha512', $mobileSdk_str));\r\n $arr['vas_for_mobile_sdk_hash'] = $mobileSdk;\r\n\r\n\r\n\r\n $cmnPaymentRelatedDetailsForMobileSdk1 = 'payment_related_details_for_mobile_sdk';\r\n $detailsForMobileSdk_str1 = $key . '|' . $cmnPaymentRelatedDetailsForMobileSdk1 . '|default|' . $salt ;\r\n $detailsForMobileSdk1 = strtolower(hash('sha512', $detailsForMobileSdk_str1));\r\n $arr['payment_related_details_for_mobile_sdk_hash'] = $detailsForMobileSdk1;\r\n\r\n //used for verifying payment(optional)\r\n $cmnVerifyPayment = 'verify_payment';\r\n $verifyPayment_str = $key . '|' . $cmnVerifyPayment . '|'.$txnid .'|' . $salt;\r\n $verifyPayment = strtolower(hash('sha512', $verifyPayment_str));\r\n $arr['verify_payment_hash'] = $verifyPayment;\r\n return $arr;\r\n}", "public function webhook()\n {\n $bodyReceived = file_get_contents('php://input');\n\n // Receive HTTP headers that you received from PayPal webhook.\n $headers = getallheaders();\n\n /**\n * Uppercase all the headers for consistency\n */\n $headers = array_change_key_case($headers, CASE_UPPER);\n\n $signatureVerification = new \\PayPal\\Api\\VerifyWebhookSignature();\n $signatureVerification->setWebhookId(env('PAYPAL_WEBHOOK_ID'));\n $signatureVerification->setAuthAlgo($headers['PAYPAL-AUTH-ALGO']);\n $signatureVerification->setTransmissionId($headers['PAYPAL-TRANSMISSION-ID']);\n $signatureVerification->setCertUrl($headers['PAYPAL-CERT-URL']);\n $signatureVerification->setTransmissionSig($headers['PAYPAL-TRANSMISSION-SIG']);\n $signatureVerification->setTransmissionTime($headers['PAYPAL-TRANSMISSION-TIME']);\n\n $webhookEvent = new \\PayPal\\Api\\WebhookEvent();\n $webhookEvent->fromJson($bodyReceived);\n $signatureVerification->setWebhookEvent($webhookEvent);\n $request = clone $signatureVerification;\n\n try {\n $output = $signatureVerification->post($this->apiContext);\n } catch(\\Exception $ex) {\n print_r($ex->getMessage());\n exit(1);\n }\n\n $verificationStatus = $output->getVerificationStatus();\n $responseArray = json_decode($request->toJSON(), true);\n\n $event = $responseArray['webhook_event']['event_type'];\n\n if ($verificationStatus == 'SUCCESS')\n {\n switch($event)\n {\n case 'BILLING.SUBSCRIPTION.CANCELLED':\n case 'BILLING.SUBSCRIPTION.SUSPENDED':\n case 'BILLING.SUBSCRIPTION.EXPIRED':\n case 'BILLING_AGREEMENTS.AGREEMENT.CANCELLED':\n\n // $user = User::where('payer_id',$responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'])->first();\n $this->updateStatus($responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'], 0);\n break;\n }\n }\n echo $verificationStatus;\n exit(0);\n }", "protected function Paypal_PPHttpPost($methodName_, $version_, $nvpStr_) \n\t\t{\n\t\t\t//simulator error return form paypal\n\t\t\t\n\t\t\t \t\t\t\t\t\n\t\t\t\n\t\t\t$version = urlencode($version_);\n\n\t\t\t// Set the curl parameters.\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $this->apiEndpoint);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t\t// Turn off the server and peer verification (TrustManager Concept).\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t\t// Set the API operation, version, and API signature in the request.\n\t\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=\".$this->apiPassword.\"&USER=\".$this->apiUsername.\"&SIGNATURE=\".$this->apiSignature.\"$nvpStr_\";\n\t\t\t//echo '<p>'.$nvpreq.'</p';\n\n\t\t\t// Set the request as a POST FIELD for curl.\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t\t\t// Get response from the server.\n\t\t\t$httpResponse = curl_exec($ch);\n\n\t\t\tif(!$httpResponse) \n\t\t\t{\n\t\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t\t}\n\n\t\t\t// Extract the response details.\n\t\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t\t\t\n\t\t\t\n\n\t\t\t$httpParsedResponseAr = array();\n\t\t\tforeach ($httpResponseAr as $i => $value) \n\t\t\t{\n\t\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\t\tif(sizeof($tmpAr) > 1) \n\t\t\t\t{\n\t\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to \".$this->apiEndpoint.\".\");\n\t\t\t}\n\n\t\t\treturn $httpParsedResponseAr;\n\t\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 }", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "public function actionResult()\n {\n require_once($_SERVER[\"DOCUMENT_ROOT\"].'/protected/vendors/YamSDK/lib/YandexMoney.php');\n require_once($_SERVER[\"DOCUMENT_ROOT\"].'/protected/vendors/YamSDK/sample/consts.php');\n\n // Получаем данные запроса POST\n $request = Yii::app()->request;\n $notification_type = $request->getPost('notification_type');\n $operation_id = $request->getPost('operation_id');\n $amount = $request->getPost('amount');\n $currency = $request->getPost('currency');\n $datetime = $request->getPost('datetime');\n $sender = $request->getPost('sender');\n $codepro = $request->getPost('codepro');\n $label = $request->getPost('label');\n $sha1_hash = $request->getPost('sha1_hash');\n\n // Создаем хэш из параметров запроса\n $post_hash = $notification_type . '&' .\n $operation_id . '&' .\n $amount . '&' .\n $currency . '&' .\n $datetime . '&' .\n $sender . '&' .\n $codepro . '&o1ljMd6qDA4GcEYS+U0s2k0v&' .\n $label;\n\n // Если счет не защищен протекцией, обрабатываем его автоматически\n if($codepro == 'false')\n {\n // Сравниваем хеши\n if(sha1($post_hash) == $sha1_hash)\n {\n $yandexMoneyAdapter = new YandexMoney(CLIENT_ID);\n\n $token = '410012058541159.CE6633B7C444639FD2019F3E853B7DE7339E9F20039AC97744991C17500955408B7FBF730EB75CE7FBE724C73F2B05AA8FB4672F5720244ABDC021DD3D93066D851B13BA09C7FB7600E63ACC5A0425CF55800481D7C3225873B70ED994C3F4A45A6E2D66B3ED6380984D023C147EB36370D09F691A54679C81D8D0F2F6D365D1';\n $resp = $yandexMoneyAdapter->operationDetail($token, $operation_id);\n\n // Получаем ответ от сервера\n if($resp->isSuccess())\n {\n // Вытаскиваем номер счета из комментария платежа\n preg_match('/#(\\d+)\\s/', $resp->getMessage(), $m);\n $bill_id = intval($m[1]);\n\n // Если счет существует\n if($bill_id > 0)\n {\n // Вызов модуля\n Yii::app()->getModule('order');\n\n // Валидация платежа\n $order = Orders::model()->findByPk($bill_id);\n\n if ($order !== null)\n {\n // Вытаскиваем сумму\n $yam_amount = round($amount+($order->price*0.005)); // Яндекс возвращает минус комиссия. Добавляем ее для сверки\n\n if ($yam_amount==$order->price)\n {\n // Пополняем баланс пользователя\n $payment = Logpayment::model()->find('order_id=:order_id',array(':order_id'=>$bill_id));\n if ($payment !== null && $payment->state != 'S')\n {\n // Обновляем статус платежа в таблице Orders\n $order->status = 'PAYED';\n $order->timestamp = new CDbExpression('NOW()');\n $order->save();\n\n // Меняем статус на выполненный в логе\n $payment->lmi_payer_purse = $sender;\n $payment->lmi_sys_payment_id = $operation_id;\n $payment->state = 'S';\n $payment->save();\n\n // Отправляем уведомление пользователю об оплате заказа\n UMail::userSendEmail($order->user_id, 'user_payed_order', array(\n 'order_id'=>$order->id\n )\n );\n\n // Отправляем уведомление менеджерам об оплате заказа\n UMail::salesSendEmail('sales_new_order', array(\n 'order_id'=>$order->id\n )\n );\n }\n }\n }\n }\n }\n }\n }\n }", "public function verifyResponseUrl($url_params = [])\n {\n if(empty($url_params['checksum'])){\n echo \"invalid parameters: checksum is missing\";\n return ['success' => false, 'order_id' => '', 'transaction_id' => '', 'payment_amount' => 0, 'message' => 'Invalid parameters: checksum is missing.'];\n }\n\n $checksum = $url_params['checksum'];\n unset($url_params['checksum']);\n\n ksort($url_params);\n\n if(strcasecmp($checksum,hash_hmac('SHA1',implode('',$url_params), $this->secure_pass))===0)\n return ['success' => true, 'order_id' => $url_params['order_id'], 'transaction_id' => $url_params['transaction_id'], 'payment_amount' => (int)$url_params['total_amount'], 'net_amount' => $url_params['net_amount']];\n else\n return ['success' => false, 'order_id' => '', 'transaction_id' => '', 'payment_amount' => 0, 'message' => 'Checksum failed.'];\n }", "public function finalize( $call_result, $params )\n {\n $return_arr = self::default_finalize_result();\n\n if( !($call_result = S2P_SDK_Rest_API::validate_call_result( $call_result ))\n or empty( $call_result['response']['func'] ) )\n return $return_arr;\n\n switch( $call_result['response']['func'] )\n {\n case self::FUNC_METHOD_DETAILS:\n if( !empty( $call_result['response']['response_array']['method'] ) )\n {\n $return_arr['custom_validators'] = array();\n $return_arr['custom_validators']['payment'] = array();\n $return_arr['custom_validators']['recurrent'] = array();\n\n $pay_request_obj = new S2P_SDK_Structure_Payment_Request();\n $variable_obj = new S2P_SDK_Scope_Variable( $pay_request_obj->get_definition() );\n\n $payment_request_arr = $variable_obj->nullify( null, array( 'check_external_names' => false, 'nullify_full_object' => true ) );\n\n $we_have_validators = false;\n if( !empty( $call_result['response']['response_array']['method']['validatorspayin'] )\n and is_array( $call_result['response']['response_array']['method']['validatorspayin'] ) )\n {\n $custom_validators = array();\n foreach( $call_result['response']['response_array']['method']['validatorspayin'] as $validator_arr )\n {\n if( ($custom_validator = self::extract_method_validator( $validator_arr, $payment_request_arr )) )\n {\n if( !($transform_result = $variable_obj->transform_keys( array( 'Payment' => $custom_validator['sources'] ), null, array( 'check_external_names' => true ) ))\n or !is_array( $transform_result )\n or empty( $transform_result['payment'] ) or !is_array( $transform_result['payment'] ) )\n continue;\n\n $custom_validator['sources'] = $transform_result['payment'];\n\n $custom_validators[] = $custom_validator;\n }\n }\n\n if( !empty( $custom_validators ) )\n {\n $return_arr['custom_validators']['payment'] = $custom_validators;\n $we_have_validators = true;\n }\n }\n\n if( !empty( $call_result['response']['response_array']['method']['validatorsrecurrent'] )\n and is_array( $call_result['response']['response_array']['method']['validatorsrecurrent'] ) )\n {\n $custom_validators = array();\n foreach( $call_result['response']['response_array']['method']['validatorsrecurrent'] as $validator_arr )\n {\n if( ($custom_validator = self::extract_method_validator( $validator_arr, $payment_request_arr )) )\n {\n if( !($transform_result = $variable_obj->transform_keys( array( 'Payment' => $custom_validator['sources'] ), null, array( 'check_external_names' => true ) ))\n or !is_array( $transform_result )\n or empty( $transform_result['payment'] ) or !is_array( $transform_result['payment'] ) )\n continue;\n\n $custom_validator['sources'] = $transform_result['payment'];\n\n $custom_validators[] = $custom_validator;\n }\n }\n\n if( !empty( $custom_validators ) )\n {\n $return_arr['custom_validators']['recurrent'] = $custom_validators;\n $we_have_validators = true;\n }\n }\n\n if( empty( $we_have_validators ) )\n $return_arr['custom_validators'] = false;\n }\n break;\n }\n\n return $return_arr;\n }", "function makePayment($arr) {\n\t$accessToken = \"eYgzn2wfvScb1aIf3QLs\";\n\t$merchantNumber = \"T511564901\";\n\t$secretToken = \"1qcvgmCNmSvP1ikAG38uSoAPr7ePByuMcWuMWKsa\";\n\n\t$apiKey = base64_encode(\n\t\t$accessToken . \"@\" . $merchantNumber . \":\" . $secretToken\n\t);\n\n\t$checkoutUrl = \"https://api.v1.checkout.bambora.com/sessions\";\n\n\t$request = array();\n\t$request[\"order\"] = array();\n\t$request[\"order\"][\"id\"] = $arr['orderID'];\n\t$request[\"order\"][\"amount\"] = $arr['amount'];\n\t$request[\"order\"][\"currency\"] = \"NOK\";\n\n\t$request[\"url\"] = array();\n\t$request[\"url\"][\"accept\"] = $arr['acceptURL'];\n\t$request[\"url\"][\"cancel\"] = $arr['cancelURL'];\n\t$request[\"url\"][\"callbacks\"] = array();\n\t$request[\"url\"][\"callbacks\"][] = array(\"url\" => $arr['callbackURL']);\n\n\t$requestJson = json_encode($request);\n\n\t$contentLength = isset($requestJson) ? strlen($requestJson) : 0;\n\n\t$headers = array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . $contentLength,\n\t\t'Accept: application/json',\n\t\t'Authorization: Basic ' . $apiKey\n\t);\n\n\t$curl = curl_init();\n\n\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $requestJson);\n\tcurl_setopt($curl, CURLOPT_URL, $checkoutUrl);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($curl, CURLOPT_FAILONERROR, false);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$rawResponse = curl_exec($curl);\n\t$response = json_decode($rawResponse);\n\t\n\treturn $response;\n}", "abstract function getPairsFromAPI();", "function execute_payment($access_token, $payerId, $paymentID) {\n\n global $host;\n $url = $host.'/v1/payments/payment/'.$paymentID.'/execute/';\n\n $postdata= '{\"payer_id\" : \"'.$payerId.'\"}';\n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n $info = curl_getinfo($curl);\n curl_close($curl); \n\n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n return $response;\n }\n\n }\n\n return $response;\n\n}", "public function callback(){\n $data = Rave::verifyTransaction(request()->txref);\n dd($data); // view the data response\n if ($data->status == 'success') {\n if(session()->get($this->requestVar)['']['page_type'] == 'cart'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n } \n \n \n \n //Payment from basket checkout page\n \n if(session()->get($this->requestVar)['']['page_type'] == 'basket'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n \n }\n \n }\n }", "public function actionCheck($param)\n {\n\n /*$json = json_decode($data);\n echo $json->tls_version.'<br />';\n //$curl_info = curl_version();\n //echo $curl_info['ssl_version'];\n printf(\"0x%x\\n\", OPENSSL_VERSION_NUMBER);*/\n\n define(\"LOG_FILE\", __DIR__.\"/Paypal.log\");\n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode ('=', $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n $req = 'cmd=_notify-validate';\n if(function_exists('get_magic_quotes_gpc')) {\n \t$get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n \t$value = $get_magic_quotes_exists && get_magic_quotes_gpc() == 1\n ? urlencode(stripslashes($value))\n : urlencode($value);\n $req .= \"&$key=$value\";\n }\n $paypal_url = $this->settings->paypal_demo ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';\n $ch = curl_init($paypal_url);\n if ($ch == false) {\n \tdie('no curl init');\n }\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSLVERSION, 6);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n $res = curl_exec($ch);\n if (curl_errno($ch) != 0) {\n $error = curl_error($ch);\n \t//error_log(date('[Y-m-d H:i e] '). \"Can't connect to PayPal to validate IPN message: \" . $error . PHP_EOL, 3, LOG_FILE);\n \tcurl_close($ch);\n \tdie($error);\n } else {\n\t\tif(DEBUG == true) {\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL, 3, LOG_FILE);\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP response of validation request: $res\" . PHP_EOL, 3, LOG_FILE);\n\t\t}\n\t\tcurl_close($ch);\n }\n $tokens = explode(\"\\r\\n\\r\\n\", trim($res));\n $res = trim(end($tokens));\n if (strcmp($res, \"VERIFIED\") == 0) {\n if($param->receiver_email == '' || $param->receiver_email != $this->settings->paypal_email\n || !$param->Exists('item_number', true) || $param->mc_currency != 'USD') {\n //error_log('Error 1'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n $this->_table->current = $param->item_number;\n if($this->_table->id != $param->item_number || $this->_table->status != 0\n || (float)$param->mc_gross != (float)$this->_table->sum) {\n //error_log('Error 2'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n if(strtolower($param->payment_status) == 'completed') {\n $this->_table->status = 2;\n $this->_table->message = $param->txn_id;\n $this->_table->date_payed = date(\"Y-m-d H:m:i\");\n $this->_table->Save();\n //error_log(date('[Y-m-d H:i e] '). \"Verified IPN: $req \". PHP_EOL, 3, LOG_FILE);\n die('ok');\n } else {\n //error_log(date('[Y-m-d H:i e] '). \"Status: \".$param->payment_status.PHP_EOL, 3, LOG_FILE);\n }\n } else if (strcmp ($res, \"INVALID\") == 0) {\n \t//error_log(date('[Y-m-d H:i e] '). \"Invalid IPN: $req\" . PHP_EOL, 3, LOG_FILE);\n }\n die('error');\n }", "function spgateway_credit_refund($params) {\n\n $amount = $params['amount']; # Format: ##.##\n $TotalAmount = round($amount);\n $transid = $params['transid'];\n\n # 是否為測試模式\n $posturl = ($params['testMode']==\"on\") ? 'https://ccore.spgateway.com/MPG/mpg_gateway'\n : 'https://core.spgateway.com/MPG/mpg_gateway' ;\n\n // post data\n $PostData = http_build_query(\n array( 'RespondType' => 'String',\n 'Version' => '1.0',\n 'Amt' => $TotalAmount,\n 'TradeNo' => $transid,\n 'TimeStamp' => time(),\n 'IndexType' => '2',\n 'CloseType' => '2'\n ));\n $PostData = trim(\n bin2hex(\n mcrypt_encrypt( MCRYPT_RIJNDAEL_128,\n $params['HashKey'],\n spgateway_credit_addpadding($PostData),\n MCRYPT_MODE_CBC,\n $params['HashIV'])\n )\n );\n\n // post\n $post = array( 'MerchantID_' => $params['MerchantID'],\n 'PostData_' => $PostData);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $posturl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n if ($params['testMode']=='on') curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!\n $result = curl_exec($ch);\n curl_close($ch);\n\n parse_str(trim($result),$result);\n\n switch($result['Status']){\n case 'SUCCESS':\n case 'TRA10045':\n return array('status'=>'success', 'rawdata'=>$result, 'transid'=>$result['TradeNo'], 'fees'=>0);\n case 'TRA10058':\n case 'TRA10675':\n case 'TRA10013':\n case 'TRA10035':\n return array('status'=>'declined', 'rawdata'=>$result);\n default:\n return array('status'=>'error', 'rawdata'=>$result);\n }\n}", "public function verify() {\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->library( 'encryption' );\n\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t$forbidden\t\t\t= array( 'route', 'hash', 'email_sender', 'email_recipient' );\n\t\t$retData\t\t\t= array();\n\t\t$securityCriteria\t= 0; // integer!\n\t\t$project_id\t\t\t= '0';\n\t\t$err\t\t\t\t= false;\n\n\t\t// filter variables\n\t\tforeach( $this->request->post as $key => $value) {\n\t\t\tif( !in_array( $key, $forbidden ) ) {\n\t\t\t\t$retData[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\n\t\t\t// get value of security_criteria\n\t\t\tif( $key == 'security_criteria' ) {\n\t\t\t\t$securityCriteria = $value;\n\t\t\t}\n\n\t\t\t// decrypt order_id\n\t\t\tif( $key == 'user_variable_3' ) {\n\t\t\t\t$order_id = $encryption->decrypt( $value );\n\t\t\t}\n\n\t\t\t// get hash value\n\t\t\tif( $key == 'hash' ) {\n\t\t\t\t$this->hashValue = $value;\n\t\t\t}\n\n\t\t\t// get project id\n\t\t\tif( $key == 'project_id' ) {\n\t\t\t\t$project_id = $value;\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo '## FUNCTION verify' . \"\\n\";\n\t\t\techo '## calling getNotifyHash:' . \"\\n\";\n\t\t}\n\n\t\t// calculate hash value\n\t\t$hash = $this->getNotifyHash( $retData );\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo \"\\n\" . '## $_POST data from directebanking:' . \"\\n\";\n\t\t\tprint_r( $_POST ) . \"\\n\";\n\t\t\techo 'retData (cleaned POST for calculating hash):' . \"\\n\";\n\t\t\tprint_r( $retData );\n\t\t\techo \"\\n\";\n\n\t\t\techo '--> submitted hash [' . $this->hashValue . ']' . \"\\n\";\n\t\t\techo '--> calculated hash [' . $hash . ']' . \"\\n\";\n\t\t\techo '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']' . \"\\n\";\n\n\t\t\t// write also log entry\n\t\t\t$msg = '## $_POST data from directebanking:<br />'\n\t\t\t. print_r( $_POST, true )\n\t\t\t. '<br />retData (cleaned POST for calculating hash):<br />'\n\t\t\t. print_r( $retData, true )\n\t\t\t. '<br />--> submitted hash [' . $this->hashValue . ']<br />'\n\t\t\t. '--> calculated hash [' . $hash . ']<br />'\n\t\t\t. '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']<br />'\n\t\t\t. '~~~~~~~~~~~~~~~~~~~~~~';\n\n\t\t\t$this->writeLog( $msg );\n\t\t}\n\n\t\t$comment = $this->_param['testMode'] ? $this->language->get( 'text_testOrder') : '';\n\n\t\t// check generated and submitted hash values\n\t\tif( $hash === $this->hashValue ) {\n\t\t\tif( $securityCriteria == 1 && $order_id ) {\n\t\t\t\t// order is okay, set order to predefined directebanking status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'directebanking_order_status_id'),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_okay'), $project_id );\n\t\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_valid'), $project_id, $order_id );\n\t\t\t\t$type\t= 2;\n\t\t\t}else{\n\t\t\t\t// order is not okay, set order to predefined config status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'config_order_status_id' ),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_security_invalid'), $project_id, $order_id );\n\t\t\t\t$msg\t= $msgDb;\n\t\t\t\t$type\t= 3;\n\t\t\t}\n\t\t}else{\n\t\t\t// order is not okay, set order to predefined config status\n\t\t\t$this->model_checkout_order->confirm( $order_id, $this->config->get( 'config_order_status_id' ), $comment );\n\n\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_notokay'), $project_id );\n\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_hash_dif'), $project_id, $order_id );\n\t\t\t$type\t= 3;\n\t\t}\n\n\t\t// write log\n\t\t$this->writeLog( $msg, $type );\n\t\t// echo message at directebanking\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo $msgDb . \"\\n\";\n\t\t}\n\t}", "static function STKPush_processrequest($timestamp, $account_ref, $transaction_desc, $amount, $phone_number, $callbackurl)\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/mpesa/stkpush/v1/processrequest';\n\n $access_token = self::generate_access_token();\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:Bearer ' . $access_token)); //setting custom header\n\n $curl_post_data = array(\n //Fill in the request parameters with valid values\n 'BusinessShortCode' => self::$business_shortcode,\n 'Password' => self::generate_mpesa_password($timestamp),\n 'Timestamp' => $timestamp,\n 'TransactionType' => 'CustomerPayBillOnline',\n 'Amount' => $amount,\n 'PartyA' => $phone_number,\n 'PartyB' => self::$business_shortcode,\n 'PhoneNumber' => $phone_number,\n 'CallBackURL' => $callbackurl,\n 'AccountReference' => $account_ref,\n 'TransactionDesc' => $transaction_desc\n );\n\n Log::debug('Request Body',['body'=>$curl_post_data]);\n\n $data_string = json_encode($curl_post_data);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n if (config('app.env') === 'local') {\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n }\n $curl_response = curl_exec($curl);\n if (config('app.env') === 'local') Log::info($curl_response);\n return json_decode($curl_response);\n }", "public function paypal(Request $request)\n {\nrequire 'vendor/autoload.php';\n\n$apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AedIVbiADiRsvL3jFM6Z6Kcx5wSgwyBIMJFFQq0UFcBfrew-mhHGMZVpqWJhvQGbn-HkUpt5F023HH4n',\n 'EIs32ISB07N21Ey0z2a4Qthy5Obo173s1wD9Yx9hhiYJoC2bxdnNJVLpb2MvnT5QTYK74RBMg84FvPd4'\n )\n);\n\n return response()->json([\n 'message' => 'paypal route hit',\n 'request' => $request->all()\n ]);\n }", "public function CallPaymentDetails( $payKey, $transactionId, $trackingId )\r\n {\r\n $nvpstr = \"\";\r\n // conditionally required fields\r\n if (\"\" != $payKey)\r\n {\r\n $nvpstr = \"payKey=\" . urlencode($payKey);\r\n }\r\n elseif (\"\" != $transactionId)\r\n {\r\n $nvpstr = \"transactionId=\" . urlencode($transactionId);\r\n }\r\n elseif (\"\" != $trackingId)\r\n {\r\n $nvpstr = \"trackingId=\" . urlencode($trackingId);\r\n }\r\n /* Make the PaymentDetails call to PayPal */\r\n $resArray = $this->hash_call(\"PaymentDetails\", $nvpstr);\r\n /* Return the response array */\r\n return $resArray;\r\n }", "function sendData($api, $amount, $redirect, $factorNumber = null)\n{\n $data = \"api=$api&amount=$amount&redirect=$redirect&factorNumber=$factorNumber\";\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, \"https://pay.ir/payment/test/send\");\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n\n if ($response) {\n return json_decode($response, true);\n } else {\n return false;\n }\n\n}", "public function post()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'POST';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_POSTFIELDS, $this->getData());\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'POST::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'POST::DATA', $this->getData());\n Log::write('WebRequest', 'POST::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'POST::RESPONSE', $sOutput);\n\n $this->setData('');\n\n if (!in_array($iHTTPCode, [200, 201, 204])) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 200|201 on [POST] ' . $this->getApiRoot() . $this->getApiResource());\n }\n return $sOutput;\n }", "public function submitPayment()\n {\n return array('error'=>0, 'transactionReference'=>'');\n \n }", "public function payment_successful()\n {\n $user_id=$this->session->userdata('user_id');\n\n $status = $this->input->post(\"status\");\n $firstname = $this->input->post(\"firstname\");\n $amount = $this->input->post(\"amount\");\n $txnid = $this->input->post(\"txnid\");\n $posted_hash = $this->input->post(\"hash\");\n $key = $this->input->post(\"key\");\n $productinfo = $this->input->post(\"productinfo\");\n // $membership_package=$this->input->post('membership_package');\n $email = $this->input->post(\"email\");\n $salt = SALT;\n //echo $membership_package;die();\n\n\n if ($this->input->post(\"additionalCharges\")) {\n $additionalCharges = $this->input->post(\"additionalCharges\");\n $retHashSeq = $additionalCharges . '|' . $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n } else {\n\n $retHashSeq = $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n }\n $hash = hash(\"sha512\", $retHashSeq);\n\n if ($hash != $posted_hash) {\n $data['msg'] = \"Invalid Transaction. Please try again\";\n } else {\n \n //echo $user_id;die();\n // echo $status;\n // echo $txnid;\n // echo $amount;\n // echo $firstname;\n // echo $hash;die();\n //echo $membership_package;die();\n $data=array(\n 'user_id'=>$user_id,\n 'user_name'=>$firstname,\n 'status'=>$status,\n 'txnid'=>$txnid,\n 'amount'=>$amount,\n 'hash'=>$hash\n );\n\n //print_r($data);die();\n $path = base_url();\n $url = $path.'api/User_api/SavePayment';\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response_json = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($response_json, true);\n // print_r($response_json);die();\n $data['msg'] = \"<h3>Thank You. Your order status is \" . $status . \".</h3>\";\n $data['msg'] .= \"<h4>Your Transaction ID for this transaction is \" . $txnid . \".</h4>\";\n $data['msg'] .= \"<h4>We have received a payment of Rs. \" . $amount . \". Your order will soon be shipped.</h4>\";\n \n }\n $this->load->view('includes/header.php');\n $this->load->view('pages/profile/membership_view',$data);\n //$this->load->view('pages/payment/success.php',$data);\n $this->load->view('includes/footer.php');\n }", "function call($postfields) {\r\n\t\t$postfields[\"username\"] = $this->api_user;\r\n\t\t$postfields[\"password\"] = md5($this->api_pass);\r\n\r\n\t\t// Make curl request\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_url);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 100);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t// Format response\r\n\t\t$data = explode(\";\",$data);\r\n\t\tforeach ($data AS $temp) {\r\n\t\t $temp = explode(\"=\",$temp);\r\n\t\t $key = trim($temp[0]);\r\n\t\t $value = trim($temp[1]);\r\n\t\t $results[$key] = $value;\r\n\t\t}\r\n\t\t\r\n\t\t// Returns array with response\r\n\t\treturn $results;\r\n\t}", "public function getPayerAuthenticationResponse();", "function performPaymentInitialization() {\r\n\t\t;\r\n\t\t$request = \"\";\r\n\t\t$response = \"\";\r\n\t\t$requestbuffer;\r\n\t\t$xmlData = \"\";\r\n\t\t$hm;\r\n\t\ttry {\r\n\t\t\tif ($request != null) {\r\n\t\t\t\t$xmlData = $data;\r\n\t\t\t} else {\r\n\t\t\t\t$keyParser = new KeyStore ();\r\n\t\t\t\t$this->key = $keyParser->parseKeyStore ( $this->keystorePath );\r\n\t\t\t\t$xmlData = $this->parseResource ( $this->key, $this->resourcePath, $this->alias );\r\n\t\t\t}\r\n\t\t\tvar_dump ( $xmlData );\r\n\t\t\t\r\n\t\t\tif ($xmlData != null) {\r\n\t\t\t\t$hm = $this->parseXMLRequest ( $xmlData );\r\n\t\t\t} else {\r\n\t\t\t\t$error = \"Alias name does not exits\";\r\n\t\t\t}\r\n\t\t\tvar_dump ( $hm );\r\n\t\t\t$this->key = $hm ['resourceKey'];\r\n\t\t\t// echo $this->key;\r\n\t\t\t$requestbuffer = $this->buildHostRequest ();\r\n\t\t\t$requestbuffer .= \"id=\" . $hm [\"id\"] . \"&\";\r\n\t\t\t\r\n\t\t\t$requestbuffer .= 'password=' . $hm ['password'] . \"&\";\r\n\t\t\t$webaddr = $hm ['webaddress'];\r\n\t\t\t// echo \"<br><br><br><br>\" . $requestbuffer . \"<br><br><br>\";\r\n\t\t\t$request = $requestbuffer;\r\n\t\t\tvar_dump ( $request );\r\n\t\t\t// var_dump($request);\r\n\t\t\t// var_dump($webaddr);\r\n\t\t\t$pipe = new ipayTransactionPipe ();\r\n\t\t\t// echo \"<br/>REQUEST\" . $request;\r\n\t\t\t\r\n\t\t\t$response = $pipe->performHostedTransaction ( $request, $webaddr );\r\n\t\t\tVAR_DUMP ( $response );\r\n\t\t\t// System.out.println(\"response:::::::\" + response);\r\n\t\t\tif ($response == null) {\r\n\t\t\t\t// echo \"null\";\r\n\t\t\t\t$this->error = \"Error while connecting \" . $response;\r\n\t\t\t\treturn - 1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($response != null) {\r\n\t\t\t\t\t// echo \"not null\";\r\n\t\t\t\t\t$this->setpaymentId ( $response [0] );\r\n\t\t\t\t\t$this->setpaymentPage ( $response [1] );\r\n\t\t\t\t\t// $this->paymentPage = $response[1];\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\t\t\treturn - 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\t\r\n\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\treturn - 1;\r\n\t\t}\r\n\t}", "public function paypal_payouts($data=false)\n {\n global $environment;\n $paypal_credentials = PaymentGateway::where('site','PayPal')->get();\n $api_user = $paypal_credentials[1]->value;\n $api_pwd = $paypal_credentials[2]->value;\n $api_key = $paypal_credentials[3]->value;\n $paymode = $paypal_credentials[4]->value;\n \n $client = $paypal_credentials[6]->value;\n $secret = $paypal_credentials[7]->value;\n \n if($paymode == 'sandbox')\n $environment = 'sandbox';\n else\n $environment = '';\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/oauth2/token\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($ch, CURLOPT_USERPWD, $client.\":\".$secret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n\n $result = curl_exec($ch);\n $json = json_decode($result);\n if(!isset($json->error))\n {\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/payments/payouts?sync_mode=true\");\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\",\"Authorization: Bearer \".$json->access_token,\"\"));\n\n $result = curl_exec($ch);\n\n if(empty($result))\n {\n $json =\"error\";\n }\n else\n {\n $json = json_decode($result);\n }\n curl_close($ch);\n \n }\n else\n {\n $json =\"error\";\n \n }\n\n $payout_response = $json;\n $data = array();\n\n if($payout_response != \"error\") {\n if($payout_response->batch_header->batch_status==\"SUCCESS\") {\n if($payout_response->items[0]->transaction_status == 'SUCCESS') {\n $correlation_id = $payout_response->items[0]->transaction_id;\n $data['success'] = true;\n $data['transaction_id'] = $correlation_id;\n } \n else {\n $data['success'] = false;\n $data['message'] = $payout_response->items[0]->errors->name;\n }\n \n }\n else {\n $data['success'] = false;\n $data['message'] = $payout_response->name;\n }\n }\n else {\n $data['success'] = false;\n $data['message'] = 'Unknown error';\n }\n\n return $data;\n }", "public function makePayment () {\n \n // sent to bank for verification and transaction code\n \n srand(time());\t\t\t\t\n $pool = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#%&\";\n for($index = 0; $index < 20; $index++) {\n $sid .= substr($pool,(rand()%(strlen($pool))), 1);\n }\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n $error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t \n $data[\"transaction_code\"] = $sid;\n\n $data = json_encode($data);\n \n return $data; \n }", "public function execute(){\n\n $body = '{\"payer_id\":\"' . $this->payer_id . '\"}';\n $client = new Client();\n try{\n $paymentInfo = $client->request('POST', $this->execute_url, ['headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $body\n ]);\n }\n catch (\\Exception $ex) {\n $error = json_encode($ex->getMessage());\n return($error);\n }\n $this->parsePaymentBody($paymentInfo);\n return $this->paymentBody;\n\n }", "public static function doPayflow($nvp = array())\r\n\t {\r\n\t\t $nvp = self::arrayToStr($nvp);\r\n\r\n\t\t // initialize curl\r\n\t\t $curl = curl_init();\r\n\r\n\t\t // curl settings\r\n\t\t curl_setopt($curl , CURLOPT_HEADER , false);\r\n\t\t curl_setopt($curl , CURLOPT_POST , true);\r\n\t\t curl_setopt($curl , CURLOPT_RETURNTRANSFER , true);\r\n\t\t curl_setopt($curl , CURLOPT_SSL_VERIFYPEER , false);\r\n\t\t curl_setopt($curl , CURLOPT_TIMEOUT , self::TIMEOUT);\r\n\t\t curl_setopt($curl , CURLOPT_POSTFIELDS , $nvp);\r\n\t\t curl_setopt($curl , CURLOPT_PORT , self::HOST_PORT);\r\n\t\t curl_setopt($curl , CURLOPT_URL, self::HOST_ADDRESS);\r\n \r\n\t\t // if there are errors ,then throw exception\r\n\t\t if (curl_errno($curl) != 0)\r\n\t\t {\r\n\t\t\t throw new Exception('curl operation failed:'.curl_error($curl));\r\n\t\t }\r\n\r\n\t\t // execute curl\r\n\t\t $response = curl_exec($curl);\r\n \r\n\t\t // if execute failed , then throw exception\r\n\t\t if ($response === false)\r\n\t\t {\r\n\t\t\t throw new Exception('curl execute failed!');\r\n\t\t }\r\n\r\n\t\t // close curl\r\n\t\t curl_close($curl);\r\n \r\n\t\t // return \r\n\t\t return self::strToArray($response);\r\n\t }", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "public function api_call($cmd, $req = array()) {\n $public_key = config('coinpayment.public_key');\n $private_key = config('coinpayment.private_key');\n\n // Set the API command and required fields\n $req['version'] = 1;\n $req['cmd'] = $cmd;\n $req['key'] = $public_key;\n $req['format'] = 'json'; //supported values are json and xml\n\n // Generate the query string\n $post_data = http_build_query($req, '', '&');\n\n // Calculate the HMAC signature on the POST data\n $hmac = hash_hmac('sha512', $post_data, $private_key);\n\n // Create cURL handle and initialize (if needed)\n static $ch = NULL;\n if ($ch === NULL) {\n $ch = curl_init('https://www.coinpayments.net/api.php');\n curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('HMAC: '.$hmac));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n\n // Execute the call and close cURL handle\n $data = curl_exec($ch);\n // Parse and return data if successful.\n if ($data !== FALSE) {\n if (PHP_INT_SIZE < 8 && version_compare(PHP_VERSION, '5.4.0') >= 0) {\n // We are on 32-bit PHP, so use the bigint as string option. If you are using any API calls with Satoshis it is highly NOT recommended to use 32-bit PHP\n $dec = json_decode($data, TRUE, 512, JSON_BIGINT_AS_STRING);\n } else {\n $dec = json_decode($data, TRUE);\n }\n if ($dec !== NULL && count($dec)) {\n return $dec;\n } else {\n // If you are using PHP 5.5.0 or higher you can use json_last_error_msg() for a better error message\n return array('error' => 'Unable to parse JSON result ('.json_last_error().')');\n }\n } else {\n return array('error' => 'cURL error: '.curl_error($ch));\n }\n }", "public function CallRefund( $payKey, $transactionId, $trackingId, $receiverEmailArray, $receiverAmountArray )\r\n {\r\n /* Gather the information to make the Refund call.\r\n The variable nvpstr holds the name value pairs\r\n */\r\n \r\n $nvpstr = \"\";\r\n \r\n // conditionally required fields\r\n if (\"\" != $payKey)\r\n {\r\n $nvpstr = \"payKey=\" . urlencode($payKey);\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n elseif (\"\" != $trackingId)\r\n {\r\n $nvpstr = \"trackingId=\" . urlencode($trackingId);\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n elseif (\"\" != $transactionId)\r\n {\r\n $nvpstr = \"transactionId=\" . urlencode($transactionId);\r\n // the caller should only have 1 entry in the email and amount arrays\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* Make the Refund call to PayPal */\r\n $resArray = $this->hash_call(\"Refund\", $nvpstr);\r\n\r\n /* Return the response array */\r\n return $resArray;\r\n }", "public function submitPayment() {\n return array('error' => 0, 'transactionReference' => '');\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n\t\t\tglobal $gateway_environment;\n\t\t\t$environment = $gateway_environment;\n\n\t\t\t$API_UserName = pmpro_getOption(\"apiusername\");\n\t\t\t$API_Password = pmpro_getOption(\"apipassword\");\n\t\t\t$API_Signature = pmpro_getOption(\"apisignature\");\n\t\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t\t}\n\n\t\t\t$version = urlencode('72.0');\n\n\t\t\t//NVPRequest for submitting to server\n\t\t\t$nvpreq = \"METHOD=\" . urlencode($methodName_) . \"&VERSION=\" . urlencode($version) . \"&PWD=\" . urlencode($API_Password) . \"&USER=\" . urlencode($API_UserName) . \"&SIGNATURE=\" . urlencode($API_Signature) . \"&BUTTONSOURCE=\" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;\n\n\t\t\t//post to PayPal\n\t\t\t$response = wp_remote_post( $API_Endpoint, array(\n\t\t\t\t\t'timeout' => 60,\n\t\t\t\t\t'sslverify' => FALSE,\n\t\t\t\t\t'httpversion' => '1.1',\n\t\t\t\t\t'body' => $nvpreq\n\t\t\t )\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t $error_message = $response->get_error_message();\n\t\t\t die( \"methodName_ failed: $error_message\" );\n\t\t\t} else {\n\t\t\t\t//extract the response details\n\t\t\t\t$httpParsedResponseAr = array();\n\t\t\t\tparse_str(wp_remote_retrieve_body($response), $httpParsedResponseAr);\n\n\t\t\t\t//check for valid response\n\t\t\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $httpParsedResponseAr;\n\t\t}", "function qruqsp_core_printResponse($q, $hash) {\n\n if( !is_array($hash) ) {\n $rsp_hash = array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.25', 'msg'=>'Internal configuration error'));\n } else {\n $rsp_hash = $hash;\n }\n\n //\n // Currently only supporting JSON response format, more may be added in the future\n //\n header(\"Content-Type: text/plain; charset=utf-8\");\n header(\"Cache-Control: no-cache, must-revalidate\");\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'printHashToJSON');\n qruqsp_core_printHashToJSON($hash);\n}", "private function api_query() {\n if ($this->trackId == null) {\n return false;\n }\n $class[] = 'includes/checkout-php-library/autoload';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiclient';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Reportingservice';\n $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Requestmodels/Transactionfilter';\n\n foreach ($class as $path) {\n module_load_include('php', 'uc_checkoutpayment', $path);\n }\n\n $apiClient = new com\\checkout\\Apiclient(variable_get('cko_private_key'),variable_get('cko_mode'));\n $service = $apiClient->Reportingservice();\n\n $request = new com\\checkout\\Apiservices\\Reporting\\Requestmodels\\Transactionfilter();\n $request->setPageSize('100');\n $request->setSortColumn('date');\n $request->setFilters(\n array(\n \"action\" => \"include\",\n \"field\" => \"TrackID\",\n \"operator\" => \"EQUALS\",\n \"value\" => $this->trackId,\n )\n );\n\n $response = $service->queryTransaction($request);\n\n if (!empty($response)) {\n foreach ($response as $value) {\n $this->id = $value->id;\n $this->created = $value->created;\n $this->trackId = $value->track_id;\n $this->currency = $value->currency;\n $this->responseMessage = $value->responseMessage;\n $this->responseCode = $value->responseCode;\n $this->status = $value->status;\n $this->value = $data->value;\n $this->email = $data->email;\n\n $this->db_add();\n }\n\n return $this->db_get();\n }\n\n return FALSE;\n }", "function print_result()\n{\n global $pxpay;\n \n $enc_hex = $_REQUEST[\"result\"];\n #getResponse method in PxPay object returns PxPayResponse object\n #which encapsulates all the response data\n $rsp = $pxpay->getResponse($enc_hex);\n \n \n # the following are the fields available in the PxPayResponse object\n $Success = $rsp->getSuccess(); # =1 when request succeeds\n $AmountSettlement = $rsp->getAmountSettlement();\n $AuthCode = $rsp->getAuthCode(); # from bank\n $CardName = $rsp->getCardName(); # e.g. \"Visa\"\n $CardNumber = $rsp->getCardNumber(); # Truncated card number\n $DateExpiry = $rsp->getDateExpiry(); # in mmyy format\n $DpsBillingId = $rsp->getDpsBillingId();\n $BillingId \t = $rsp->getBillingId();\n $CardHolderName = $rsp->getCardHolderName();\n $DpsTxnRef\t = $rsp->getDpsTxnRef();\n $TxnType = $rsp->getTxnType();\n $TxnData1 = $rsp->getTxnData1();\n $TxnData2 = $rsp->getTxnData2();\n $TxnData3 = $rsp->getTxnData3();\n $CurrencySettlement= $rsp->getCurrencySettlement();\n $ClientInfo = $rsp->getClientInfo(); # The IP address of the user who submitted the transaction\n $TxnId = $rsp->getTxnId();\n $CurrencyInput = $rsp->getCurrencyInput();\n $EmailAddress = $rsp->getEmailAddress();\n $MerchantReference = $rsp->getMerchantReference();\n $ResponseText\t\t = $rsp->getResponseText();\n $TxnMac = $rsp->getTxnMac(); # An indication as to the uniqueness of a card used in relation to others\n $RecurringMode = $rsp->getRecurringMode();\n \n \n if ($rsp->getSuccess() == \"1\")\n {\n $result = \"The transaction was approved.\";\n \n\t\t# Sending invoices/updating order status within database etc.\n \n if (!isProcessed($TxnId))\n {\n \n \n }\n \n }\n else\n {\n $result = \"The transaction was declined.\";\n }\n print <<<HTMLEOF\n <html>\n <head>\n <title>Payment Express PxPay transaction result</title>\n </head>\n <body>\n <h1>Payment Express PxPay transaction result</h1>\n <p>$result</p>\n <table border=1>\n\t<tr><th>Name</th>\t\t\t\t<th>Value</th> </tr>\n\t<tr><td>Success</td>\t\t\t<td>$Success</td></tr>\n\t<tr><td>TxnType</td>\t\t\t<td>$TxnType</td></tr>\n\t<tr><td>CurrencyInput</td>\t\t<td>$CurrencyInput</td></tr>\n\t<tr><td>MerchantReference</td>\t<td>$MerchantReference</td></tr>\n\t<tr><td>TxnData1</td>\t\t\t<td>$TxnData1</td></tr>\n\t<tr><td>TxnData2</td>\t\t\t<td>$TxnData2</td></tr>\n\t<tr><td>TxnData3</td>\t\t\t<td>$TxnData3</td></tr>\n\t<tr><td>AuthCode</td>\t\t\t<td>$AuthCode</td></tr>\n\t<tr><td>CardName</td>\t\t\t<td>$CardName</td></tr>\n\t<tr><td>CardHolderName</td>\t\t<td>$CardHolderName</td></tr>\n\t<tr><td>CardNumber</td>\t\t\t<td>$CardNumber</td></tr>\n\t<tr><td>DateExpiry</td>\t\t\t<td>$DateExpiry</td></tr>\n\t<tr><td>ClientInfo</td>\t\t\t<td>$ClientInfo</td></tr>\n\t<tr><td>TxnId</td>\t\t\t\t<td>$TxnId</td></tr>\n\t<tr><td>EmailAddress</td>\t\t<td>$EmailAddress</td></tr>\n\t<tr><td>DpsTxnRef</td>\t\t\t<td>$DpsTxnRef</td></tr>\n\t<tr><td>BillingId</td>\t\t\t<td>$BillingId</td></tr>\n\t<tr><td>DpsBillingId</td>\t\t<td>$DpsBillingId</td></tr>\n\t<tr><td>AmountSettlement</td>\t<td>$AmountSettlement</td></tr>\n\t<tr><td>CurrencySettlement</td>\t<td>$CurrencySettlement</td></tr>\n\t<tr><td>TxnMac</td>\t\t\t\t<td>$TxnMac</td></tr>\n <tr><td>ResponseText</td>\t\t<td>$ResponseText</td></tr>\n <tr><td>RecurringMode</td>\t\t<td>$RecurringMode</td></tr>\n </table>\n </body>\n </html>\nHTMLEOF;\n}", "public function getSha() : array\n {\n // Generate URL and make API call\n $generatedUrl = $this->generateUrl();\n\n $curlCall = Curl::callAPI($generatedUrl);\n\n // Check if there is no error message\n if (!empty($curlCall->message)) {\n return ['error' => $curlCall->message];\n }\n\n // return SHA\n return ['sha' => $curlCall->commit->sha];\n }", "public function gopayAction()\n {\n \t$uid = $this->uid;\n $buy_type = $_GET;\n $buy_type = array_keys($buy_type);\n\n //$buy_type\n //[\"callback\\/apipay\",\"btnOrder1\",\"uid\"]\n $buy_type = str_replace('btnOrder', '', $buy_type[1]);\n\n //check buy_type\n $price = 0;\n\n\t\t//加码\n\t\t$nowTime = time();\n\t\t$changeStartTime = strtotime('2012-01-18 00:00:01');\n\t\t$changeEndTime = strtotime('2012-01-26 23:59:59');\n\n\t\tif (($nowTime >= $changeStartTime) && ($nowTime <= $changeEndTime)) {\n\t\t\t$changestatus = 1;\n\t\t} else {\n\t\t\t$changestatus = 2;\n\t\t}\n\n //以分为单位\n\t\tif ($changestatus == 1) {\n\t\t\t$payment = $this->_aryPayDay;\n\t\t} else {\n\t\t\t$payment = $this->_aryPay;\n\t\t}\n\n $gold = 0;\n $itemName = '';\n foreach ($payment as $item) {\n if ($buy_type == $item['id']) {\n $price = $item['price'];\n $gold = $item['gold'];\n $itemName = $item['name'];\n break;\n }\n }\n\n if ($price <= 0 || empty($buy_type) || empty($itemName)) {\n exit;\n }\n\n $rowUser = Hapyfish2_Platform_Bll_User::getUser($uid);\n $orderId = Hapyfish2_Island_Bll_Payment::createPayOrderId($rowUser['puid']);\n $buyer_time = time();\n //call api\n $params = array();\n $params['format'] = 'json';\n $params['item_id'] = $buy_type;\n $params['item_version_id'] = 2;\n $params['total_price'] = $price;\n \t \t/*if ($uid == 10650884) {\n \t$params['total_price'] = 1;\n }*/\n $params['item_name'] = $itemName;\n $params['item_version_name'] = '宝石';\n $params['page_ret_url'] = HOST . '/callback/paydone?';\n $params['proxy_code'] = 'HAPPYFISH';\n $params['outer_order_id'] = $orderId;\n $params['buyer_time'] = $buyer_time;\n $params['description'] = '';\n $params['alipay_id'] = '374052723';//'2088302111803535';\n $rest = Taobao_Rest::getInstance();\n $rest->setUser($puid, $this->info['session_key']);\n $data = $rest->jianghu_getVasIsvUrl($params);\n if (empty($data) || !is_array($data) || !isset($data['vas_isv_url_get_response']['vas_isv_url'])) {\n info_log('101' ,'tb2payfailed');\n \techo '<html><body>request timeout,please try again later.</body></html>';\n exit;\n }\n \t\t$dataUrl = $data['vas_isv_url_get_response']['vas_isv_url'];\n try {\n\t if (isset($dataUrl['aplipay_isv_address'])) {\n\t\t //create pay order\n\t\t $amount = (int)($price/100);\n\t\t $tradeNo = $dataUrl['order_id'];\n\t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n return $this->_redirect($dataUrl['aplipay_isv_address']);\n }\n info_log('102' ,'tb2payfailed');\n\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n \t\techo \"<html><body>$msg</body></html>\";\n\t exit;\n\t\t }\n\t else {\n\t \tif (1 == $dataUrl['status']) {\n \t \t//create pay order\n \t\t $amount = (int)($price/100);\n \t\t $tradeNo = $dataUrl['order_id'];\n \t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n $order = Hapyfish2_Island_Bll_Payment::getOrder($uid, $orderId);\n if ($order['status'] == 1) {\n return $this->_redirect('/pay/payfinish');\n }\n $payRst = Hapyfish2_Island_Bll_Payment::completeOrder($uid, $order);\n if ($payRst == 0) {\n $log = Hapyfish2_Util_Log::getInstance();\n\t\t $log->report('tb2paydone', array($orderId, $amount, $tradeNo, $uid, 1));\n return $this->_redirect('/pay/payfinish');\n }\n else {\n info_log('103' ,'tb2payfailed');\n }\n }\n else {\n info_log('102' ,'tb2payfailed');\n }\n\t\t\t //$msg = $dataUrl['message'];\n\t\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\techo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t \telse {\n\t \t //info_log('104:'.json_encode($dataUrl) ,'tb2payfailed');\n\t \t info_log('104:'.json_encode($data) ,'tb2payfailed');\n\t \t\t$msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\treturn $this->_redirect('http://pay.taobao.com/account/pay_for_account.htm');\n\t \t\t//echo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t }\n } catch (Exception $e) {\n echo '-100';\n exit;\n }\n\n info_log('105' ,'tb2payfailed');\n\t\techo \"<html><body>Please retry.</body></html>\";\n\t\texit;\n }", "public function invoke(PayPalApiStruct $webhook, Context $context): void;", "public function bluepay_capture_payment($params)\n\t{\n\t\t$this->_api_method = 'CAPTURE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "function acapi_call($method, $resource, $args, $params = array(), $body = array(), $options = array()) {\n $default_options = array(\n 'display' => TRUE,\n );\n $options = array_merge($default_options, $options);\n\n $debug = drush_get_option('debug', FALSE);\n $verbose = drush_get_option('verbose', FALSE);\n $simulate = drush_get_option('simulate', FALSE);\n $format = acapi_get_option('format');\n\n // Build the API call URL.\n $url = acapi_get_option('endpoint');\n $url .= acapi_dt($resource, $args);\n $url .= '.json';\n\n foreach ($params as $k => $v) {\n if (is_array($v)) {\n unset($params[$k]);\n foreach ($v as $key => $val) {\n $params[\"$k-$key\"] = \"$k%5B%5D=\" . urlencode($val);\n }\n }\n else {\n $params[$k] = \"$k=\" . urlencode($v);\n }\n }\n\n $url .= '?' . implode('&', $params);\n\n $creds = acapi_get_creds();\n if (!$creds) {\n return FALSE;\n }\n\n // Build the body.\n $json_body = json_encode($body);\n\n $display = \"curl -X $method '$url'\";\n if ($debug) {\n $display .= \" ($creds)\";\n }\n if ($debug || $verbose || $simulate) {\n drush_print($display, 0, STDERR);\n if (!empty($body)) {\n drush_print(\" $json_body\", 0, STDERR);\n }\n }\n\n if ($simulate) {\n return;\n }\n\n $headers = array();\n $ch = curl_init($url);\n // Basic request settings\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n curl_setopt($ch, CURLOPT_USERAGENT, basename(__FILE__));\n if (!empty($options['result_stream'])) {\n curl_setopt($ch, CURLOPT_FILE, $options['result_stream']);\n }\n else {\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n }\n // User authentication\n curl_setopt($ch, CURLOPT_HTTPAUTH, TRUE);\n curl_setopt($ch, CURLOPT_USERPWD, $creds);\n // SSL\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, preg_match('@^https:@', acapi_get_option('endpoint')));\n curl_setopt($ch, CURLOPT_CAINFO, acapi_get_option('cainfo'));\n // Redirects\n if (!empty($options['redirect'])) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_MAXREDIRS, $options['redirect']+1);\n }\n /* Body\n We need to set a Content-Length header even on empty POST requests, or the webserver\n will throw a 411 Length Required.\n */\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_body);\n $headers[] = 'Content-Type: application/json;charset=utf-8';\n $headers[] = 'Content-Length: ' . strlen($json_body);\n // Headers\n if (!empty($headers)) {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n // Debugging\n curl_setopt($ch, CURLOPT_VERBOSE, $debug);\n // Go\n $content = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n return drush_set_error('ACAPI_CURL_ERROR', dt('Error accessing @url: @err', array('@url' => $url, '@err' => curl_error($ch))));\n }\n\n $result = json_decode($content);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if (!empty($format)) {\n drush_print(drush_format($result, NULL, $format));\n }\n else if ($options['display']) {\n if (is_array($result)) {\n foreach ($result as $item) {\n if (! is_scalar($item)) {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($item)));\n }\n else {\n drush_print($item);\n }\n }\n }\n else {\n if ($method == 'POST') {\n // All POST actions return a task. Display something helpful.\n drush_log(dt('Task @taskid started.', array('@taskid' => $result->id)), 'ok');\n }\n else {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($result)));\n }\n }\n }\n\n if ($status != 200) {\n return drush_set_error('ACAPI_HTTP_STATUS_' . $status, dt('API status code @status', array('@status' => $status)));\n }\n\n return array($status, $result);\n}", "function bank_simple_call_response($config, $response = null){\n\n\t$mode = $config['presta'];\n\t$config_id = bank_config_id($config);\n\n\t// recuperer la reponse en post et la decoder, en verifiant la signature\n\tif (!$response){\n\t\t$response = bank_response_simple($mode);\n\t}\n\n\tif (!isset($response['id_transaction']) OR !isset($response['transaction_hash'])){\n\t\treturn bank_transaction_invalide(0,\n\t\t\tarray(\n\t\t\t\t'mode' => $mode,\n\t\t\t\t'erreur' => \"transaction inconnue\",\n\t\t\t\t'log' => var_export($response, true),\n\t\t\t)\n\t\t);\n\t}\n\n\t$id_transaction = $response['id_transaction'];\n\t$transaction_hash = $response['transaction_hash'];\n\n\tif (!$row = sql_fetsel('*', 'spip_transactions', 'id_transaction=' . intval($id_transaction))){\n\t\treturn bank_transaction_invalide($id_transaction,\n\t\t\tarray(\n\t\t\t\t'mode' => $mode,\n\t\t\t\t'erreur' => \"transaction non trouvee\",\n\t\t\t\t'log' => var_export($response, true),\n\t\t\t)\n\t\t);\n\t}\n\tif ($transaction_hash!=$row['transaction_hash']){\n\t\treturn bank_transaction_invalide($id_transaction,\n\t\t\tarray(\n\t\t\t\t'mode' => $mode,\n\t\t\t\t'erreur' => \"hash $transaction_hash non conforme\",\n\t\t\t\t'log' => var_export($response, true),\n\t\t\t)\n\t\t);\n\t}\n\n\t$autorisation = (isset($response['autorisation_id']) ? $response['autorisation_id'] : '');\n\tif ($autorisation===\"wait\"){\n\n\t\t// c'est un reglement en attente, on le note\n\t\t$set = array(\n\t\t\t\"mode\" => \"$mode/$config_id\",\n\t\t\t'autorisation_id' => date('d/m/Y-H:i:s') . \"/\" . $GLOBALS['ip'],\n\t\t\t\"date_paiement\" => date('Y-m-d H:i:s'),\n\t\t\t\"statut\" => 'attente',\n\t\t);\n\n\t} else {\n\t\t// si rien fourni l'autorisation refere l'id_auteur et le nom de celui qui accepte le cheque|virement\n\t\tif (!$autorisation){\n\t\t\tif (isset($GLOBALS['visiteur_session']['id_auteur']) and $GLOBALS['visiteur_session']['id_auteur']){\n\t\t\t\t$autorisation = $GLOBALS['visiteur_session']['id_auteur'] . \"/\" . $GLOBALS['visiteur_session']['nom'];\n\t\t\t} else {\n\t\t\t\t$autorisation = $GLOBALS['ip'] . \"/\" . date('d/m/Y-H:i:s');\n\t\t\t}\n\t\t}\n\n\t\tinclude_spip(\"inc/autoriser\");\n\t\tif (!autoriser('utilisermodepaiement', $mode)){\n\t\t\treturn bank_transaction_invalide($id_transaction,\n\t\t\t\tarray(\n\t\t\t\t\t'mode' => $mode,\n\t\t\t\t\t'erreur' => \"$mode pas autorisee\",\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif (!autoriser('encaisser' . $mode, 'transaction', $id_transaction)){\n\t\t\treturn bank_transaction_invalide($id_transaction,\n\t\t\t\tarray(\n\t\t\t\t\t'mode' => $mode,\n\t\t\t\t\t'erreur' => \"tentative d'encaisser un $mode par auteur #$autorisation pas autorise\",\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// est-ce une demande d'echec ? (cas de la simulation)\n\t\tif (isset($response['fail']) AND $response['fail']){\n\t\t\t// sinon enregistrer l'absence de paiement et l'erreur\n\t\t\tinclude_spip('inc/bank');\n\t\t\treturn bank_transaction_echec($id_transaction,\n\t\t\t\tarray(\n\t\t\t\t\t'mode' => $mode,\n\t\t\t\t\t'config_id' => $config_id,\n\t\t\t\t\t'code_erreur' => 'fail',\n\t\t\t\t\t'erreur' => $response['fail'],\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// OK, on peut accepter le reglement\n\t\t$montant_regle = $row['montant'];\n\t\tif (isset($response['montant'])){\n\t\t\t$montant_regle = $response['montant'];\n\t\t}\n\t\tif ($montant_regle!=$row['montant']){\n\t\t\tspip_log($t = \"call_response : id_transaction $id_transaction, montant regle $montant_regle!=\" . $row['montant'] . \":\" . bank_shell_args($response), $mode);\n\t\t\t// on log ca dans un journal dedie\n\t\t\tspip_log($t, $mode . '_reglements_partiels');\n\t\t}\n\n\t\t$set = array(\n\t\t\t\"mode\" => \"$mode/$config_id\",\n\t\t\t\"autorisation_id\" => $autorisation,\n\t\t\t\"montant_regle\" => $montant_regle,\n\t\t\t\"date_paiement\" => date('Y-m-d H:i:s'),\n\t\t\t\"statut\" => 'ok',\n\t\t\t\"reglee\" => 'oui'\n\t\t);\n\n\t}\n\n\n\t// est-ce un abonnement ?\n\tif (isset($response['abo_uid']) AND $response['abo_uid']){\n\t\t$set['abo_uid'] = $response['abo_uid'];\n\t}\n\n\tsql_updateq(\"spip_transactions\", $set, \"id_transaction=\" . intval($id_transaction));\n\n\t// si ok on regle\n\tif ($set['statut']==='ok'){\n\t\tspip_log(\"call_resonse : id_transaction $id_transaction, reglee\", $mode);\n\n\t\t$options = array('row_prec' => $row);\n\t\t// si l'auteur connecte est celui de la transaction, on garde la langue courante\n\t\t// (sinon ca prendra automatiquement celle de l'auteur)\n\t\tif (intval($row['id_auteur'])\n\t\t\tand isset($GLOBALS['visiteur_session']['id_auteur'])\n\t\t\tand intval($GLOBALS['visiteur_session']['id_auteur']) === intval($row['id_auteur']) ) {\n\t\t\t$options['lang'] = $GLOBALS['spip_lang'];\n\t\t}\n\n\t\t$regler_transaction = charger_fonction('regler_transaction', 'bank');\n\t\t$regler_transaction($id_transaction, $options);\n\n\t\t$res = true;\n\t} // sinon on trig les reglements en attente\n\telse {\n\t\t// cela permet de factoriser le code\n\t\t$row = sql_fetsel('*', 'spip_transactions', 'id_transaction=' . intval($id_transaction));\n\t\tpipeline('trig_bank_reglement_en_attente', array(\n\t\t\t\t'args' => array(\n\t\t\t\t\t'statut' => 'attente',\n\t\t\t\t\t'mode' => $row['mode'],\n\t\t\t\t\t'type' => $row['abo_uid'] ? 'abo' : 'acte',\n\t\t\t\t\t'id_transaction' => $id_transaction,\n\t\t\t\t\t'row' => $row,\n\t\t\t\t),\n\t\t\t\t'data' => '')\n\t\t);\n\n\t\t$res = 'wait';\n\t}\n\n\t// Si c'est un abonnnement, activer ou resilier\n\tif ($id_transaction\n\t\tAND $row = sql_fetsel(\"*\", \"spip_transactions\", \"id_transaction=\" . intval($id_transaction))\n\t\tAND $abo_uid = $row['abo_uid']){\n\n\t\t// c'est un paiement reussi ou en 'wait'\n\t\tif ($res){\n\t\t\t// date de fin de mois de validite de la carte\n\t\t\t$date_fin = \"0000-00-00 00:00:00\";\n\t\t\tif ($row['validite']){\n\t\t\t\tlist($year, $month) = explode('-', $row['validite']);\n\t\t\t\t$date_fin = bank_date_fin_mois($year, $month);\n\t\t\t}\n\n\t\t\tif ($activer_abonnement = charger_fonction('activer_abonnement', 'abos', true)){\n\t\t\t\t$activer_abonnement($id_transaction, $abo_uid, $mode, $date_fin);\n\t\t\t}\n\t\t}\n\n\t\t// c'est un echec, il faut le resilier, que ce soit la premiere ou la Nieme transaction\n\t\tif (!$res){\n\n\t\t\tif ($resilier = charger_fonction('resilier', 'abos', true)){\n\t\t\t\t$options = array(\n\t\t\t\t\t'notify_bank' => false, // pas la peine : abo deja resilie vu paiement refuse\n\t\t\t\t\t'immediat' => true,\n\t\t\t\t\t'message' => \"[bank] Transaction #$id_transaction refusee\",\n\t\t\t\t\t'erreur' => true,\n\t\t\t\t);\n\t\t\t\t$resilier(\"uid:\" . $abo_uid, $options);\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn array($id_transaction, $res);\n}", "public function checkOut($params = array())\r\n {\r\n $actionType = $params['actionType'];;\r\n $cancelUrl = $params['cancelUrl'];//\"http://localhost\"; \r\n $returnUrl = $params['returnUrl']; \r\n $startingDate = \"\"; \r\n \r\n $currencyCode = $params['currencyCode'];\r\n $receiverEmailArray = array();\r\n $receiverAmountArray = array();\r\n $receiverInvoiceIdArray = array();\r\n foreach($params['receivers'] as $rc)\r\n {\r\n $receiverEmailArray[] = $rc['email'];\r\n $receiverAmountArray[] = $rc['amount'];\r\n $receiverInvoiceIdArray[] = $rc['invoice'];\r\n }\r\n \r\n $receiverPrimaryArray = array();\r\n $senderEmail = $params['sender']; \r\n /**\r\n * feesPayer value {SENDER, PRIMARYRECEIVER, EACHRECEIVER}\r\n * \r\n * @var mixed\r\n */\r\n $feesPayer = $params['feesPayer']; \r\n $ipnNotificationUrl = $params['ipnNotificationUrl'];\r\n $memo = $params['memo']; \r\n $pin = $params['pin']; \r\n $preapprovalKey = $params['preapprovalKey'];\r\n //echo $preapprovalKey;\r\n $reverseAllParallelPaymentsOnError = $params['reverseAllParallelPaymentsOnError']; \r\n $trackingId = $this->generateTrackingID(); \r\n $resArray = $this->CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray,\r\n $receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray,\r\n $feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey,\r\n $reverseAllParallelPaymentsOnError, $senderEmail, $trackingId,$startingDate\r\n );\r\n \r\n\r\n \r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n \r\n if($ack==\"SUCCESS\")\r\n {\r\n if (\"\" == $preapprovalKey)\r\n {\r\n // redirect for web approval flow\r\n $cmd = \"cmd=_ap-payment&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n //$cmd = \"cmd=_notify-validate&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n \r\n $this->Redirect($cmd);\r\n }\r\n else\r\n {\r\n \r\n // payKey is the key that you can use to identify the result from this Pay call\r\n $payKey = urldecode($resArray[\"payKey\"]);\r\n // paymentExecStatus is the status of the payment\r\n $paymentExecStatus = urldecode($resArray[\"paymentExecStatus\"]);\r\n } \r\n \r\n }\r\n else\r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('checkOut Error : '. $this->errors); \r\n return false;\r\n } \r\n \r\n }", "public function index(){\n\n $token_is = $_POST['accessToken'];\n $paymentIDis = $_POST['paymentId'];\n $token_is;\n $paymentIDis;\n $executeURL= \"https://checkout.sandbox.bka.sh/v1.2.0-beta/checkout/payment/execute/\";\n $proxy = \"1vggbqd4hqk9g96o9rrrp2jftvek578v7d2bnerim12a87dbrrka\";\n //echo $proxy;\n $url22 = curl_init($executeURL.$paymentIDis);\n\n $header=array(\n 'Content-Type:application/json',\n 'authorization:'.$token_is, \n 'x-app-key:5tunt4masn6pv2hnvte1sb5n3j' \n ); \n \n curl_setopt($url22,CURLOPT_HTTPHEADER, $header);\n curl_setopt($url22, CURLOPT_TIMEOUT, 30);\n curl_setopt($url22, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($url22, CURLOPT_POST, 1 );\n curl_setopt($url22,CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($url22,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($url22, CURLOPT_VERBOSE, true);\n curl_setopt($url22,CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($url22, CURLOPT_SSL_VERIFYPEER, true); # KEEP IT FALSE IF YOU RUN FROM LOCAL PC\n // curl_setopt($url22, CURLOPT_PROXY, $proxy);\n\n $resultdatax=curl_exec($url22);\n\n\n $code = curl_getinfo($url22, CURLINFO_HTTP_CODE);\n $info = curl_getinfo($url22);\n var_dump($info);\n\n\n curl_close($url22);\n $data2 = json_decode($resultdatax);\n // print_r($code);\n \n\n }", "function hdbcall ($call, $data){\n $data = json_encode($data);\n $url = \"http://localhost:8080\".$call;\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data))\n );\n $result = curl_exec($ch);\n return json_decode($result, true);\n}", "public function bluepay_void_payment($params)\n\t{\n\t\t$this->_api_method = 'VOID';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\t\n\t}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function create_payment( $access_token, $c_transactions ) {\n\n global $host;\n\n $postdata = get_json_payment( $c_transactions );\n\n $url = $host.'/v1/payments/payment';\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true); // TRUE to do a regular HTTP POST.\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt($curl, CURLOPT_HEADER, false); // TRUE to include the header in the output.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Accept: application/json',\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n\n $info = curl_getinfo($curl);\n curl_close($curl); // close cURL handler\n \n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n echo \"Received error: \" . $info['http_code']. \"\\n\";\n echo \"Raw response:\".$response.\"\\n\";\n die();\n }\n\n }\n\n // Convert the result from JSON format to a PHP array\n $jsonResponse = json_decode($response, TRUE);\n return $jsonResponse;\n\n}", "public function hash($token,$hash)\n {\n $controller = new SignaBlockController;\n $response = $controller->hash($token,$hash); \n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->tx_hash;\n }\n }\n return response()->json($this->jsonError);\n }", "public function hashInfo($token,$hash)\n {\n $controller = new SignaBlockController;\n $response = $controller->hashInfo($token,$hash);\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data;\n }\n }\n return response()->json($this->jsonError);\n }", "function apiCall ( $http_method, $url, $params=array(), $response_format=null, $request_format=null ) {\n\n if ( empty($response_format) )\n {\n $response_format = $this->guessFormatFromUrl($url);\n }\n\n $ssl_auth = 0;\n if(defined('SYNDICATIONAPICLIENT_SSL_AUTH'))\n $ssl_auth = SYNDICATIONAPICLIENT_SSL_AUTH;\n if(isset($params['ssl_auth'])) {\n $ssl_auth = $params['ssl_auth'];\n unset($params['ssl_auth']);\n }\n\n /*\n foreach ( $params as $p=>$param )\n {\n if ( empty($param) && $param!==0 && $param!=='0' )\n {\n unset( $params[$p] );\n }\n }\n */\n /// ascending order is default, descending order is speicified by a '-' sign\n /// if 'order' param is set, reinterpret that as part of sort param\n if ( !empty($params['sort']) && !empty($params['order']) )\n {\n // clean up sort, strip off leading '-'\n if ( $params['sort']{0} != '-' )\n {\n $params['sort'] = substr( $params['sort'], 1 );\n }\n if ( strtolower(substr($params['order'],4)) == 'desc' )\n {\n $params['sort'] = '-'.$params['sort'];\n }\n }\n\n $http_params = '';\n\n /// our request format type\n $request_headers = array();\n switch( $request_format )\n {\n case 'html':\n $http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: text/html;charset=UTF-8';\n break;\n case 'xml':\n $http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: text/xml;charset=UTF-8';\n break;\n case 'json':\n $http_params = json_encode($params);\n $request_headers[] = 'Content-Type: application/json;charset=UTF-8';\n break;\n default:\n @$http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8';\n break;\n }\n\n $request_headers[] = 'Date: '.gmdate('D, d M Y H:i:s', time()).' GMT';\n\n /// ask for a specific format type of response\n if ( !empty($response_format) )\n {\n switch( $response_format )\n {\n case 'html':\n $request_headers[] = 'Accept: text/html;charset=UTF-8';\n break;\n case 'json':\n $request_headers[] = 'Accept: application/json;charset=UTF-8';\n break;\n case 'js':\n $request_headers[] = 'Accept: application/javascript;charset=UTF-8';\n break;\n case 'text':\n $request_headers[] = 'Accept: text/plain;charset=UTF-8';\n break;\n case 'image':\n $request_headers[] = 'Accept: image/*;';\n break;\n }\n }\n\n /// content-length required for apiKeyGen\n switch ( strtolower($http_method) )\n {\n case 'post':\n case 'put':\n case 'delete':\n $request_headers[] = 'Content-Length: '.strlen($http_params);\n break;\n case 'get':\n default:\n $request_headers[] = 'Content-Length: 0';\n break;\n }\n\n $apiKey = $this->apiGenerateKey( $http_method, $url, $http_params, $request_headers );\n $request_headers[] = \"Authorization: syndication_api_key {$apiKey}\";\n\n $curl = $this->apiBuildCurlRequest( $http_method, $url, $http_params, $request_headers, $response_format );\n\n /// do some temp memory writing bs to capture curl's output to grab actual request string\n curl_setopt($curl, CURLOPT_VERBOSE, true);\n $verbose = fopen('php://temp', 'rw+');\n curl_setopt($curl, CURLOPT_STDERR, $verbose);\n\n if($ssl_auth == 1) {\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $content = curl_exec($curl);\n rewind($verbose);\n $verbose_log = stream_get_contents($verbose);\n $http = curl_getinfo($curl);\n $http['verbose_log'] = $verbose_log;\n\n if ($content === false)\n {\n curl_close($curl);\n throw new Exception('Syndication: No Response: '. $http['http_code'], $http['http_code'] );\n return null;\n }\n curl_close($curl);\n\n if ( empty($response_format) )\n {\n $response_format = $this->guessFormatFromResponse($http);\n }\n\n $api_response = array(\n 'http' => $http,\n 'content' => $content,\n 'format' => $response_format\n );\n /// test result content-type for JSON / HTML / IMG\n /// json needs to be decoded\n /// html stay as text\n /// images need to be: base64_encoded string or image resource\n if ( $response_format=='image' )\n {\n // as GD handle ?\n // $api_response['content'] = imagecreatefromstring($content);\n } else if ( $response_format=='text' ) {\n // nuthin\n } else if ( $response_format=='html' ) {\n // any html cleaning ?\n } else if ( $response_format=='js' ) {\n // any xss cleaning ?\n } else if ( $response_format=='json' ) {\n try {\n $decoded = json_decode($content,true);\n if ( $decoded === null )\n {\n /// bad json should return empty, or return raw unencoded values?\n } else if ( isset($decoded['results']) ) {\n if ( empty($decoded['results']) || count($decoded['results'])==1 && empty($decoded['results'][0]) )\n {\n $decoded['results'] = array();\n }\n }\n $api_response['content'] = $decoded;\n } catch ( Exception $e ) {\n /// bad json should return empty, or return raw unencoded values?\n }\n }\n return $api_response;\n }", "public function get_woo_pal_details() {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\t$api_prefix = '';\n\n\t\tif ( 'live' !== $environment ) {\n\t\t\t$api_prefix = 'sandbox_';\n\t\t}\n\n\t\t$this->setup_api_vars( $this->key, $environment, $this->wc_gateway()->get_option( $api_prefix . 'api_username' ), $this->wc_gateway()->get_option( $api_prefix . 'api_password' ), $this->wc_gateway()->get_option( $api_prefix . 'api_signature' ) );\n\n\t\t$this->add_parameter( 'METHOD', 'GetPalDetails' );\n\t\t$this->add_credentials_param( $this->api_username, $this->api_password, $this->api_signature, 124 );\n\t\t$request = new stdClass();\n\t\t$request->path = '';\n\t\t$request->method = 'POST';\n\t\t$request->body = $this->to_string();\n\n\t\treturn $this->perform_request( $request );\n\n\t}", "public function actionCallback() {\n\n $request = Yii::$app->request->get();\n\n $booking_id = $request['trackid'];\n\n $booking = Booking::findOne($booking_id);\n\n if(!$booking) {\n throw new \\yii\\web\\NotFoundHttpException('The requested page does not exist.');\n }\n\n $error = '';\n \n $key = $this->tap_merchantid;\n $refid = $request['ref'];\n \n $str = 'x_account_id'.$key.'x_ref'.$refid.'x_resultSUCCESSx_referenceid'.$booking_id.'';\n $hashstring = hash_hmac('sha256', $str, $this->tap_api_key);//'1tap7'\n $responsehashstring = $request['hash'];\n \n if ($hashstring != $responsehashstring) {\n $error = Yii::t('api', 'Unable to locate or update your booking status');\n } else if ($request['result'] != 'SUCCESS') {\n $error = Yii::t('api', 'Payment was declined by Tap');\n }\n \n if ($error) \n {\n return $this->redirect(['error']); \n } \n else \n { \n //gateway info \n $gateway = PaymentGateway::find()->where(['code' => 'tap', 'status' => 1])->one();\n\n if($request['crdtype'] == 'KNET') {\n $booking->payment_method = 'Tap - Paid with KNET';\n $booking->gateway_fees = $gateway->fees;\n $booking->gateway_percentage = 0;\n $booking->gateway_total = $gateway->fees;//fixed price fee \n } else {\n $booking->payment_method = 'Tap - Paid with Creditcard/Debitcard';\n $booking->gateway_fees = 0;\n $booking->gateway_percentage = $gateway->percentage;\n $booking->gateway_total = $gateway->percentage * ($booking->total_with_delivery / 100);\n }\n\n //update status \n $booking->transaction_id = $request['ref'];\n $booking->save(false);\n\n //add payment to vendor wallet \n Booking::addPayment($booking);\n \n //send order emails\n Booking::sendBookingPaidEmails($booking_id);\n\n //redirect to order success \n return $this->redirect(['success']); \n }\n }", "public function call($method, $url, $array = array())\n {\n Log::debug('ShopifyApi.call for ' . $url);\n $this->checkAuthorization('ShopifyApi.call');\n\n list($resultJson, $responseHeaders) = $this->shopifyClient->call($method, $url, $array);\n// Log::debug('ShopifyApi.call xx resultJson = ' . json_encode($resultJson));\n// Log::debug('ShopifyApi.call xx responseHeaders = ' . json_encode($responseHeaders));\n $result = json_decode($resultJson, true);\n\n // check errors\n if (isset($result['errors']) or ($responseHeaders['http_status_code'] >= 400)) {\n\n// Log::info(\"ShopifyApi.call for url=$url, responseHeaders=\" . print_r($responseHeaders, true));\n Log::info(\"ShopifyApi.call for url=$url, resultJson=$resultJson.\");\n\n Log::error(\"ShopifyApi.call: ERROR: \" . json_encode($result['errors']) . ', responseHeaders = ' . print_r($responseHeaders, true));\n\n if (isset($result['errors']) && '[API] Invalid API key or access token (unrecognized login or wrong password)' == $result['errors']) {\n Log::error('ShopifyApi.call: Invalid API key');\n\n if (Session::has('shop')) {\n $shop = Session::get('shop');\n $this->deleteShopInDB($shop);\n }\n\n throw new ShopifyAuthenticationException($result['errors']);\n }\n Log::info(\"ShopifyApi.call: throw ShopifyException\");\n throw new ShopifyException(json_encode($result['errors']));\n }\n\n // check call limits\n $this->limitCalls();\n\n $resultShift = (is_array($result) and (count($result) > 0)) ? array_shift($result) : $result;\n return $resultShift;\n }", "function fetchFromServer($method, $data){\n global $DB;\n $server_url = $DB->get_field_sql('SELECT value FROM {config} WHERE name = \"bigbluebuttonbn_server_url\"');\n $salt = $DB->get_field_sql('SELECT value FROM {config} WHERE name = \"bigbluebuttonbn_shared_secret\"');\n // $server_url = \"https://api.mynaparrot.com/bigbluebutton/iqdevelopment/\";\n // $salt = \"gTdddGZCzDgPhFXpiqON\";\n\n ksort($data);\n $params = \"\";\n foreach ($data as $key => $value) {\n $params .= $key . '=' . urlencode($value) . \"&\";\n }\n $params = rtrim($params, \"&\");\n $params = ltrim($params, \"=\");\n\n $sign = sha1($method . $params . $salt);\n\n $url = $server_url . \"api/\". $method . \"?\" . $params .'&checksum=' . $sign;\n\n //echo $url . \"<br>\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90); //timeout in seconds\n $response = curl_exec($ch);\n curl_close ($ch);\n\n if(!$response){\n return curl_error($ch);\n }\n\n try {\n $xml = simplexml_load_string($response);\n return json_decode(json_encode($xml));\n } catch (Exception $e) {\n return $e->getMessage();\n }\n}", "public function signedCall(string $method, array $params = [], SessionInterface $session = null, $requestMethod = 'GET'): array;", "function MakeSignedRequest()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'Version',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result);\n echo $result['body'];\n}", "public function callback_return(){\r\n\r\n $this->log('Entering callback_return', 'info');\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n\r\n try {\r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n\r\n $this->log('Flow result: '.json_encode($result));\r\n\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $status = $result['status'];\r\n\r\n $order = $this->getOrder($order_id);\r\n\r\n $order_status = $order->get_status();\r\n\r\n if ($this->userCanceledPayment($status, $result)) {\r\n $this->log('User canceled the payment. Redirecting to checkout...', 'info');\r\n $this->redirectToCheckout();\r\n }\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n \r\n /*if($this->isTesting($result)){\r\n $this->log('Setting up the production simulation...');\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n \r\n if ($this->isPendingInFlow($status)) {\r\n\r\n $this->clearCart();\r\n\r\n if($this->userGeneratedCoupon($status, $result)){\r\n\r\n if(!empty( $this->get_option('return_url'))){\r\n $this->redirectTo($this->get_option('return_url'));\r\n }\r\n }\r\n\r\n $this->redirectToCouponGenerated($order);\r\n } elseif($this->isPaidInFlow($status)) {\r\n\r\n if($this->isPendingInStore($order_status)){\r\n\r\n $this->payOrder($order);\r\n }\r\n\r\n $this->redirectToSuccess($order);\r\n } else {\r\n\r\n if($this->isRejectedInFlow($status)){\r\n if($this->isPendingInStore($order_status)){\r\n $this->rejectOrder($order);\r\n }\r\n }\r\n\r\n if($this->isCancelledInFlow($status)){\r\n\r\n if($this->isPendingInStore($order_status)){\r\n $this->cancelOrder($order);\r\n }\r\n }\r\n\r\n $this->redirectToFailure($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n $this->redirectToError();\r\n }\r\n \r\n wp_die();\r\n }", "function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }", "public function pay_bill_get(){\r\n if (!$this->pronet_model->pay_bill(1, '882332411098', '4999999999999999', '4521','12','2022')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function makePayment($amountTobePaid)\n {\n\n $this->transactionId = uniqid();\n $encodedAuth = base64_encode($this->apiUser . \":\" . $this->apiPassword);\n $postRequest = array(\n \"total_amount\" => $amountTobePaid,\n \"return_url\" => $this->returnUrl,\n \"notify_url\" => $this->notifyUrl,\n \"transaction_id\" => $this->transactionId,\n \"description\"=> \"PayUnit web payments\"\n );\n $cURLConnection = curl_init();\n if($this->mode === \"test\"){\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/sandbox/gateway/initialize\");\n }else{\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/api/gateway/initialize\");\n }\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postRequest)); \n $secArr = array(\n \"x-api-key: {$this->apiKey}\",\n \"authorization: Basic: {$encodedAuth}\",\n 'Accept: application/json',\n 'Content-Type: application/json',\n \"mode: {$this->mode}\"\n );\n $all = array_merge($postRequest,$secArr);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER,$all);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n $jsonArrayResponse = json_decode($apiResponse);\n echo(isset($jsonArrayResponse));\n if(isset($jsonArrayResponse->body->transaction_url)){\n echo(\"dfdgdg\");\n //die();\n header(\"Location: {$jsonArrayResponse->body->transaction_url}\");\n exit(); \n }\n else{\n echo($apiResponse);\n }\n }", "public function HandleCallback()\r\n\t{\r\n\t\t$rsField = array();\r\n\r\n\t foreach ((array)$_REQUEST as $ixField => $fieldValue)\r\n\t {\r\n $rsField[$ixField] = $fieldValue;\r\n\t }\r\n\r\n\t\t$sSignatureBase =\r\n\t\t\tsprintf(\"%03s\", $rsField['ver']) .\r\n\t\t\tsprintf(\"%-10s\", $rsField['id']) .\r\n\t\t\tsprintf(\"%012s\", $rsField['ecuno']) .\r\n\t\t\tsprintf(\"%06s\", $rsField['receipt_no']) .\r\n\t\t\tsprintf(\"%012s\", $rsField['eamount']) .\r\n\t\t\tsprintf(\"%3s\", $rsField['cur']) .\r\n\t\t\t$rsField['respcode'] .\r\n\t\t\t$rsField['datetime'] .\r\n\t\t\tsprintf(\"%-40s\", $rsField['msgdata']) .\r\n\t\t\tsprintf(\"%-40s\", $rsField['actiontext']);\r\n\r\n\t function hex2str($hex)\r\n\t {\r\n\t\t\tfor($i=0;$i<strlen($hex);$i+=2) $str.=chr(hexdec(substr($hex,$i,2)));\r\n\t\t\treturn $str;\r\n\t\t}\r\n\r\n\t\t$mac = hex2str($rsField['mac']);\r\n\t\t$sSignature = sha1($sSignatureBase);\r\n\t\t$flKey = openssl_get_publickey(file_get_contents($this->flBankCertificate));\r\n\r\n\t\tif (!openssl_verify ($sSignatureBase, $mac, $flKey))\r\n\t\t{\r\n\t\t\ttrigger_error (\"Invalid signature\", E_USER_ERROR);\r\n\t\t}\r\n\t\tif ($rsField['receipt_no'] == 000000) # Payment was cancelled\r\n\t\t{\r\n\t\t\treturn new CPayment($rsField['ecuno'], $rsField['msgdata'], null, null, False);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn new CPayment($rsField['ecuno'], $rsField['msgdata'], $rsField['eamount']/100, $rsField['cur'], True);\r\n\t\t}\r\n\t}", "function pay_fields() {\n\t\t// define(APPKEY ,\"2Wozy2aksie1puXUBpWD8oZxiD1DfQuEaiC7KcRATv1Ino3mdopKaPGQQ7TtkNySuAmCaDCrw4xhPY5qKTBl7Fzm0RgR3c0WaVYIXZARsxzHV2x7iwPPzOz94dnwPWSn\"); //paysign key\n\t\t// define(SIGNTYPE, \"sha1\"); //method\n\t\t// define(PARTNERKEY,\"8934e7d15453e97507ef794cf7b0519d\");//通加密串\n\t\t// define(APPSERCERT, \"09cb46090e586c724d52f7ec9e60c9f8\");\n\t\treturn array (\n\t\t\t\t'APPID' => array (\n\t\t\t\t\t\t'title' => 'APPID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信公众号身份的唯一标识。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'MCHID' => array (\n\t\t\t\t\t\t'title' => 'MCHID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '受理商ID,身份标识' \n\t\t\t\t),\n\t\t\t\t'KEY' => array (\n\t\t\t\t\t\t'title' => 'KEY:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '商户支付密钥Key。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'APPSECRET' => array (\n\t\t\t\t\t\t'title' => 'APPSECRET:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => 'JSAPI接口中获取openid,审核后在公众平台开启开发模式后可查看' \n\t\t\t\t),\n\t\t\t\t'NOTIFY_URL' => array (\n\t\t\t\t\t\t'title' => 'NOTIFY_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '异步通知url,商户根据实际开发过程设定' \n\t\t\t\t),\n\t\t\t\t'JS_API_CALL_URL' => array (\n\t\t\t\t\t\t'title' => 'JS_API_CALL_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '获取access_token过程中的跳转uri,通过跳转将code传入jsapi支付页面' \n\t\t\t\t),\n\t\t\t\t'WEIXIN_PAY_UNIT' => array (\n\t\t\t\t\t\t'title' => 'WEIXIN_PAY_UNIT:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信支付单位,100为元 ,10为角,1为分' \n\t\t\t\t),\n\t\t\t\t'SUCCESS_URL' => array (\n\t\t\t\t\t\t'title' => 'SUCCESS_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '支付成功跳转页面' \n\t\t\t\t),\n\t\t);\n\t}", "private static function makeCall($method, $args = array(), $resultKey = null, $https = false, $sessionID = false){\r\n\r\n $payload = array('method' => $method,\r\n 'parameters' => $args,\r\n 'header' => array('wsKey' => self::$wsKey),\r\n );\r\n\r\n if (!empty($sessionID)) {\r\n $payload['header']['sessionID'] = $sessionID;\r\n } else if ($sessionID !== false) {\r\n trigger_error(\"$method requires a valid sessionID.\", E_USER_ERROR);\r\n return false;\r\n }\r\n\r\n $c = curl_init();\r\n $postData = json_encode($payload);\r\n curl_setopt($c, CURLOPT_POST, 1);\r\n curl_setopt($c, CURLOPT_POSTFIELDS, $postData);\r\n\r\n $headers = self::$headers;\r\n $host = self::API_HOST;\r\n if (self::$usePHPDNS) {\r\n if (empty(self::$cachedHostIP)) {\r\n $records = dns_get_record($host, DNS_A);\r\n if (empty($records) || empty($records[0]['ip'])) {\r\n trigger_error(\"Failed to fetch IP address for $host.\", E_USER_ERROR);\r\n return false;\r\n }\r\n self::$cachedHostIP = $records[0]['ip'];\r\n }\r\n $headers[] = \"Host: $host\"; //make sure we sent the host param since we switching to ip-based host\r\n $host = self::$cachedHostIP;\r\n }\r\n if (!empty($headers)) {\r\n curl_setopt($c, CURLOPT_HTTPHEADER, $headers);\r\n }\r\n\r\n if ($https) {\r\n $scheme = \"https://\";\r\n } else {\r\n $scheme = \"http://\";\r\n }\r\n $sig = self::createMessageSig($postData, self::$wsSecret);\r\n $url = $scheme . $host . self::API_ENDPOINT . \"?sig=$sig\";\r\n curl_setopt($c, CURLOPT_URL, $url);\r\n\r\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 2);\r\n curl_setopt($c, CURLOPT_TIMEOUT, 6);\r\n curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);\r\n curl_setopt($c, CURLOPT_USERAGENT, 'fastest963-GroovesharkAPI-PHP-' . self::$wsKey);\r\n $return = curl_exec($c);\r\n $httpCode = curl_getinfo($c, CURLINFO_HTTP_CODE);\r\n curl_close($c);\r\n if ($httpCode != 200) {\r\n trigger_error(\"Unexpected return code from Grooveshark API. Code $httpCode.\", E_USER_ERROR);\r\n return false;\r\n }\r\n\r\n $result = json_decode($return, true);\r\n if (is_null($result) || empty($result['result'])) {\r\n if (!empty($result['errors'])) {\r\n trigger_error(\"Errors in result from server. Errors: \" . print_r($result['errors'], true), E_USER_ERROR);\r\n }\r\n return false;\r\n } else if (!empty($resultKey)) {\r\n if (!isset($result['result'][$resultKey])) {\r\n return false;\r\n }\r\n $result = $result['result'][$resultKey];\r\n } else if ($resultKey !== false) {\r\n $result = $result['result'];\r\n }\r\n return $result;\r\n }", "public function get($call_type='products', $arguments=array()) {\n $this->start_time = microtime(true);\n $this->logger->info(\"Setting up to call PopShops $call_type API...\");\n if ($this->called) {\n $this->logger->error('Client attempted to call PsApiCall object more than once. Call aborted.');\n return;\n }\n if (! in_array($call_type, array('products', 'merchants', 'deals', 'categories'))) {\n $this->logger->error(\"Invalid call_type '$call_type' was passed to PsApiCall->call. Call aborted.\");\n return;\n }\n $this->call_type = $call_type;\n if ($this->url_mode) {\n $this->loadOptionsFromGetParams();\n }\n $this->called = true;\n $this->options = array_merge($this->options, $arguments);\n $formatted_options = array();\n foreach ($this->options as $key=>$value) $formatted_options[] = $key . '=' . urlencode($value);\n $url = 'http://api.popshops.com/v3/' . $call_type . '.json?' . implode('&', $formatted_options);\n $this->logger->info('Request URL: ' . $url);\n $this->logger->info('Sending request...');\n $raw_json = file_get_contents($url);\n $this->response_received_time = microtime(true);\n $this->logger->info('JSON file retrieved');\n $parsed_json = json_decode($raw_json, true);\n $this->logger->info('JSON file decoded');\n if ($parsed_json['status'] == '200') {\n $this->logger->info('API reported status 200 OK');\n } else {\n $this->logger->info('API reported unexpected status: ' . $parsed_json['status'] . '; Message: ' . $parsed_json['message']);\n $this->logger->error('Invalid status. Aborting call. Ensure all arguments passed to PsApiCall->get are valid.');\n return;\n }\n $this->logger->info(\"Processing JSON from $call_type call...\");\n $this->processResults($parsed_json);\n $this->logger->info('JSON processing completed.');\n $this->logger->info('Internal processing time elapsed: ' . (string) (microtime(true) - $this->response_received_time));\n $this->logger->info('Total call time elapsed: ' . (string) (microtime(true) - $this->start_time));\n }", "public function init()\r\n { \r\n\t\ttry\r\n\t\t{ \r\n $orderNumber = addslashes( $_GET['order_number'] ) ? : null;\r\n if ( is_null( $orderNumber) ) { return; }\r\n \r\n $table = new Application_Subscription_Checkout_Order();\r\n if( ! $orderInfo = $table->selectOne( null, array( 'order_id' => $orderNumber ) ) )\r\n {\r\n return false;\r\n }\r\n //var_export( $orderInfo );\r\n if( ! is_array( $orderInfo['order'] ) )\r\n {\r\n //\tcompatibility\r\n $orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n }\r\n //$orderInfo['order'] = unserialize( $orderInfo['order'] );\r\n $orderInfo['total'] = 0;\r\n\r\n foreach( $orderInfo['order']['cart'] as $name => $value )\r\n {\r\n if( ! isset( $value['price'] ) )\r\n {\r\n $value = array_merge( self::getPriceInfo( $value['price_id'] ), $value );\r\n }\r\n $orderInfo['total'] += $value['price'] * $value['multiple'];\r\n //$counter++;\r\n }\r\n\r\n $secretKey = Paypal_Settings::retrieve( 'secret_key' );\r\n\r\n // var_Export( $secretKey );\r\n\r\n $result = array();\r\n\r\n //The parameter after verify/ is the transaction reference to be verified\r\n $url = 'https://api.sandbox.paypal.com/v2/checkout/orders/' . $_REQUEST['ref'];\r\n echo $url;\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']\r\n );\r\n curl_setopt(\r\n $ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $secretKey ]\r\n );\r\n $request = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n if ( $request ) {\r\n $result = json_decode($request, true);\r\n }\r\n\r\n //Use the $result array\r\n var_export( $request );\r\n \r\n //\tconfirm status\r\n /* var_export( ! empty( $result['Error'] ) );\r\n var_export( @$result['StatusCode'] !== '00' );\r\n var_export( @$result['Amount'] != @$orderInfo['total'] );\r\n var_export( @$result['Amount'] );\r\n var_export( @$orderInfo['total'] );\r\n var_export( @$result['AmountIntegrityCode'] !== '00' );\r\n */\t\t\r\n if( empty( $result['status'] ) )\r\n {\r\n //\tPayment was not successful.\r\n $orderInfo['order_status'] = 'Payment Failed';\r\n }\r\n else\r\n {\r\n $orderInfo['order_status'] = 'Payment Successful';\r\n }\r\n\r\n //var_export( $orderInfo );\r\n $orderInfo['order_random_code'] = $_REQUEST['ref'];\r\n $orderInfo['gateway_response'] = $result;\r\n\r\n //var_export( $orderNumber );\r\n\r\n self::changeStatus( $orderInfo );\r\n //$table->update( $orderInfo, array( 'order_id' => $orderNumber ) );\r\n\r\n //$response = new SimpleXMLElement(file_get_contents($url));\r\n\r\n //var_export( $orderInfo );\r\n //var_export( $result );\r\n\r\n //\tCode to change check status goes heres\r\n //\tif( )\r\n return $orderInfo;\r\n\t\t} \r\n\t\tcatch( Exception $e )\r\n { \r\n // Alert! Clear the all other content and display whats below.\r\n // $this->setViewContent( '<p class=\"badnews\">' . $e->getMessage() . '</p>' ); \r\n // $this->setViewContent( '<p class=\"badnews\">Theres an error in the code</p>' ); \r\n // return false; \r\n }\r\n\t}", "public function request($method, $params) {\n //on combine les parametres par défaut avec les params qui vont etre passés\n $params = array_merge($params, array(\n 'METHOD' => $method,\n 'VERSION' => '74.0',\n 'USER' => $this->user,\n 'SIGNATURE' => $this->signature,\n 'PWD' => $this->password,\n ));\n \n //convertir le tab en str pour eviter les erreurs de paypal\n //pcq paypal attends de nous une chaine de char et non un tab\n $params = http_build_query($params);\n\n //pour demander un url on utilise curl_init() + fo le parametrer\n //curl_init() --> params --> curl_exec()\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $this->endpoint, //indiquer l'url à request\n CURLOPT_POST => 1, //envoyer via POST\n CURLOPT_POSTFIELDS => $params, //params\n CURLOPT_RETURNTRANSFER => 1, //envoyer une rep\n CURLOPT_SSL_VERIFYPEER => FALSE,//off ssl coté hote distant\n CURLOPT_SSL_VERIFYHOST => FALSE,//off ssl coté localhost\n CURLOPT_VERBOSE => 1 // -v(linux)\n ));\n //on recup la reponse de la requette\n $response = curl_exec($curl);\n \n $responseArray = array();\n parse_str($response, $responseArray);\n \n \n \n\n //*********************************************************\n //*** A FAIRE SAUTER A LA FIN DES TEST ***\n //*********************************************************\n //afficher le contenu du retour du paypal(token communiqué)\n /*\n foreach ($responseArray as $item => $value) {\n print_r($item . \" : \" . $value . \"<br>\");\n }\n print_r('<br>*********************************************<br>');\n * \n */\n //**********************************************************\n //**********************************************************\n \n \n \n\n //avant de fermer fo check s'il n'ya pas de problems\n if (curl_errno($curl)) {\n $this->errors = curl_error($curl);\n curl_close($curl);\n return false;\n } else {\n if ($responseArray['ACK'] == 'Success') {\n return $responseArray;\n } else {\n $this->errors = $responseArray;\n curl_close($curl);\n return false;\n }\n }\n }", "public function call() {\n\t\t$cart_order_id=$_GET['order_id'];\n\t\tif ($this->_module['sk_live']==$_GET['secret']) {\n\t\t\tif ($_GET['state']=='2') {\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::PAYMENT_DECLINE, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::ORDER_CANCELLED, $cart_order_id);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback expired.\");\n\t\t\t} else if ($_GET['state']=='5'){\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::ORDER_PROCESS, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::PAYMENT_SUCCESS, $cart_order_id);\n\t\t\t\t$transData['notes']\t\t\t= implode(' ', $notes);\n\t\t\t\t$transData['order_id']\t\t= $cart_order_id;\n\t\t\t\t$transData['status']\t\t= \"Completed\";\n\t\t\t\t$transData['gateway']\t\t= 'Bitcoinz';\n\t\t\t\t$order->logTransaction($transData);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback success.\");\n\t\t\t}\n\t\t}\n\t}", "public function getPaytmHash(){\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Cache-Control: no-cache\");\n\t\theader(\"Expires: 0\");\n\n\t\trequire_once(APPPATH . \"/third_party/paytmlib/config_paytm.php\");\n\t\trequire_once(APPPATH . \"/third_party/paytmlib/encdec_paytm.php\");\n\n\t\t$this->form_validation->set_rules('order_id', 'Order id', 'trim|required');\n\t\t$this->form_validation->set_rules('cust_id', 'Cust id', 'trim|required');\n\t\t$this->form_validation->set_rules('industry_type_id', 'Industry type id', 'trim|required');\n\t\t$this->form_validation->set_rules('channel_id', 'Channel id', 'trim|required');\n\t\t$this->form_validation->set_rules('txn_amount', 'Txn amount', 'trim|required');\n\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required');\n\t\t$this->form_validation->set_rules('mobile_no', 'Mobile no', 'trim|required');\n\n\t\tif ($this->form_validation->run() == true) {\n\t\t\t$checkSum = \"\";\n\t\t\t$paramList = array();\n\n\t\t\t$ORDER_ID = $this->input->post('order_id');\n\t\t\t$CUST_ID = $this->input->post('cust_id');\n\t\t\t$INDUSTRY_TYPE_ID = $this->input->post('industry_type_id');\n\t\t\t$CHANNEL_ID = $this->input->post('channel_id');\n\t\t\t$TXN_AMOUNT = $this->input->post('txn_amount');\n\t\t\t$EMAIL = $this->input->post('email');\n\t\t\t$MOBILE_NO = str_replace('+', '',$this->input->post('mobile_no'));\n\n\t\t\t$paramList[\"MID\"] = PAYTM_MERCHANT_MID;\n\t\t\t$paramList[\"ORDER_ID\"] = $ORDER_ID;\n\t\t\t$paramList[\"CUST_ID\"] = $CUST_ID;\n\t\t\t$paramList[\"INDUSTRY_TYPE_ID\"] = $INDUSTRY_TYPE_ID;\n\t\t\t$paramList[\"CHANNEL_ID\"] = $CHANNEL_ID;\n\t\t\t$paramList[\"TXN_AMOUNT\"] = $TXN_AMOUNT;\n\t\t\t$paramList[\"WEBSITE\"] = PAYTM_MERCHANT_WEBSITE;\n\t\t\t//$paramList[\"CALLBACK_URL\"] = \"http://localhost/Projects/Paytm_Web_Sample_Kit_PHP-masterr/PaytmKit/pgResponse.php\";\n\t\t\t$paramList[\"MSISDN\"] = $MOBILE_NO;\n\t\t\t$paramList[\"EMAIL\"] = $EMAIL;\n\n\t\t\t$checkSum = getChecksumFromArray($paramList,PAYTM_MERCHANT_KEY);\n\t\t\tif($checkSum){\n\t\t\t\t$response = array('status'=>true,'message'=>'Checksum generated','hash'=>$checkSum);\n\t\t\t}else{\n\t\t\t\t$response = array('status'=>false,'message'=>'Something went wrong!');\n\t\t\t}\n\t\t}else{\n\t\t\t$errors = $this->form_validation->error_array();\n\t\t\t$response = array('status'=>false,'message'=>$errors);\n\t\t}\n\t\t$this->renderJson($response);\n\t}", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "function requestPayout($get_access_token){\n global $new_json; // Request JSON for payout\n // echo 'Test==';\n //print_r($new_json); die; \n$access_token='Bearer '.$get_access_token;\n ///// Load Api data////\n$domain = \"https://api.sandbox.paypal.com/v1/oauth2/token\";\n\n\n$url = 'https://api.sandbox.paypal.com/v1/payments/payouts';\n\n\n$headers[] = 'Accept: application/json';\n$headers[] = 'Authorization: Bearer A21AAGMlHEpgdv_Fm4smWsm7CwWfdrRz458Mp14mzVnU0S1zIORyX-ATQeni2P9bCdzrk7FPLnuKPynwIg8ZhnznY6zDu08bw';\n//$headers[] = \"Content-Type: application/x-www-form-urlencoded\";\n\n\n\n\n//$postdata = json_encode($data);\n\n$postdata_stop='{\n \"sender_batch_header\": {\n \"sender_batch_id\": \"1001\",\n \"email_subject\": \"You have a payout!\",\n \"email_message\": \"You have received a payout! Thanks for using our service!\"\n },\n \"items\": [\n {\n \"recipient_type\": \"EMAIL\",\n \"amount\": {\n \"value\": \"0\",\n \"currency\": \"USD\"\n },\n \"note\": \"Thanks for your patronage!\",\n \"sender_item_id\": \"123\",\n \"receiver\": \"[email protected]\"\n },\n {\n \"recipient_type\": \"EMAIL\",\n \"amount\": {\n \"value\": \"0\",\n \"currency\": \"USD\"\n },\n \"note\": \"Thanks for your patronage!\",\n \"sender_item_id\": \"345\",\n \"receiver\": \"[email protected]\"\n }\n \n ]\n}';\n\n //$postdata=$new_json; // Custom JSON\n \n\n$headers_arr=array('Authorization: '.$access_token,'Content-Type: application/json');\n\n\n$ch = curl_init($url);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n\n\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $new_json);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_arr);\n$result = curl_exec($ch);\n \n//print_r ($result);\ncurl_close($ch);\n\nreturn $result;\n\n}", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "function hook_credit_info() {\n $results = array();\n $results['foo_bundle'] = array (\n 'bundle' => 'foo',\n // callback function must return value between 0 and 1.\n 'callback' => 'foo_result_calculate',\n \n );\n return $results;\n}", "public function getDigestedResponse() {\n\t}", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "public function unsignedCall(string $method, array $params = [], string $requestMethod = 'GET'): array;", "public function getHashSignedById(): string;", "function verify_and_retrieve_payment()\r\n\t{\r\n\t\t$email = $_GET['ipn_email']; \r\n\t\t$header = \"\"; \r\n\t\t$emailtext = \"\"; \r\n\t\t// Read the post from PayPal and add 'cmd' \r\n\t\t$req = 'cmd=_notify-validate';\r\n\r\n\t\tif(function_exists('get_magic_quotes_gpc')) \r\n\t\t{ \r\n\t\t\t$get_magic_quotes_exits = true;\r\n\t\t}\r\n\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t// Handle escape characters, which depends on setting of magic quotes \r\n\t\t{ \r\n\t\t\tif($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode(stripslashes($value)); \r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode($value); \r\n\t\t\t} \r\n\t\t \r\n\t\t\t$req .= \"&$key=$value\"; \r\n\t\t} // Post back to PayPal to validate \r\n\t\t \r\n\t\t$header .= \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\"; \r\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\"; \r\n\t\t$header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\"; \r\n\r\n\t\t$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); \r\n\r\n\t\t // Process validation from PayPal\r\n\t\tif (!$fp) \r\n\t\t{ // HTTP ERROR \r\n\t\t} \r\n\t\telse \r\n\t\t{ // NO HTTP ERROR \r\n\t\t\tfputs ($fp, $header . $req); \r\n\t\t \r\n\t\t\twhile (!feof($fp)) \r\n\t\t\t{ \r\n\t\t\t\t$res = fgets ($fp, 1024); \r\n\t\t\t\tif (strcmp ($res, \"VERIFIED\") == 0) \r\n\t\t\t\t{ \r\n\t\t\t\t\t// TODO: // Check the payment_status is Completed \r\n\t\t\t\t\t// Check that txn_id has not been previously processed \r\n\t\t\t\t\t// Check that receiver_email is your Primary PayPal email \r\n\t\t\t\t\t// Check that payment_amount/payment_currency are correct \r\n\t\t\t\t\t// Process payment \r\n\t\t\t\t\t// If 'VERIFIED', send an email of IPN variables and values to the \r\n\t\t\t\t\t// specified email address \r\n\t\t \r\n\t\t\t\t\t$f_result = array( true, $_POST );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t\t//$emailtext .= $key . \" = \" .$value .\"\\n\\n\";\r\n\t\t\t\t\t//} \r\n\t\t\t \r\n\t\t\t\t\t//mail($email, \"Live-VERIFIED IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t} \r\n\t\t\t\telse if (strcmp ($res, \"INVALID\") == 0) \r\n\t\t\t\t{ // If 'INVALID', send an email. TODO: Log for manual investigation. \r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t//\t$emailtext .= $key . \" = \" .$value .\"\\n\\n\"; \r\n\t\t\t\t\t//} \r\n\t\t\t\t\t\r\n\t\t\t\t\t//mail($email, \"Live-INVALID IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t\t$f_result = array( false, $_POST );\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t \r\n\t\t\tfclose ($fp); \r\n\t\t}\r\n\t\r\n\t\treturn $f_result;\r\n\t}" ]
[ "0.70572996", "0.690641", "0.6697218", "0.6672535", "0.6670277", "0.6078703", "0.5990067", "0.5983911", "0.59212637", "0.58231366", "0.5800892", "0.56421924", "0.56316406", "0.56141484", "0.5591103", "0.5555254", "0.5522475", "0.5508676", "0.5505245", "0.5503398", "0.5423944", "0.5420299", "0.53891534", "0.5386274", "0.5370763", "0.5364909", "0.53173393", "0.5279709", "0.5272837", "0.5236502", "0.5226923", "0.5220796", "0.5218384", "0.5217644", "0.52127725", "0.5211179", "0.52076405", "0.5200276", "0.5189542", "0.51811755", "0.5156838", "0.5156499", "0.5155395", "0.51346016", "0.5134059", "0.5117296", "0.5115585", "0.5111352", "0.5096236", "0.5089091", "0.50853485", "0.5055867", "0.5044869", "0.5044396", "0.5028962", "0.5027763", "0.5015581", "0.50066376", "0.5003685", "0.49974498", "0.49966538", "0.49857286", "0.49841413", "0.49728772", "0.49712023", "0.4965935", "0.49578768", "0.49568486", "0.49533996", "0.49474144", "0.4943499", "0.49367574", "0.49318433", "0.4928092", "0.49211717", "0.49149746", "0.49133864", "0.49112397", "0.49079987", "0.49076036", "0.48991537", "0.48960438", "0.4892448", "0.48907462", "0.48842406", "0.48787245", "0.48742604", "0.48739126", "0.48691607", "0.48565993", "0.48521072", "0.4848131", "0.4846092", "0.48273402", "0.48239303", "0.48220778", "0.48210204", "0.48205522", "0.48202214", "0.48165798" ]
0.64371145
5
This function will take NVPString and convert it to an Associative Array and it will decode the response. It is useful to search for a particular key and displaying arrays.
private function deformatNVP($nvpstr) { $intial=0; $nvpArray = array(); while(strlen($nvpstr)){ //position of Key $keypos= strpos($nvpstr,'='); //position of value $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr); /*getting the Key and Value values and storing in a Associative Array*/ $keyval=substr($nvpstr, $intial, $keypos); $valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1); //decoding the response $nvpArray[urldecode($keyval)] = urldecode($valval); $nvpstr = substr($nvpstr, $valuepos+1, strlen($nvpstr)); } return $nvpArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function deformatNVP($nvpstr){\r\n \r\n $intial=0;\r\n $nvpArray = array(); \r\n \r\n while(strlen($nvpstr)){\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n \r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr){\n\t\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\t\n\t\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($nvpstr)\r\n {\r\n $intial=0;\r\n $nvpArray = array();\r\n\r\n while(strlen($nvpstr))\r\n {\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n\r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr)\n\t{\n\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\n\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t }\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($smsstr){ \n \n $intial=0; \n $smsArray = array(); \n \n \n while(strlen($smsstr)){ \n //postion of Key \n $keypos= strpos($smsstr,'='); \n //position of value \n $valuepos = strpos($smsstr,'&') ? strpos($smsstr,'&'): strlen($smsstr); \n \n /*getting the Key and Value values and storing in a Associative Array*/ \n $keyval=substr($smsstr,$intial,$keypos); \n $valval=substr($smsstr,$keypos+1,$valuepos-$keypos-1); \n //decoding the respose \n $smsArray[urldecode($keyval)] =urldecode( $valval); \n $smsstr=substr($smsstr,$valuepos+1,strlen($smsstr)); \n } \n return $smsArray; \n }", "private function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n\n while(strlen($nvpstr))\n {\n //postion of Key\n $keypos= strpos($nvpstr,'=');\n //position of value\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr,$intial,$keypos);\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n }\n return $nvpArray;\n }", "public function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n \n \n while (strlen($nvpstr)) {\n //postion of Key\n $keypos= strpos($nvpstr, '=');\n //position of value\n $valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&'): strlen($nvpstr);\n \n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr, $intial, $keypos);\n $valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode($valval);\n $nvpstr=substr($nvpstr, $valuepos+1, strlen($nvpstr));\n }\n return $nvpArray;\n }", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "function deformat_nvp($nvpstr)\n\t{\n\t\t$intial=0;\n\t\t$nvparray = array();\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvparray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvparray;\n\t}", "function oAuthParseResponse($responseString) {\n\t\t$r = array ();\n\t\tforeach ( explode ( '&', $responseString ) as $param ) {\n\t\t\t$pair = explode ( '=', $param, 2 );\n\t\t\tif (count ( $pair ) != 2)\n\t\t\t\tcontinue;\n\t\t\t$r [urldecode ( $pair [0] )] = urldecode ( $pair [1] );\n\t\t}\n\t\treturn $r;\n\t}", "private function _readNvp($string)\r\n\t{\r\n\t\twhile (strlen($string))\r\n\t\t{\r\n\t\t\t$keypos = strpos($string, '=');\r\n\t\t\t$valuepos = strpos($string, '&') ? strpos($string, '&') : strlen($string);\r\n\t\t\t$nvp_array[urldecode(substr($string, 0, $keypos))] = urldecode(substr($string, $keypos + 1, $valuepos - $keypos - 1));\r\n\t\t\t$string = substr($string, $valuepos + 1, strlen($string));\r\n\t\t}\r\n\r\n\t\treturn $nvp_array;\r\n\t}", "private static function strToArray($nvp)\r\n\t {\r\n\t\t $temp_array = array();\r\n\t\t $nvp = explode('&' , trim($nvp , '&'));\r\n\t\t foreach($nvp as $value)\r\n\t\t {\r\n if (empty($value)) continue;\r\n\t\t\t $temp_array2 = explode('=' , $value);\r\n\t\t\t if (empty($temp_array2[1])) continue;\r\n\t\t\t $temp_array[$temp_array2[0]] = $temp_array2[1];\r\n\t\t }\r\n\t\t return $temp_array;\r\n\t }", "abstract public static function decode($string): array;", "function icedrive_response_to_array($response)\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = simplexml_load_string(str_replace(':', '', $response));\r\n $xml = json_encode($xml);\r\n $xml = json_decode($xml, true);\r\n return $xml;\r\n }", "public function FormatPDTResponseInAssociativeArray($pdtMessage)\n {\n $pdtMessage = urldecode(substr($pdtMessage, 7));\n \n // Convert text response to associative array\n $out = [];\n preg_match_all('/^([^=\\s]++)=(.*+)/m', $pdtMessage, $out, PREG_PATTERN_ORDER);\n $msgInAssocArray = array_combine($out[1], $out[2]);\n ksort($msgInAssocArray);\n\treturn $msgInAssocArray;\n }", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function deformatNVP( $nvpstr ) {\r\n\t\t\tparse_str( $nvpstr, $nvpArray );\r\n\r\n\t\t\treturn $nvpArray;\r\n\t\t}", "public function associativeStringArrayValue($key);", "private function parse($body)\n {\n parse_str($body, $response_array);\n $response = array();\n foreach ($response_array as $k => $v) {\n $key = str_replace('VP', '', $k);\n $response[$key] = $v;\n }\n\n return $response;\n }", "function decodeKeyValuePair($pair)\n{\n\t$operators = array(\"==\", \"!=\", \"<>\", \">=\", \"<=\", \"=\", \"<\", \">\");\n\n\tstatic $s_regex = null;\n\tif ($s_regex === null)\n\t{\n\t\t$s_regex = '/'.implode('|', array_map('preg_quote', $operators)).'/';\n\t}\n\n\tlist($key, $value) = preg_split($s_regex, $pair);\n\n\treturn array($key => stripQuotes($value));\n}", "function parseAssoc($returnArray, $key, $haystack) { //simple parse of url style concatenations & as delimiter = as key = value;\n\t$associations = explode(\"&\", $haystack);\n\tforeach ($associations as $association) {\n\t\t$assoc = explode(\"=\", $association);\n\t\tif (isset($assoc[1])) { //was there a key/value pair\n\t\t\tif (is_array($assoc[1])) { $returnArray[$key][$assoc[0]] = implode('',$assoc[1]); } //if array (happens with textarea)\n\t\t\telse { $returnArray[$key][$assoc[0]] = $assoc[1]; }\n\t\t}\n\t}\n\treturn($returnArray);\n}", "function parseResponse($response) {\r\n\t\t$begin = 0;\r\n\t\t$end = 0;\r\n\t\t$start = null;\r\n\t\t$value = null;\r\n\t\t$map;\r\n\t\t// responseMap = new HashMap();\r\n\t\t$response = trim ( $response );\r\n\t\t$pos = strpos ( $response, \"<\" ) == 0;\r\n\t\tif ($response == null || (strlen ( $response ) < 0) || $pos === false) {\r\n\t\t\t// // echo \"returned\";\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\t// // echo \"else \";\r\n\t\t\tdo {\r\n\t\t\t\t\r\n\t\t\t\tif ((strpos ( $response, '<' ) !== false) && (strpos ( $response, '>' ) !== false)) {\r\n\t\t\t\t\t$start = substr ( $response, ($ind = strpos ( $response, \"<\" )) + 1, ((strpos ( $response, \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t$mapKey = substr ( $response, ($ind = strpos ( $response, \">\" )) + 1, ((strpos ( $response, \"</\" . $start . \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t// // echo \"<br/> strrsdfdpos\".(strrpos($response,\">\"));\r\n\t\t\t\t\t$response = substr ( $response, $from = strpos ( $response, \"</\" . $start . \">\" ) + strlen ( $start ) + 3, strrpos ( $response, \">\" ) - $from + 1 );\r\n\t\t\t\t\t// // echo \"<br/> from \".$from;\r\n\t\t\t\t\t// // echo \"<br/> start------- \".$start;\r\n\t\t\t\t\t// // echo \"--------\".$mapKey;\r\n\t\t\t\t\t$maps [$start] = $mapKey;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// // echo \"------ response====\".htmlspecialchars($response).\"<br/>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// // echo \"here\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} while ( strlen ( $response ) > 0 );\r\n\t\t}\r\n\t\t\r\n\t\t// // echo \"<br/>MAPPPPPPPS \".var_dump($maps);\r\n\t\treturn $maps;\r\n\t}", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "function parse_oid2($string)\n{\n $result = array();\n $matches = array();\n\n // Match OID - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ' ' (space) or '[' - Other escaping is optional\n $match_count = preg_match('/^(?:((?!\")(?:[^\\\\\\\\\\\\[ ]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n\n // Match indexes (optional) - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ']' - Other escaping is optional\n while (true)\n {\n $match_count = preg_match('/^\\\\[(?:((?!\")(?:[^\\\\\\\\\\\\]]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))\\\\]/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n }\n else\n {\n break;\n }\n } // while\n\n // Match value - Skips leading ' ' characters - If remainder is wrapped in double-quotes ('\"'), must escape '\"', other escaping is optional\n $match_count = preg_match('/^\\\\s+(?:((?!\")(?:[^\\\\\\\\]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))$/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n\n $result[] = stripslashes($value);\n\n if (strlen($string) != strlen($matches[0])) { echo \"Length error!\"; return null; }\n\n return $result;\n }\n }\n\n // All or nothing\n return null;\n}", "public function get_assoc()\n {\n $out = array('name' => $this->displayname);\n $typemap = $this->typemap;\n\n // copy name fields to output array\n foreach (array('firstname','surname','middlename','nickname','organization') as $col) {\n if (strlen($this->$col)) {\n $out[$col] = $this->$col;\n }\n }\n\n if ($this->raw['N'][0][3])\n $out['prefix'] = $this->raw['N'][0][3];\n if ($this->raw['N'][0][4])\n $out['suffix'] = $this->raw['N'][0][4];\n\n // convert from raw vcard data into associative data for Roundcube\n foreach (array_flip(self::$fieldmap) as $tag => $col) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n if (is_array($raw)) {\n $k = -1;\n $key = $col;\n $subtype = '';\n\n if (!empty($raw['type'])) {\n $combined = join(',', self::array_filter((array)$raw['type'], 'internet,pref', true));\n $combined = strtoupper($combined);\n\n if ($typemap[$combined]) {\n $subtype = $typemap[$combined];\n }\n else if ($typemap[$raw['type'][++$k]]) {\n $subtype = $typemap[$raw['type'][$k]];\n }\n else {\n $subtype = strtolower($raw['type'][$k]);\n }\n\n while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) {\n $subtype = $typemap[$raw['type'][++$k]] ?: strtolower($raw['type'][$k]);\n }\n }\n\n // read vcard 2.1 subtype\n if (!$subtype) {\n foreach ($raw as $k => $v) {\n if (!is_numeric($k) && $v === true && ($k = strtolower($k))\n && !in_array($k, array('pref','internet','voice','base64'))\n ) {\n $k_uc = strtoupper($k);\n $subtype = $typemap[$k_uc] ?: $k;\n break;\n }\n }\n }\n\n // force subtype if none set\n if (!$subtype && preg_match('/^(email|phone|address|website)/', $key)) {\n $subtype = 'other';\n }\n\n if ($subtype) {\n $key .= ':' . $subtype;\n }\n\n // split ADR values into assoc array\n if ($tag == 'ADR') {\n list(,, $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']) = $raw;\n $out[$key][] = $value;\n }\n else {\n $out[$key][] = $raw[0];\n }\n }\n else {\n $out[$col][] = $raw;\n }\n }\n }\n\n // handle special IM fields as used by Apple\n foreach ($this->immap as $tag => $type) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n $out['im:'.$type][] = $raw[0];\n }\n }\n\n // copy photo data\n if ($this->raw['PHOTO']) {\n $out['photo'] = $this->raw['PHOTO'][0][0];\n }\n\n return $out;\n }", "function StrToArray($Qstr)\r\n\t{\r\n\t$finalArr=array();\r\n\t\t\r\n\t\t$qryArr=split(\"&\",$Qstr);\r\n\t\t\r\n\t\t\tif(!empty($Qstr))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\tforeach($qryArr as $item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Qarr=split(\"=\",$item);\r\n\t\t\t\t\tif(count($Qarr)==2)\r\n\t\t\t\t\t$finalArr[$Qarr[0]]=$Qarr[1];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $finalArr;\r\n\t\t\t}\r\n\t}", "private function decode($str) {\n if ($this->return_assoc) {\n return json_decode($str, true);\n }\n\n return json_decode($str);\n }", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "private static function vcard_decode($vcard)\n {\n // Perform RFC2425 line unfolding and split lines\n $vcard = preg_replace(array(\"/\\r/\", \"/\\n\\s+/\"), '', $vcard);\n $lines = explode(\"\\n\", $vcard);\n $result = array();\n\n for ($i=0; $i < count($lines); $i++) {\n if (!($pos = strpos($lines[$i], ':'))) {\n continue;\n }\n\n $prefix = substr($lines[$i], 0, $pos);\n $data = substr($lines[$i], $pos+1);\n\n if (preg_match('/^(BEGIN|END)$/i', $prefix)) {\n continue;\n }\n\n // convert 2.1-style \"EMAIL;internet;home:\" to 3.0-style \"EMAIL;TYPE=internet;TYPE=home:\"\n if ($result['VERSION'][0] == \"2.1\"\n && preg_match('/^([^;]+);([^:]+)/', $prefix, $regs2)\n && !preg_match('/^TYPE=/i', $regs2[2])\n ) {\n $prefix = $regs2[1];\n foreach (explode(';', $regs2[2]) as $prop) {\n $prefix .= ';' . (strpos($prop, '=') ? $prop : 'TYPE='.$prop);\n }\n }\n\n if (preg_match_all('/([^\\\\;]+);?/', $prefix, $regs2)) {\n $entry = array();\n $field = strtoupper($regs2[1][0]);\n $enc = null;\n\n foreach($regs2[1] as $attrid => $attr) {\n $attr = preg_replace('/[\\s\\t\\n\\r\\0\\x0B]/', '', $attr);\n if ((list($key, $value) = explode('=', $attr)) && $value) {\n if ($key == 'ENCODING') {\n $value = strtoupper($value);\n // add next line(s) to value string if QP line end detected\n if ($value == 'QUOTED-PRINTABLE') {\n while (preg_match('/=$/', $lines[$i])) {\n $data .= \"\\n\" . $lines[++$i];\n }\n }\n $enc = $value == 'BASE64' ? 'B' : $value;\n }\n else {\n $lc_key = strtolower($key);\n $entry[$lc_key] = array_merge((array)$entry[$lc_key], (array)self::vcard_unquote($value, ','));\n }\n }\n else if ($attrid > 0) {\n $entry[strtolower($key)] = true; // true means attr without =value\n }\n }\n\n // decode value\n if ($enc || !empty($entry['base64'])) {\n // save encoding type (#1488432)\n if ($enc == 'B') {\n $entry['encoding'] = 'B';\n // should we use vCard 3.0 instead?\n // $entry['base64'] = true;\n }\n\n $data = self::decode_value($data, $enc ?: 'base64');\n }\n else if ($field == 'PHOTO') {\n // vCard 4.0 data URI, \"PHOTO:data:image/jpeg;base64,...\"\n if (preg_match('/^data:[a-z\\/_-]+;base64,/i', $data, $m)) {\n $entry['encoding'] = $enc = 'B';\n $data = substr($data, strlen($m[0]));\n $data = self::decode_value($data, 'base64');\n }\n }\n\n if ($enc != 'B' && empty($entry['base64'])) {\n $data = self::vcard_unquote($data);\n }\n\n $entry = array_merge($entry, (array) $data);\n $result[$field][] = $entry;\n }\n }\n\n unset($result['VERSION']);\n\n return $result;\n }", "private static function arrayToStr($nvp)\r\n\t {\r\n\t\t $temp_str = '';\r\n\t\t if (!is_array($nvp)) return $nvp;\r\n\t\t foreach ($nvp as $key => $value)\r\n\t\t {\r\n\t\t\t $temp_str .= $key.'='.$value.'&';\r\n\t\t }\r\n\t\t return rtrim($temp_str , '&');\r\n\t }", "function s2o( $str, $assoc = false ) {\n\t\treturn json_decode( $str, $assoc );\n\t}", "private function getNVP() {\n $post = '';\n foreach($this->NVP as $key=>$value) { \n $post .= \"$key=\" . urlencode($value) . \"&\";\n }\n return (string)rtrim($post, \"& \");\n }", "public function key_value_from_string( $text = '' ) {\n\t\tpreg_match( '/([^:]+)(;[^:]+)?[:]([\\w\\W]*)/', $text, $matches );\n\n\t\tif ( 0 == count( $matches ) )\n\t\t\treturn false;\n\n\t\treturn array( $matches[1], $matches[3] );\n\t}", "function to_json_array($stg){\n $result = str_replace(\"[\",\"\",$stg);\n $result = str_replace(\"]\",\"\",$result);\n $details_array = json_decode($result, true);\n return $details_array;\n}", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "function answersArray($strInput)\t{\n\t\t$strLine=explode(chr(10),$strInput);\n\t\tforeach($strLine as $intKey => $strLineValue)\t{\n\t\t\t$strValue = explode('|',$strLineValue);\n\t\t\t$arrOutput[$intKey+1]=trim($strValue[0]);\n\t\t}\n\t\treturn $arrOutput;\n\t}", "abstract public function toAssoc(): array;", "protected function translateIpnData($ipnData)\n {\n if (empty($ipnData)) {\n $ipnData = array();\n } elseif (is_string($ipnData) && strpos($ipnData, '{') !== false) {\n $ipnData = Zend_Json::decode($ipnData);\n } elseif (is_string($ipnData)) {\n $ipnData = array($ipnData);\n }\n\n return $ipnData;\n }", "public function decode($array = null)\n {\n foreach($array as $name => $value) {\n if(is_array($value)) {\n $value = Mage::helper('vm2mage')->decode($value);\n } elseif(!empty($value) && preg_match('/^V2M___/', $value)) {\n $value = preg_replace('/^V2M___/', '', $value);\n $value = base64_decode($value);\n }\n\n if(!empty($value)) {\n $array[$name] = $value;\n }\n }\n return $array;\n }", "static function VocabDataFromXML($rawResponse)\n {\n $xml = simplexml_load_string($rawResponse);\n $xml->registerXPathNamespace('wc', 'urn:com.microsoft.wc.methods.response.SearchVocabulary');\n $codeItemsXMLObjects = $xml->xpath('//code-item');\n\n $vocabData = [];\n\n foreach ($codeItemsXMLObjects as $item) {\n $newEntry['name'] = (string)$item->{'display-text'};\n $newEntry['code-value'] = (string)$item->{'code-value'};\n $vocabData[] = $newEntry;\n }\n\n return $vocabData;\n }", "private function returnKeyValuePair($line) {\n\t//--\n\t$array = array();\n\t$key = '';\n\t//--\n\tif(strpos($line, ':') !== false) {\n\t\t// It's a key/value pair most likely\n\t\t// If the key is in double quotes pull it out\n\t\tif(($line[0] == '\"' || $line[0] == \"'\") && preg_match('/^([\"\\'](.*)[\"\\'](\\s)*:)/', $line, $matches)) {\n\t\t\t$value = trim(str_replace($matches[1], '', $line));\n\t\t\t$key = $matches[2];\n\t\t} else {\n\t\t\t// Do some guesswork as to the key and the value\n\t\t\t$explode = explode(':', $line);\n\t\t\t$key = trim($explode[0]);\n\t\t\tarray_shift($explode);\n\t\t\t$value = trim(implode(':', $explode));\n\t\t} //end if else\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\tif($key === '0') {\n\t\t\t$key = '__!YAMLZero';\n\t\t} //end if\n\t\t$array[$key] = $value;\n\t} else {\n\t\t$array = array ($line);\n\t} //end if else\n\t//--\n\treturn $array;\n\t//--\n}", "function _ra_decode ($value)\n {\n //_ra_decode supports decoding entire Arrays\n\n if (is_array($value)) {\n $temp_array = array();\n foreach ($value as $key => $val) {\n if ($this->sess_encryption) {\n $temp_array[$key] = $this->_ra_decode($val);\n } else {\n $temp_array[$key] = $val;\n }\n }\n return $temp_array;\n }\n if ($this->sess_encryption && is_string($value)) {\n $value = $this->CI->encrypt->decode($value);\n return $value;\n }\n return $value;\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "function _xmlToArray($rootTag, $sXml)\n\t{\n\t\t$aArray = array();\n\t\t$sXml = str_replace(\"<$rootTag>\",\"<$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</$rootTag>\",\"</$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<e>\",\"<e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</e>\",\"</e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<k>\",\"<k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</k>\",\"|~|</k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<v>\",\"<v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</v>\",\"|~|</v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<q>\",\"<q>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</q>\",\"|~|</q>|~|\",$sXml);\n\n\t\t$this->aObjArray = explode(\"|~|\",$sXml);\n\n\t\t$this->iPos = 0;\n\t\t$aArray = $this->_parseObjXml($rootTag);\n\n\t\tif ($this->bDecodeUTF8Input)\n\t\t{\n\t\t\tforeach ($aArray as $sKey => $sValue)\n\t\t\t{\n\t\t\t\t$aArray[$sKey] = $this->_decodeUTF8Data($sValue);\n\t\t\t}\n\t\t}\n\n\t\treturn $aArray;\n\t}", "function unpack_SNAC($raw) {\r\n $snac = array(\r\n 'raw' => array(\r\n 'header' => substr($raw, 0, 10),\r\n 'body' => substr($raw, 10)\r\n ),\r\n 'header' => array()\r\n );\r\n $snac['header'] = unpack('n1family/n1id/n1flags/N1req_id', $snac['raw']['header']);\r\n return $snac;\r\n }", "public function parse_str_raw($str, &$array=array()) {\n\t\t$str = rawurldecode($str);\n\t\t$str = trim($str, $sep1.' ');\n\t\t$arr = explode($sep1, $str);\n\t\t\n\t\t$result = array();\n\t\tif (count($arr)) {\n\t\t\tforeach ($arr AS $_str) {\n\t\t\t\t$_arr = explode($sep2, $_str);\n\t\t\t\t$_arr[0] = trim($_arr[0]);\n\t\t\t\tif ($_arr[0] !== '') {\n\t\t\t\t\t$result[$_arr[0]] = isset($_arr[1])?trim($_arr[1]):'';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$array = $result;\n\t}", "function stringtoarray($string) {\r\n\t/**\r\n\t * Probamos que sea un array sin comprimir\r\n\t */\r\n\tif (is_string($string)) {\r\n\t\tif (strstr($string, 'array')) {\r\n\t\t\teval(\"\\$arrayAux = $string;\");\r\n\t\t\treturn $arrayAux;\r\n\t\t}\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "private function parserString($producString){\n $arrayProduc = preg_split(\"/[\\t]/\", $producString);\n \n $initDate = $this->createDataTime($arrayProduc[3]);\n $expiryDate = $this->createDataTime($arrayProduc[4]);\n \n $producData = array(\n \"title\" => $arrayProduc[0],\n \"description\" => $arrayProduc[1],\n \"price\" => $arrayProduc[2],\n \"init\" => $initDate,\n \"expiry\" => $expiryDate,\n \"address\" => $arrayProduc[5],\n \"name\" => $arrayProduc[6],\n \"textOrigiin\" => $producString\n );\n \n return $producData;\n }", "public function parse(string $string): array;", "function decode($string);", "function xml2array($xml_string)\n {\n return \\Findforsikring\\Support\\Converters::xml2Array($xml_string);\n }", "function protx_vsp_get_associative_array($separator, $input)\n\t{\n\t\tfor ($i=0; $i < count($input); $i++) {\n\t\t\t$splitAt = strpos($input[$i], $separator);\n\t\t\t$output[trim(substr($input[$i], 0, $splitAt))] = trim(substr($input[$i], ($splitAt+1)));\n\t\t}\n\t\treturn $output;\n\t}", "protected function processFrom(string $string): array\n {\n return \\json_decode($string, true);\n }", "function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}", "abstract function parse_api_response();", "protected function parseAdlibResponse() {\n $xml = new SimpleXMLElement($this->raw);\n $results = $xml->xpath('//record');\n $docs = array();\n foreach ($results as $result) {\n $doc = array();\n foreach ($this->fields as $field) {\n // check if we have multiple values\n $children = $this->getGroupedFieldByXpath($result, $field);\n // $children = $result->{$field}->children();\n if(empty($children)) {\n continue;\n }\n if (count($children) > 1) {\n $field_array = array();\n // get all values\n foreach ($children as $value) {\n if ((string) $value != '' && (string) $value != 'Array') {\n $field_array[] = $this->replaceTokenCharacters((string) $value);\n }\n else {\n $field_array[] = $this->replaceTokenCharacters((string) $value->value);\n }\n }\n // and put the resulting array in $doc[$field]\n $doc[$field] = $field_array;\n }\n else {\n // single value\n // First try if there is a result without value.\n if ((string) $children[0] !== '' && (string) $children[0] !== 'Array') {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]);\n }\n else {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]->value);\n }\n }\n }\n $doc['priref'] = (string) $xml->record->attributes()->priref;\n $doc['raw_xml'] = $result->asXML();\n $docs[] = $doc;\n }\n return $docs;\n }", "public function parseSearchString(){\n\t\t$searchData = array();\n\t\tif($this->tblAdministratorSearchString){\n\t\t\t$obj = json_decode($this->tblAdministratorSearchString);\n\t\t\tif($obj){\n\t\t\t\tif(!empty($obj->{'search_name'})){\n\t\t\t\t\t$nameData = array();\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_TEXT'];\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_name'};\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = 'name';\n\t\t\t\t\t$searchData[] = $nameData;\n }\n\t\t\t\t\n if(!empty($obj->{'search_order'})){\n\t\t\t\t\t$orderData = array();\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_NUMBER'];\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_order'};\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = '`'.'order'.'`';\n\t\t\t\t\t$searchData[] = $orderData;\n }\n\t\n\t\t\t\tif(!empty($obj->{'search_status'})){\n\t\t\t\t\t$statusData = array();\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_BOOL'];\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_status'};\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = 'active';\n\t\t\t\t\t$searchData[] = $statusData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $searchData;\n\t}", "function bdec_dict($s) {\n\tif ($s[0] != \"d\")\n\treturn;\n\t$sl = strlen($s);\n\t$i = 1;\n\t$v = array();\n\t$ss = \"d\";\n\tfor (;;) {\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\tif ($s[$i] == \"e\")\n\t\tbreak;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret) || $ret[\"type\"] != \"string\")\n\t\treturn;\n\t\t$k = $ret[\"value\"];\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret))\n\t\treturn;\n\t\t$v[$k] = $ret;\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t}\n\t$ss .= \"e\";\n\treturn array('type' => \"dictionary\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n}", "public function fromString(string $string): array;", "public function getArrayAssociativeKey() {\n preg_match(\"/\\[(.*?)]/\", $this->getShortType(), $matches);\n if (sizeof($matches) > 1) {\n return $matches[1];\n }\n }", "function processResponse($strResponse) {\n\t\tlist($theHeaders, $theBody) = explode(\"\\r\\n\\r\\n\", $strResponse, 2);\n\t\treturn array('headers' => $theHeaders, 'body' => $theBody);\n\t}", "public function jsonToArray( $string )\n {\n return json_decode( $string, true );\n }", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getResponse() : array;", "public function parseDataForKey($fullKey)\n {\n $arrayOfStrings = $this->appListStrings;\n $keys = explode('.', $fullKey);\n foreach ($keys as $key) {\n if (isset($arrayOfStrings[$key])) {\n $arrayOfStrings = $arrayOfStrings[$key];\n } else {\n throw new \\SugarRestHarness\\RandomDataKeyIsInvalid($fullKey, $key);\n }\n }\n \n if (!empty($arrayOfStrings)) {\n if (is_array($arrayOfStrings)) {\n return $arrayOfStrings;\n } else {\n return array($arrayOfStrings);\n }\n } else {\n return array();\n }\n }", "function prli_json_decode(&$json_str,$type='array',$index = 0)\n {\n $json_array = array();\n $index_str = '';\n $value_str = '';\n $in_string = false;\n $in_index = ($type=='hash'); //first char in hash is an index\n $in_value = ($type=='array'); //first char in array is a value\n\n $json_special_chars_array = array('{','[','}',']','\"',',',':');\n\n // On the first pass we need to do some special stuff\n if($index == 0)\n {\n if($json_str[$index] == '{')\n {\n $type = 'hash';\n $in_index = true;\n $in_value = false;\n }\n else if($json_str[$index]=='[')\n {\n $type = 'array';\n $in_index = false;\n $in_value = true;\n }\n else\n return false; // not valid json\n\n // skip to next index\n $index++;\n }\n\n for($i = $index; $i < strlen($json_str); $i++)\n {\n if($in_string and in_array($json_str[$i],$json_special_chars_array))\n {\n if($json_str[$i] == '\"')\n $in_string = false;\n else\n {\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n else\n {\n switch($json_str[$i])\n {\n case '{':\n $array_vals = $this->prli_json_decode($json_str,'hash',$i + 1);\n\n if($type=='hash')\n $json_array[$index_str] = $array_vals[1]; // We'll never get an array as an index\n else if($type=='array')\n $json_array[] = $array_vals[1];\n\n $i = $array_vals[0]; // Skip ahead to the new index\n break;\n\n case '[':\n $array_vals = $this->prli_json_decode($json_str,'array',$i + 1);\n\n if($type=='hash')\n $json_array[$index_str] = $array_vals[1];\n else if($type=='array')\n $json_array[] = $array_vals[1];\n\n $i = $array_vals[0]; // Skip ahead to the new index\n break;\n\n case '}':\n if(!empty($index_str) and !empty($value_str))\n {\n $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);\n $index_str = '';\n $value_str = '';\n }\n return array($i,$json_array);\n\n case ']':\n if(!empty($value_str))\n {\n $json_array[] = $this->prli_decode_json_unicode($value_str);\n $value_str = '';\n }\n return array($i,$json_array);\n\n // skip the null character\n case '\\0':\n break;\n\n // Handle Escapes\n case '\\\\':\n if($in_string)\n {\n if(in_array($json_str[$i + 1],$json_special_chars_array))\n {\n if($in_value)\n $value_str .= '\\\\'.$json_str[$i + 1];\n else if($in_index)\n $index_str .= '\\\\'.$json_str[$i + 1];\n\n $i++; // skip the escaped char now that its been recorded\n }\n else\n {\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n break;\n\n case '\"':\n $in_string = !$in_string; // just tells us if we're in a string\n break;\n\n case ':':\n if($type == 'hash')\n {\n $in_value = true;\n $in_index = false;\n }\n break;\n\n case ',':\n if($type == 'hash')\n {\n if(!empty($index_str) and !empty($value_str))\n {\n $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);\n $index_str = '';\n $value_str = '';\n }\n\n $in_index = true;\n $in_value = false;\n }\n else if($type == 'array')\n {\n if(!empty($value_str))\n {\n $json_array[] = $this->prli_decode_json_unicode($value_str);\n $value_str = '';\n }\n\n $in_value = true;\n $in_index = false; // always false in an array\n }\n break;\n\n // record index and value\n default:\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n }\n\n return array(-1,$json_array);\n }", "function vcex_vc_param_group_parse_atts( $atts_string ) {\n\tif ( function_exists( 'vc_param_group_parse_atts' ) ) {\n\t\treturn vc_param_group_parse_atts( $atts_string );\n\t}\n\t$array = json_decode( urldecode( $atts_string ), true );\n\treturn $array;\n}", "private function unserializeInvoices($str) {\n\t\t$invoices = array();\n\t\t$temp = explode(\"|\", $str);\n\t\tforeach ($temp as $pair) {\n\t\t\t$pairs = explode(\"=\", $pair, 2);\n\t\t\tif (count($pairs) != 2)\n\t\t\t\tcontinue;\n\t\t\t$invoices[] = array('id' => $pairs[0], 'amount' => $pairs[1]);\n\t\t}\n\t\treturn $invoices;\n\t}", "function decode($value,$key){\n \techo \"$key : $value\".\"\\n\";\n }", "private function retun_key_value($text)\n\t{\n\tpreg_match(\"/([^:]+)[:]([\\w\\W]+)/\", $text, $matches);\n\n\tif (empty($matches))\n\t{\n\t\treturn [false, $text];\n\t}\n\telse\n\t{\n\t\t$matches = array_splice($matches, 1, 2);\n\t\treturn $matches;\n\t}\n\t}", "function parseAbstractString($string) {\r\n\t$array_ensembe = array();\r\n\t$ensembles = explode(';', $string);\r\n\tforeach($ensembles as $k=>$ensemble) {\r\n\t\tlist($ensemble_valeur, $valeurs) = explode(':', $ensemble);\r\n\t\t$array_ensembe[$k]['ensemble'] = $ensemble_valeur;\r\n\t\t$valeurs = explode(',', $valeurs);\r\n\t\t$array_ensembe[$k]['valeurs'] = array();\r\n\t\tforeach($valeurs as $j=>$valeur) {\r\n\t\t\tlist($array_ensembe[$k]['valeurs'][$j]['titre'], $array_ensembe[$k]['valeurs'][$j]['nom'], $type) = explode('|', $valeur);\r\n\t\t\tlist($type, $array_ensembe[$k]['valeurs'][$j]['defaut']) = explode('(', $type);\r\n\t\t\tlist($type, $enum) = explode('[', $type);\r\n\t\t\tif (!empty($enum)) $array_ensembe[$k]['valeurs'][$j]['enum'] = explode('/', $enum);\r\n\t\t\t$array_ensembe[$k]['valeurs'][$j]['type'] = $type;\r\n\t\t}\r\n\t}\r\n\treturn $array_ensembe;\r\n}", "function vcex_string_to_array( $value = array() ) {\n\n\tif ( empty( $value ) && is_array( $value ) ) {\n\t\treturn null;\n\t}\n\n\tif ( ! empty( $value ) && is_array( $value ) ) {\n\t\treturn $value;\n\t}\n\n\t$items = preg_split( '/\\,[\\s]*/', $value );\n\n\tforeach ( $items as $item ) {\n\t\tif ( strlen( $item ) > 0 ) {\n\t\t\t$array[] = $item;\n\t\t}\n\t}\n\n\treturn $array;\n\n}", "#[ArrayShape([\"bits\" => \"int\", \"key\" => \"string\", \"rsa\" => \"array\", \"dsa\" => \"array\", \"dh\" => \"array\", \"type\" => \"int\"])]\nfunction openssl_pkey_get_details(#[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLAsymmetricKey\"], default: \"resource\")] $key): array|false {}", "function MesiboParseResponse($response) {\n\t$result = json_decode($response, true);\n\tif(is_null($result)) \n\t\treturn false;\n\treturn $result;\n}", "function deCadenaToArrayOpcionesCarrito( $string ){\n\t\t$options = array();\n\t\t$temp = explode('{',$string);\n\t\tfor( $i=1 ; $i<count($temp); $i++ ){\n\t\t\t$k = explode('}',$temp[$i]);\n\t\t\t$options[(int)$temp[$i]] = end($k);\n\t\t}\n\t\treturn $options;\n\t}", "public static function decode($string);", "public function getAuthDataFromResponse(): array;", "function parse_oid($string)\n{\n $result = array();\n while (true)\n {\n $matches = array();\n $match_count = preg_match('/^(?:((?:[^\\\\\\\\\\\\. \"]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))((?:[\\\\. ])|$)/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // Are we expecting any more parts?\n if (strlen($matches[3]) > 0)\n {\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n }\n else\n {\n $ret['value'] = array_pop($result);\n $ret['oid'] = $result;\n return $ret;\n }\n }\n else\n {\n // All or nothing\n return null;\n }\n } // while\n}", "function array_iconv(&$val, $key, $userdata)\n{\n\t$val = mb_convert_encoding($val,$userdata[1],$userdata[0]);\n\t//audit(serialize($userdata),'error');\n}", "public function decode($response);", "private function parse_result(){\n return json_decode($this->result);\n }", "public static function getJSONResponseToArray($string)\n {\n $json = json_decode($string,true);\n if($json !== NULL) {\n return $json;\n }\n else {\n throw new Exception('Response is not a valid json string.');\n }\n }", "public function fromString($string)\n {\n if (empty($string)) {\n return array();\n }\n\n return \\Zend\\Json\\Json::decode(\n $string,\n \\Zend\\Json\\Json::TYPE_ARRAY\n );\n }", "private function specImgParseArray($sSpecImg)\n {\n $aSpecImg = explode(';',$sSpecImg);\n $aData = array();\n foreach ( $aSpecImg as $v ) {\n $aSpecImgArr = explode(':',$v);\n $aData[$aSpecImgArr[0]] = $aSpecImgArr[1];\n }\n return $aData;\n }", "private function parseCert($pemCertificateFileName){\n if (empty($pemCertificateFileName)){\n throw new Exception(\"Given param PEMCERTIFICATEFILENAME can not be empty.\");\n }\n\n $r = array(\n \"serial\" => \"\",\n \"version\" => \"\",\n \"valid_from\" => \"\",\n \"valid_to\" => \"\",\n \"subject\" => array(\n \"serial\" => \"\",\n \"ou\" => \"\",\n \"o\" => \"\",\n \"cn\" => \"\",\n \"c\" => \"\",\n \"st\" => \"\",\n \"l\" => \"\",\n ),\n \"issuer\" => array(\n \"ou\" => \"\",\n \"o\" => \"\",\n \"cn\" => \"\",\n \"c\" => \"\",\n )\n );\n\n $cmd = sprintf(\"openssl asn1parse -inform PEM -in %s\", $pemCertificateFileName);\n $output = exec($cmd, $fullOutput);\n\n $patternOrganizationName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:organizationName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countOrganizationName = preg_match_all($patternOrganizationName, implode(\"<>\", $fullOutput), $matches);\n if($countOrganizationName == 1){\n $r[\"subject\"][\"o\"] = $matches[2][0];\n } else if($countOrganizationName == 2){\n $r[\"issuer\"][\"o\"] = $matches[2][0];\n $r[\"subject\"][\"o\"] = $matches[2][1];\n }\n\n $patternCountryName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:countryName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countCountryName = preg_match_all($patternCountryName, implode(\"<>\", $fullOutput), $matches);\n if($countCountryName == 1){\n $r[\"subject\"][\"c\"] = $matches[2][0];\n } else if($countCountryName == 2){\n $r[\"issuer\"][\"c\"] = $matches[2][0];\n $r[\"subject\"][\"c\"] = $matches[2][1];\n }\n\n $patternCommonName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:commonName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countCommonName = preg_match_all($patternCommonName, implode(\"<>\", $fullOutput), $matches);\n if($countCommonName == 1){\n $r[\"subject\"][\"cn\"] = $matches[2][0];\n } else if($countCommonName == 2){\n $r[\"issuer\"][\"cn\"] = $matches[2][0];\n $r[\"subject\"][\"cn\"] = $matches[2][1];\n }\n\n $patternSerial= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:serialNumber\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countSerial = preg_match_all($patternSerial, implode(\"<>\", $fullOutput), $matches);\n if($countSerial == 1){\n $r[\"subject\"][\"serial\"] = $matches[2][0];\n }\n\n $patternVersion= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*INTEGER\\s*:([^<>]*)\\s*<>/\";\n $countVersion = preg_match_all($patternVersion, implode(\"<>\", $fullOutput), $matches);\n if($countVersion == 1){\n $r[\"version\"] = $matches[1][0];\n }\n if($countVersion == 2){\n $r[\"version\"] = $matches[1][0];\n $r[\"serial\"] = $matches[1][1];\n }\n\n $patternTime= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*UTCTIME\\s*:([^<>]*)\\s*<>/\";\n $countTime = preg_match_all($patternTime, implode(\"<>\", $fullOutput), $matches);\n if($countTime == 2){\n $r[\"valid_from\"] = $this->parseUTCTime($matches[1][0]);\n $r[\"valid_to\"] = $this->parseUTCTime($matches[1][1]);\n }\n\n return $r;\n }", "public function convert( $param_string ) {\n\t\t(array) $params = json_decode( fusion_decode_if_needed( $param_string ), true );\n\t\treturn $params;\n\t}", "private function extract($String) {\n $string = DB::quote($String);\n $numbers = [];\n\n $updatedString = dictionary($string);\n preg_match_all('!\\d+!', $updatedString, $matches);\n (isset($matches[0][0])) ? $numbers['RSVP']=$matches[0][0] : $numbers['RSVP']='NULL'; // TODO: this returns only the 1st number in the string after dict\n (isset($matches[0][1])) ? $numbers['Uncertin']=$matches[0][1] : $numbers['Uncertin']='NULL'; // TODO: this returns only the 2nd number in the string after dict\n (isset($matches[0][2])) ? $numbers['Ride']=$matches[0][2] : $numbers['Ride']=0; // TODO: this returns only the 3rd number in the string after dict\n ($numbers['Ride'] !=0 ) ? $numbers['Ride']=1 : $numbers['Ride']=0;\n\n (strlen($updatedString)>11) ? $numbers['Complex']=1 : $numbers['Complex']=0; // TODO: this relays on string being longer than 3 seperate dnumbers after dictionary\n\n return $numbers;\n }", "public function as_assoc();", "protected static function _rawurldecode_array($data){\n\t\t\n\t\t$result = array();\n\n\t\tforeach ($data as $key => &$value) {\n\n\t\t\tif(is_array($value) || is_object($value)){\n\n\t\t\t\t$result[$key] = static::_rawurldecode($value);\n\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tif(!empty($value)){\n\n\t\t\t\t\t$result[$key] = rawurldecode($value);\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$result[$key] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($key, $value);\n\t\t}\n\n\t\treturn (array) $result;\n\t}", "function parse_query($str) {\n \n $str = html_entity_decode($str);\n\n $arr = array();\n \n $pairs = explode('&', $str);\n \n foreach ($pairs as $i) {\n list($name,$value) = explode('=', $i, 2);\n\n if (isset($arr[$name])) {\n if (is_array($arr[$name])) {\n $arr[$name][] = $value;\n }\n else {\n $arr[$name] = array($arr[$name], $value);\n }\n }\n else {\n $arr[$name] = $value;\n }\n }\n return $arr;\n }", "private function retrieveData($method, $response)\n {\n if ($method === 'verifyipn') {\n return $response;\n }\n\n parse_str($response, $output);\n\n return $output;\n }", "function translate_parse($dataStr)\n\t\t{\n\t\t if($dataStr)\n\t\t {\n\t\t\t $arr = json_decode($dataStr,true); \n\t\t\t\t return $arr['responseData']['translatedText'];\n\t\t }\n\t\t return \"\";\n\t\t}", "function atkDataDecode(&$vars)\n{\n\t$magicQuotes = get_magic_quotes_gpc();\n\n\tforeach (array_keys($vars) as $varname)\n\t{\n\t\t$value = &$vars[$varname];\n\t\t// We must strip all slashes from the input, since php puts slashes\n\t\t// in front of quotes that are passed by the url. (magic_quotes_gpc)\n\t\tif ($value !== NULL && $magicQuotes)\n\t\tatk_stripslashes($value);\n\n\t\tAE_decode($vars, $varname);\n\n\t\tif (strpos(strtoupper($varname),'_AMDAE_')>0) // Now I *know* that strpos could return 0 if _AMDAE_ *is* found\n\t\t// at the beginning of the string.. but since that's not a valid\n\t\t// encoded var, we do nothing with it.\n\t\t{\n\t\t\t// This string is encoded.\n\t\t\tlist($dimension1,$dimension2) = explode(\"_AMDAE_\",strtoupper($varname));\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\t// Multidimensional thing\n\t\t\t\tfor ($i=0;$i<count($value);$i++)\n\t\t\t\t{\n\t\t\t\t\t$vars[strtolower($dimension1)][$i][strtolower($dimension2)] = $value[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$vars[strtolower($dimension1)][strtolower($dimension2)] = $value;\n\t\t\t}\n\t\t}\n\t}\n}", "function utf8_decode_array(&$array) {\n trigger_error('deprecated utf8_decode_array called',E_USER_WARNING);\n\n foreach (array_keys($array) as $key) {\n if($key === 'dn') continue;\n if($key === 'jpegPhoto') continue;\n if (is_array($array[$key])) {\n utf8_decode_array($array[$key]);\n }else {\n $array[$key] = utf8_decode($array[$key]);\n }\n }\n}" ]
[ "0.68386084", "0.67593586", "0.6727776", "0.6663099", "0.66561294", "0.66193986", "0.66057616", "0.63000566", "0.6216794", "0.594195", "0.5637514", "0.5609811", "0.5511996", "0.5396022", "0.5272197", "0.5240577", "0.5160063", "0.5151507", "0.5122402", "0.50719434", "0.5056054", "0.49873462", "0.49116912", "0.4868764", "0.48654777", "0.48432067", "0.48376364", "0.48335445", "0.48258057", "0.48205522", "0.48129198", "0.4805155", "0.48044345", "0.4775932", "0.47280833", "0.47241238", "0.4708639", "0.47077793", "0.46976092", "0.4692869", "0.4686998", "0.4659208", "0.46396464", "0.46396464", "0.46236357", "0.46084246", "0.46067315", "0.46010303", "0.4592244", "0.45407617", "0.45332748", "0.45188704", "0.45160195", "0.45045054", "0.4502082", "0.449844", "0.44976023", "0.44932607", "0.44820154", "0.4473198", "0.44717592", "0.44683078", "0.44642225", "0.44536686", "0.44536686", "0.44536686", "0.44536686", "0.44536686", "0.44536686", "0.4453349", "0.44496366", "0.44399846", "0.44339487", "0.4430868", "0.44246843", "0.4424087", "0.44178793", "0.44143072", "0.44068214", "0.4398469", "0.4397415", "0.439382", "0.4392858", "0.43860114", "0.4384024", "0.4371767", "0.43663904", "0.43632898", "0.43607268", "0.4357241", "0.4353343", "0.43426144", "0.4340061", "0.43373308", "0.4336314", "0.4325293", "0.432512", "0.43250865", "0.4324104", "0.4323332" ]
0.67708236
1
/ The construct has checking dealth with above 1. The techer will be taken to his class (teachers_class.tpl) 2. The teacher is not activated by admin (Then show him not_activate side of this form)
public function init() { if(isset($_POST['LoginStaff']) && $this->_mErrors == 0) { /* 0 = teacher exists, email and password all correct 1 = teacher exists, but email or password invalid 2 = teacher does not exist// */ $login_status = Customer::IsValidStaff($this->mStaffEmail, $this->mStaffPassword); switch ($login_status) { case 2: $this->mWarnErrorMsg = 'Unauthorized Access'; break; case 1: $this->mWarnErrorMsg = 'Staff Access only'; break; case 0: /* Every login credential is good but we need to know if has been activated */ $staff_id = (int)$_SESSION['schoolshop_staff_id']; $staff_status = Customer::GetStaffStatusForLogin($staff_id); $this->mCurrentStaffStatus = (int)$staff_status['status']; if($this->mCurrentStaffStatus == 6) { //Redirect to the Teachers class //if(empty($_SESSION['staff_admin_logged'])) $_SESSION['staff_admin_logged'] = true; $redirect_to = Link::ToTeachersClassPage(); header('Location: ' . $redirect_to); exit(); break; } break; default: # code...Take him to the front page $redirect_to = $this->mSiteUrl; header('Location: ' . $redirect_to); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function teacher_registration(){\n\n\t\t$data['title_page'] = 'Teacher | Registration';\n\t\t$this->load->view('teach/reg_teach', $data);\n\n\t\t/* here is the validation to the form submitted in creating the new teacher_account_tbl;*/\n\n\t}", "public function adminTeacher(){\n\n }", "function validate_teach(){\n\n\t\t$username = $this->input->post('teach_username');\n\t\t$pass = $this->input->post('teach_password');\n\t\t/* these will be the hoe page of teacher*/\n\t\t$Q = $this->teach_lgn->validate_teach($username, $pass);\n\n\t\tif ($Q) {\n\t\t\t\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function __construct(){\n parent::__construct();\n $this->lang->load('general', $this->session->lang); \n if($this->session->role != \"teacher\"){\n \tredirect(\"student\");\n }\n }", "public function teachers(){\n\t\t$this->verify();\n\t\t$data['title']=\"Teachers\";\n\t\t$data['subjects']=$this->admin_model->get_subjects();\n\t\t$data['teachers']=$this->admin_model->fetch_teachers_list();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('teachers/teachers', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function isTeacher(){\n\t\t// get user type\n\t\t$session_data = $this->session->userdata('logged_in'); // get userid from session\n\t\t\t\n\t\t// redirect to home if user is not a student\n\t\tif($session_data['usertype']!=2) redirect('/home');\n\t}", "public function formadd_teacher() {\n $user_teacher = $this->session->userdata('user');\n $this->load->view('template/header', $user_teacher);\n $this->load->view('include/navigation');\n $this->load->view('template/sidebar_teacher');\n $this->load->view('teacher/formadd_teacher');\n $this->load->view('template/footer');\n }", "function showForm() {\n \tglobal $pluginpath;\n \t\n \tif ($this->idt == \"\") {\n \t //user is creating new template\n \t\t$title = MF_NEW_TEMPLATE;\n \t\t$this->action = 'createtempl';\n\t\t$btnText = MF_CREATE_TEMPLATE_BUTTON; \n \t} else {\n \t //user is editing old template\n \t\t$title = \tMF_CHANGE_TEMPLATE;\n \t\t$this->action = 'changetempl';\n\t\t$btnText = MF_CHANGE_FORUM_BUTTON;\n \t}\n \t\n\t$this->doHtmlSpecChars();\n\t\t\n\tinclude \"admin/tempForm.php\";\n \t\n }", "function teacher_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'teacher_add';\n $page_data['page_title'] = get_phrase('add_teacher');\n $this->load->view('backend/index', $page_data);\n }", "public function __construct() {\n //set smarty template directory to this module\n //$this->smarty->template_dir = APPPATH . 'modules\\users\\views';\n //START\n //Check if user has previlleges\n Security::can_access_app(2);\n //END\n //load the necessary helper functions and libraries\n $this->load->helper('url');\n $this->load->helper('html');\n $this->load->library('session');\n $this->load->helper('form');\n $this->load->helper('tidalilane_helper');\n $this->load->library('form_validation');\n $this->load->library('session');\n\n\n //load the helper \n $this->load->helper('tidalilane_helper');\n \n $this->load->model('TidalilaneModels');\n }", "public function assign_class(){\n\t\t$this->verify();\n\t\t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('class', \"Class\", 'trim|required');\n\t\t$this->form_validation->set_rules('teacher', \"Teacher\", 'trim|required');\n\t\tif($this->form_validation->run()){\n\t\t\t$info=array(\n\t\t\t\t'class'=>$this->input->post('class'),\n\t\t\t\t'teacher'=>$this->input->post('teacher')\n\t\t\t);\n\n\t\t\tif($this->admin_model->assign_class($info)){\n\t\t\t\t$this->session->set_flashdata('message', 'Class has been assigned to a teacher successfully');\n\t\t\t\tredirect('/class');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->session->set_flashdata('message', 'There is a problem assigning class to a teacher');\n\t\t\t\tredirect('/class');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error=\"\";\n\t\t\tif(form_error('class')){\n\t\t\t\t$error.=form_error('class').\"<br>\";\n\t\t\t}\n\t\t\tif(form_error('teacher')){\n\t\t\t\t$error.=form_error('teacher').\"<br>\";\n\t\t\t}\n\t\t\t$this->session->set_flashdata('message', $error);\n\t\t\t\tredirect('/class');\n\t\t}\n\t}", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n // Course Info \r\n $elemT1 = new FEText( \"courseName\", true, 10);\r\n $elemT1->set_style_attribute('align', 'left');\r\n $elemT1->set_attribute(\"id\",\"coursename\");\r\n $elemT1->set_attribute(\"accesskey\",\"n\"); \r\n $this->add_element($elemT1);\r\n\r\n $elemP1 = new FETextArea(\"coursedataDescripcion\", true, 10, 50, null, 300);\r\n $elemP1->set_style_attribute('align', 'left');\r\n $elemP1->set_attribute(\"id\",\"coursedatadescripcion\"); \r\n $elemP1->set_attribute(\"accesskey\",\"d\"); \r\n $this->add_element($elemP1);\r\n\r\n include(Util::app_Path(\"andromeda/include/classes/nls.inc.php\"));\r\n $language = $this->_formatElem(\"FEListBox\", \"courseLanguage\", \"courseLanguage\", FALSE, \"100px\", NULL, $nls['languages_form']);\r\n $language->set_style_attribute('align', 'left');\r\n $language->set_attribute(\"id\",\"courselanguage\");\r\n $language->set_attribute(\"accesskey\",\"l\"); \r\n $this->add_element($language);\r\n \r\n $elemT2 = new FEText( \"coursedataVersion\", FALSE, 10);\r\n $elemT2->set_style_attribute('align', 'left');\r\n $elemT2->set_attribute(\"id\",\"coursedataversion\");\r\n $elemT2->set_attribute(\"accesskey\",\"v\"); \r\n $this->add_element($elemT2);\r\n \r\n $elemP2 = new FETextArea(\"coursedataPalabrasClaves\", false, 10, 50, null, 300);\r\n $elemP2->set_style_attribute('align', 'left');\r\n $elemP2->set_attribute(\"id\",\"coursedatapalabrasclaves\");\r\n $elemP2->set_attribute(\"accesskey\",\"w\"); \r\n $this->add_element($elemP2);\r\n\r\n $elemT3 = new FEText( \"coursedataDestinatarios\", FALSE, 10);\r\n $elemT3->set_style_attribute('align', 'left');\r\n $elemT3->set_attribute(\"id\",\"coursedatadestinatarios\");\r\n $elemT3->set_attribute(\"accesskey\",\"u\"); \r\n $this->add_element($elemT3);\r\n \r\n $elemP3 = new FETextArea(\"coursedataConocimientosPrevios\", false, 10, 50, null, 300);\r\n $elemP3->set_style_attribute('align', 'left');\r\n $elemP3->set_attribute(\"id\",\"coursedataconocimientosprevios\");\r\n $elemP3->set_attribute(\"accesskey\",\"k\"); \r\n $this->add_element($elemP3);\r\n\r\n $elemT4 = new FEText( \"coursedataMetodologia\", FALSE, 10);\r\n $elemT4->set_style_attribute('align', 'left');\r\n $elemT4->set_attribute(\"id\",\"coursedatametodologia\");\r\n $elemT4->set_attribute(\"accesskey\",\"m\"); \r\n $this->add_element($elemT4);\r\n\r\n $elemCB1 = new FECheckBox('courseActive', agt('Poner el curso activo.') );\r\n $elemCB1->set_style_attribute('align', 'left');\r\n $elemCB1->set_attribute(\"id\",\"courseactive\"); \r\n $elemCB1->set_attribute(\"accesskey\",\"o\"); \r\n $this->add_element( $elemCB1 );\r\n\r\n $elemCB2 = new FECheckBox('courseAccess', agt('Poner el curso accesible.') ); \r\n $elemCB2->set_style_attribute('align', 'left');\r\n $elemCB2->set_attribute(\"id\",\"courseaccess\");\r\n $elemCB2->set_attribute(\"accesskey\",\"p\"); \r\n $this->add_element( $elemCB2 ); \r\n\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"Insertar Curso\"));\r\n $submit->set_attribute(\"id\",\"submit\"); \r\n $submit->set_attribute(\"accesskey\",\"e\"); \r\n $this->add_element($submit);\r\n }", "public function classes(){\n\t\t$this->verify();\n\t\t$data['title']=\"Class\";\n\t\t$data['class_list']=$this->admin_model->get_classes();\n\t\t$data['teachers']=$this->admin_model->fetch_teachers_list();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('class/class', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "function template_before()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t// Make sure they've agreed to the terms and conditions.\n\techo '\n<script language=\"JavaScript\" type=\"text/javascript\"><!--\n\tfunction agreesubmit(el)\n\t{\n\t\tdocument.creator.regSubmit.disabled = !el.checked;\n\t}\n\tfunction defaultagree()\n\t{';\n\n\t// If they haven't checked the \"I agree\" box, tell them and don't submit.\n\tif ($context['require_agreement'])\n\t\techo '\n\t\tif (!document.creator.regagree.checked)\n\t\t{\n\t\t\talert(\"', $txt['register_agree'], '\");\n\t\t\treturn false;\n\t\t}';\n\n\t// Otherwise, let it through.\n\techo '\n\t\treturn true;\n\t}\n// --></script>\n<form action=\"', $scripturl, '?action=register2\" method=\"post\" name=\"creator\" onsubmit=\"return defaultagree();\">\n\t<table border=\"0\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" class=\"tborder\">\n\t\t<tr class=\"titlebg\">\n\t\t\t<td>', $txt[97], ' - ', $txt[517], '</td>\n\t\t</tr><tr class=\"windowbg\">\n\t\t\t<td width=\"100%\">\n\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"40%\">\n\t\t\t\t\t\t\t<b>', $txt[98], ':</b>\n\t\t\t\t\t\t\t<div class=\"smalltext\">', $txt[520], '</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"text\" name=\"user\" size=\"20\" maxlength=\"18\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr><tr>\n\t\t\t\t\t\t<td width=\"40%\">\n\t\t\t\t\t\t\t<b>', $txt[69], ':</b>\n\t\t\t\t\t\t\t<div class=\"smalltext\">', $txt[679], '</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"text\" name=\"email\" size=\"30\" />';\n\n\t// Are they allowed to hide their email?\n\tif ($context['allow_hide_email'])\n\t\techo '\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"hideEmail\" class=\"check\" id=\"hideEmail\" /> <label for=\"hideEmail\">', $txt[721], '</label>';\n\n\techo '\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr><tr>\n\t\t\t\t\t\t<td width=\"40%\">\n\t\t\t\t\t\t\t<b>', $txt[81], ':</b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"password\" name=\"passwrd1\" size=\"30\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr><tr>\n\t\t\t\t\t\t<td width=\"40%\">\n\t\t\t\t\t\t\t<b>', $txt[82], ':</b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"password\" name=\"passwrd2\" size=\"30\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t</table>';\n\n\t// Require them to agree here?\n\tif ($context['require_agreement'])\n\t\techo '\n\t<table width=\"100%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"tborder\" style=\"border-top: 0;\">\n\t\t<tr>\n\t\t\t<td class=\"windowbg2\" style=\"padding-top: 8px; padding-bottom: 8px;\">\n\t\t\t\t', $context['agreement'], '\n\t\t\t</td>\n\t\t</tr><tr>\n\t\t\t<td align=\"center\" class=\"windowbg2\">\n\t\t\t\t<label for=\"regagree\"><input type=\"checkbox\" name=\"regagree\" onclick=\"agreesubmit(this);\" class=\"check\" id=\"regagree\" /> <b>', $txt[585], '</b></label>\n\t\t\t</td>\n\t\t</tr>\n\t</table>';\n\n\techo '\n\t<br />\n\t<div align=\"center\">\n\t\t<input type=\"submit\" name=\"regSubmit\" value=\"', $txt[97], '\" />\n\t</div>\n</form>';\n\n\t// Uncheck the agreement thing....\n\tif ($context['require_agreement'])\n\t\techo '\n<script language=\"JavaScript\" type=\"text/javascript\">\n\tdocument.creator.regagree.checked = false;\n\tdocument.creator.regSubmit.disabled = true;\n</script>';\n}", "public function index()\n {\n $classes = $this->objClass->get();\n\n $permission = false;\n\n if (Auth::user()->type == 'AD' || Auth::user()->type == 'P') {\n $permission = true;\n }\n\n $type = Auth::user()->type;\n\n $solicitation = false;\n if ($type == 'P') {\n $classes = $this->objClass->where('teacher_id', '=', Auth::user()->id)->get();\n if ($classes) {\n foreach ($classes as $key => $lesson) {\n if ($lesson->students) {\n $lesson_students = json_decode($lesson->students);\n foreach ($lesson_students as $key => $value) {\n if ($value->present == false || $value->present == true) {\n $solicitation = true;\n }\n }\n }\n }\n }\n }\n return view('class', compact('classes', 'permission', 'type', 'solicitation'));\n }", "public function editionAction() {\r\n //inactivate header/footer\r\n $this->_includeTemplate = false;\r\n\r\n if ($_GET['checkboxAd'] == 'false') {\r\n $typeU = \"child\";\r\n } else {\r\n $typeU = \"adult\";\r\n }\r\n\r\n if ($_GET['checkboxAdmin'] == 'false') {\r\n $admin = \"0\";\r\n } else {\r\n $admin = \"1\";\r\n }\r\n\r\n //test to know if the user already exists\r\n $cpt = true;\r\n foreach ($_SESSION['members'] as $member) {\r\n\r\n if (($_GET['Name'] == $member->getName()) && ($_GET['CurrName'] != $member->getName() )) {\r\n $cpt = false;\r\n }\r\n }\r\n\r\n //if user doesn't exist\r\n if ($cpt) {\r\n //sql connection\r\n\r\n if ($_SESSION['Name'] == $_GET['CurrName'])//Current edit current\r\n $_SESSION['Name'] = $_GET['Name'];\r\n\r\n $connect = connection::getInstance();\r\n $_GET['Name'] = Users::secure($_GET['Name']);\r\n $_GET['Pass'] = Users::secure($_GET['Pass']);\r\n $_GET['Id'] = Users::secure($_GET['Id']);\r\n\r\n $sql = \"UPDATE users SET nameU='\" . $_GET['Name'] . \"', typeU='\" . $typeU . \"',password='\" . $_GET['Pass'] . \"', admin='\" . $admin . \"' where IDU ='\" . $_GET['Id'] . \"'\"; //on recupere tout les utilisateurs\r\n //sending request\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n \r\n $_SESSION['admin'] = $admin;\r\n $_SESSION['current'] = 'members';\r\n $this->members = Users::Getuser(); //give data to view\r\n } else {\r\n $this->members = $_SESSION['members']; //give data to view\r\n }\r\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_traininglist/traineecert');\n }", "public function html(){\n //Either the student whose the form belongs to, DGS or Advisor\n\n if(isset($_SESSION[\"UserName\"]) && ($this->id== $_SESSION['RoleId'] || $_SESSION['Role']>0)) {\n $html = \"\n <div class='jumbotron text-center'>\n <p><label> Date: {$this->_form->Date} </label></p>\n <p><label for='sName'><strong>Student Name: </strong>{$this->_form->StudentFirst} {$this->_form->StudentLast} </label>\n <label for='sID'><strong>Student ID#:</strong> {$this->_form->StudentId}</label></p>\n <p ><label><strong>Degree:</strong> {$this->_form->Degree} </label></p>\n <p><label for='Semester'><strong>Semester Admitted:</strong> {$this->_form->Semester}</label></p>\n <p><label for='num-Semester'><strong> # of Semesters in the program:</strong> X</label></p>\n <p><label for='advisor'><strong> Advisor:</strong></label></p>\n <p><label for='committee'><strong> Committee:</strong> {$this->_form->ComitteeName}</label></p>\n <p><label for='committee'><strong> Description: </strong>{$this->_form->Description}</label></p>\n </div>\n <div class='container'>\n <div class='table'>\n <table class='table table-striped'>\n <thead>\n <tr>\n <th>Milestone</th>\n <th>Good</th>\n <th>Acceptable</th>\n <th>Pass</th>\n <th>Semester</th>\n </tr>\n </thead>\n <tbody id='milestone'>\" .\n $this->formatMilestonesHtml()\n . \"\n </tbody>\n </table>\n </div>\n </div>\";\n\n //HTML FOR NEW AND EDITING FROMS\n if ($this->type == \"n\" || $this->type == \"e\") {\n $html .= \"\n <div class='container'>\n <p>\n Describe the progress made during the past year?\n </p>\n <p>\n <div class='form-group'>\n <label for='comment'>Comment:</label>\n <textarea class='form-control' rows='5' id='comment' >\".$this->gp[0]->Note.\"</textarea>\n </div>\n </p>\n </div>\n \";\n $html .= \"\n\n <div class='container form-group '>\n <form id='milestone-form'>\n <input type='hidden' name='id' id='StudentId' value='$this->id'/>\n <input type='hidden' name='gid' id='gId' value='\" . $this->gp[0]->Id . \"'/>\n <label for='milestone-select'>Milestone</label>\n <select id='milestone-select' class='form-control'>\n <option >Select Milestone</option>\n \" . $this->milestonOptions() . \"\n </select>\n <br/>\n <div class='text-center'>\n <input type='button' class='btn btn-danger' onclick='addMilestone()' value='Add'/>\n <p>\n <br/>\n <input class='btn' type='submit' value='Save'/>\n </p>\n </div>\n </form>\n </div>\n \";\n } //HTML FOR Signing\n else if ($this->type == \"s\") {\n $html .= \"\n <div class='container'>\n <p>\n Describe the progress made during the past year?\n </p>\n <p>\n <div class='form-group'>\n <label for='comment'>Comment:</label>\n <textarea class='form-control' rows='5' id='comment' readonly>\".$this->gp[0]->Note.\"</textarea>\n </div>\n\n </p>\n </div>\n \";\n $html .= \"\n\n <div style='margin: auto; align-content: center;margin-top: 25px;text-align: center'>\n <form id='milestone-form'>\n <input type='hidden' name='id' id='StudentId' value='\" . $this->id . \"'/>\n <input type='hidden' name='gid' value='\" . $this->gp[0]->Id . \"'/>\n <p>\n <label for='signature'><input name='signature' id='signature' type='text' placeholder='Full Name'/></label>\n </p>\n <input type='submit' value='sign'/>\n </form>\n </div>\";\n\n } //HTML for everything else\n else {\n $html .= \"\n <div class='container'>\n <p>\n Describe the progress made during the past year?\n </p>\n <p>\n <div class='form-group'>\n <label for='comment'>Comment:</label>\n <textarea class='form-control' rows='5' id='comment' readonly>\".$this->gp[0]->Note.\"</textarea>\n </div>\n </p>\n </div>\n \";\n }\n }\n //Does not belong to student - Not Viewable\n else if(isset($_SESSION['UserName'])) {\n $html = \"\n <div class='container' id='by-department'>\n <p>\n You do not have permission to see this page\n </p>\n </div>\";\n\n\n }\n //Not signed in - Not Viewable\n else{\n $html = \"\n <div class='container' id='by-department'>\n <p>\n You must be signed in to view this page\n </p>\n </div>\";\n\n }\n\n return $html;\n }", "public function actionCreate()\n\t{\n\t\t$model = new Classes;\n\t\tif(isset($_POST['Classes'])) {\n\t\t\t$model->attributes = $_POST['Classes'];\n\t\t\t$model->formTags = isset($_POST['Classes']['formTags']) ? explode(',', $_POST['Classes']['formTags']) : null;\n\t\t\t$model->teachers = isset($_POST['Classes']['teachers']) ? $_POST['Classes']['teachers']: null;\n\t\t\t$model->classDays = isset($_POST['Classes']['classDays']) ? explode(',', $_POST['Classes']['classDays']) : null;\n\t\t\t$model->price = isset($_POST['Classes']['price']) ? $_POST['Classes']['price'] : 0;\n\t\t\t$model->teacher_id = 0;\n\n\t\t\tif($model->save()) {\n\t\t\t\tYii::app()->user->setFlash('success', '<span class=\"icon-check\"></span>&nbsp;&nbsp;اطلاعات با موفقیت ذخیره شد.');\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} else\n\t\t\t\tYii::app()->user->setFlash('failed', 'در ثبت اطلاعات خطایی رخ داده است! لطفا مجددا تلاش کنید.');\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t\t'model' => $model,\n\t\t));\n\t}", "public function TeacherCreate()\n {\n return view('admin.teachers.create');\n }", "function classTeacher()\n {\t\t\t\t\n $data['header']=\"header\";\n $data['left_menu']=\"left_menu\";\n $data['middle_content']='staff/staff_class_allocate';\n $data['footer']='footer';\n $data['menu'] = 'staff';\n $this->load->view('landing',$data);\n }", "public function teacher()\n {\n $data['title'] = 'Teacher\\'s Course Page';\n\n $course_id = $this->uri->segment(3);\n $classroom_id = $this->uri->segment(4);\n $data['classroom_id'] = $classroom_id;\n $data['course_info'] = $this->course->get_teacher_course($course_id, $classroom_id);\n $data['enrolled_students'] = $this->course->get_enrolled_students_for_teacher($classroom_id);\n $data['quizs'] = $this->course->get_quizs_for_teacher($classroom_id);\n $data['num_questions'] = $this->course->get_number_of_questions_for_teacher($data['quizs']);\n\n $this->load->view('templates/header');\n $this->load->view('courses/teacher', $data);\n $this->load->view('templates/footer');\n }", "public function show_existing()\n\t{\n\t global $e_userclass;\n\n\t\t$tp \t= e107::getParser();\n\t\t$sql \t= e107::getDb();\n\t\t$frm \t= new uclassFrm;\n\t\t$ns \t= e107::getRender();\n\t\t$mes \t= e107::getMessage();\n\n\n\t\tif (!$total = $sql->db_Select('userclass_classes', '*'))\n\t\t{\n\t\t\t$text = \"\";\n\t\t\t$mes->add(UCSLAN_7, E_MESSAGE_INFO);\n\n\t\t}\n\t\telse\n\t\t{\n $text .= \"<form method='post' action='\".e_SELF.\"?\".e_QUERY.\"'>\n <fieldset id='core-userclass-list'>\n\t\t\t\t\t\t<legend class='e-hideme'>\".UCSLAN_5.\"</legend>\n\t\t\t\t\t\t<table class='adminlist'>\".\n\t\t\t\t\t\t\t$frm->colGroup($this->fields,$this->fieldpref).\n\t\t\t\t\t\t\t$frm->thead($this->fields,$this->fieldpref).\n\n\t\t\t\t\t\t\t\"<tbody>\";\n\t\t\t$classes = $sql->db_getList('ALL', FALSE, FALSE);\n\n foreach($classes as $row)\n\t\t\t{\n\t\t\t\t$text .= $frm->renderTableRow($this->fields, $this->fieldpref, $row, 'userclass_id');\n\t\t\t}\n\n\t\t\t$text .= \"</tbody></table></fieldset></form>\";\n\t\t}\n\n\t\t$text .= $e_userclass->show_graphical_tree();\t// Show the tree as well - sometimes more useful\n\n\t\t$ns->tablerender(UCSLAN_21, $mes->render().$text );\n\n\t}", "public function postActivateAction()\n\t{\n\t\tif ($this->module->activate())\n\t\t\tTools::redirectAdmin($this->context->link->getAdminLink('AdminTranslatools2'));\n\t\telse\n\t\t\t$this->template = 'default.tpl';\n\t}", "public function actionCreate()\n\t{\n\t\t$this->subPageTitle = 'Thêm mới giáo viên';\n\t\t$model = new User;\n\t\t$teacher = new Teacher; \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t$classSubjects = Subject::model()->generateSubjects();\n\t\t$abilitySubjects = $teacher->abilitySubjects();//Subjects ability of teacher\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$teacher_values = $_POST['User'];//Teacher values\n\t\t\t$teacher_profile_values = $_POST['Teacher'];//Teacher profile values\n\t\t\tif(isset($_POST['abilitySubjects'])){\n\t\t\t\t$abilitySubjects = $_POST['abilitySubjects'];//Subject ability\n\t\t\t}\n\t\t\t$teacher_values['role'] = User::ROLE_TEACHER;\n\t\t\tif(trim($teacher_values['birthday'])==''){\n\t\t\t\tunset($teacher_values['birthday']);\n\t\t\t}\n\t\t\t$model->attributes = $teacher_values;\n\t\t\t$model->passwordSave = $teacher_values['password'];\n\t\t\t$common = new Common();\n\t\t\t$dir = \"media/uploads/profiles\";\n\t\t\t$profilePicture = $common->uploadProfilePicture(\"profilePicture\",$dir);\n\t\t\tif($profilePicture !== false){\n\t\t\t\t$model->profile_picture=$profilePicture;\n\t\t\t}\n $transaction = Yii::app()->db->beginTransaction();\n try{\n if($model->save()){\n $teacher->attributes = $teacher_profile_values;\n $teacher->user_id = $model->id;\n if($teacher->save()){\n $teacher->saveAbilitySubjects($abilitySubjects);\n $transaction->commit();\n $this->redirect(array('index'));\n } else {\n throw new Exception('teacher_not_saved');\n }\n } else {\n throw new Exception('user_not_saved');\n }\n } catch(Exception $e){\n $transaction->rollback();\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'teacher'=>$teacher,\n\t\t\t'classSubjects' => $classSubjects,\n\t\t\t'abilitySubjects' => $abilitySubjects,\n\t\t));\n\t}", "public function __construct()\n {\n parent::__construct();\n\n/*------------------------------------------------------------------------------\n * Carrega configurações\n *------------------------------------------------------------------------------*/\n $fer = new TFerramentas(); //Ferramentas diversas\n $sicad = new TSicadDados(); //Ferramentas SICAD\n $profile = TSession::getValue('profile'); //Profile da Conta do usuário\n if (!$this->nivel_sistema || $this->config_load == false) //Carrega OPMs que tem acesso\n {\n $this->opm_operador = $sicad->get_OPM(); //Carrega OPM do Usuário\n $this->nivel_sistema = $fer->getnivel (get_class($this)); //Verifica qual nível de acesso do usuário\n $this->listas = $sicad->get_OPMsUsuario(); //Carrega Listas de OPMs\n $this->config = $fer->getConfig($this->sistema); //Carrega config\n TSession::setValue('SISACAD_CONFIG', $this->config); //Busca o Nível de acesso que o usuário tem para a Classe\n $this->config_load = true; //Informa que configuração foi carregada\n }\n // creates the form\n $this->form = new TForm('form_disciplina');\n $this->form->class = 'tform'; // CSS class\n\n $table_master = new TTable;\n $table_master->width = '100%';\n \n $table_master->addRowSet( new TLabel('Define disciplinas de Interesse para o corpo de Professores - Cadastro/Edição'), '', '')->class = 'tformtitle';\n \n // add a table inside form\n $table_general = new TTable;\n $table_general->width = '100%';\n \n $frame_general = new TFrame;\n $frame_general->class = 'tframe tframe-custom';\n $frame_general->setLegend('Dados da Disciplina');\n $frame_general->style = 'background:whiteSmoke';\n $frame_general->add($table_general);\n \n $frame_details = new TFrame;\n $frame_details->class = 'tframe tframe-custom';\n $frame_details->setLegend('Professores que Ministram aula nesta disciplina');\n \n $table_master->addRow()->addCell( $frame_general )->colspan=2;\n $row = $table_master->addRow();\n $row->addCell( $frame_details );\n \n $this->form->add($table_master);\n \n // master fields\n $id = new TEntry('id');\n $nome = new TEntry('nome');\n $sigla = new TEntry('sigla');\n $oculto = new TCombo('oculto');\n\n // sizes\n $id->setSize('80');\n $nome->setSize('400');\n $sigla->setSize('200');\n $oculto->setSize('100');\n \n //Valores\n $oculto->addItems($fer->lista_sim_nao());\n \n $oculto->setValue('N');\n\n if (!empty($id))\n {\n $id->setEditable(FALSE);\n }\n //Se não é Gestor acima desativa\n if ($this->nivel_sistema<=80)\n {\n $nome->setEditable(FALSE);\n $sigla->setEditable(FALSE);\n $oculto->setEditable(FALSE);\n }\n \n // add form fields to be handled by form\n $this->form->addField($id);\n $this->form->addField($nome);\n $this->form->addField($sigla);\n $this->form->addField($oculto);\n \n // add form fields to the screen\n $table_general->addRowSet( new TLabel('Id'), $id );\n $table_general->addRowSet( new TLabel('Disciplina'), $nome );\n $table_general->addRowSet( new TLabel('Sigla'), $sigla );\n $table_general->addRowSet( new TLabel('Fora de Uso?'), $oculto );\n \n // creates the scroll panel\n $scroll = new TScroll;\n $scroll->setSize('100%',180);\n\n // detail\n $this->table_details = new TTable;\n $this->table_details-> width = '100%';\n $scroll->add($this->table_details);\n $frame_details->add($scroll);\n \n $this->table_details->addSection('thead');\n $row = $this->table_details->addRow();\n \n // detail header\n $row->addCell( new TLabel('Opções') );\n $row->addCell( new TLabel('Professor da Disciplina') );\n \n // create an action button (save)\n $save_button=new TButton('save');\n $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));\n $save_button->setImage('ico_save.png');\n\n // create an new button (edit with no parameters)\n $new_button=new TButton('new');\n $new_button->setAction(new TAction(array($this, 'onClear')), _t('New'));\n $new_button->setImage('ico_new.png');\n\n // create an return button\n $local = TSession::getValue('defineDisciplinaProfessorForm_return');\n if (!empty($local) && $local == 'config')\n {\n $ret_button=new TButton('return');\n $ret_button->setAction(new TAction(array('disciplinaList', 'onReload')), 'Retorna a Configuração');\n $ret_button->setImage('ico_back.png');\n }\n else\n {\n $ret_button=new TButton('return');\n $ret_button->setAction(new TAction(array('defineDisciplinaProfessorList', 'onReload')), _t('Back to the listing'));\n $ret_button->setImage('ico_back.png');\n }\n \n\n // define form fields\n $this->form->addField($save_button);\n if ($this->nivel_sistema>80)\n {\n $this->form->addField($new_button);\n }\n $this->form->addField($ret_button);\n \n if ($this->nivel_sistema>80)\n {\n $table_master->addRowSet( array($save_button, $new_button,$ret_button), '', '')->class = 'tformaction'; // CSS class\n }\n else\n {\n $table_master->addRowSet( array($save_button, $ret_button), '', '')->class = 'tformaction'; // CSS class\n }\n \n $this->detail_row = 0;\n \n // create the page container\n $container = new TVBox;\n $container->style = 'width: 100%';\n $container->add(new TXMLBreadCrumb('menu.xml', 'defineDisciplinaProfessorList'));\n $container->add($this->form);\n parent::add($container);\n }", "function recommends_req_wizard_courses_info($form, &$form_state) {\n $professor = variable_get('recommends_student_professor_email', 'FALSE');\n \n $entry = array();\n $entries = recommends_cp_entry_load_req($entry,$professor);\n \n $keyed_entries = array();\n if (empty($entries)) {\n drupal_set_message(t('There was a problem - There was no entries in the course conducted list. Please contact the professor to report the error. Your request cnnot be completed at this time..'), 'error');\n $form_state['num_courses'] = 0;\n return $form;\n }\n\n foreach ($entries as $entry) {\n $options[$entry->i_pid] = t(\"@i_course - @i_semester @i_year, @i_coursename\", array(\n '@i_pid' => $entry->i_pid, \n '@i_course' => $entry->i_course,\n '@i_coursename' => $entry->i_coursename,\n '@i_objective' => $entry->i_objective,\n '@i_grade_a' => $entry->i_grade_a,\n '@i_grade_b' => $entry->i_grade_b,\n '@i_grade_other' => $entry->i_grade_other,\n '@i_semester' => $entry->i_semester,\n '@i_year' => $entry->i_year,\n '@i_timestamp' => $entry->i_timestamp\n ));\n $keyed_entries[$entry->i_pid] = $entry;\n }\n $default_entry = !empty($form_state['values']['i_pid']) ? $keyed_entries[$form_state['values']['i_pid']] : $entries[0];\n\n $options[] = 'Independent Research';\n $options[] = 'Other interaction ';\n $form_state['entries'] = $keyed_entries; \n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['crsreq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n );\n $form['crsreq']['description'] = array(\n '#type' => 'item',\n '#title' => t('select the course/activity in which you were enrolled with the professor. Click \"add\" for each additional course.'),\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n // Build the number of name fieldsets indicated by $form_state['num_courses']\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $form['crsname'][$i] = array(\n '#type' => 'fieldset',\n '#title' => t('Course #@num', array('@num' => $i)),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n \n $form['crsname'][$i]['i_pid'] = array(\n \n '#type' => 'select',\n '#options' => $options,\n '#required' => TRUE,\n \n );\n \n $form['crsname'][$i]['i_other'] = array(\n '#type' => 'textarea',\n '#title' => t('Other interation - please describe'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n \n\n ); \n }\n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Add another course'),\n '#submit' => array('recommends_req_crstut_9_add_course'),\n );\n\n // If we have more than one name, this button allows removal of the\n // last name.\n if ($form_state['num_courses'] > 1) {\n $form['remove_course'] = array(\n '#type' => 'submit',\n '#value' => t('Remove latest course'),\n '#submit' => array('recommends_req_crstut_9_remove_course'),\n // Since we are removing a name, don't validate until later.\n '#limit_validation_errors' => array(),\n );\n }\n\n return $form;\n}", "public function new_eng_class()\r\n\t{\r\n\t\t// logged in as admin\r\n\t\tif($this->session->userdata('logged_in'))\r\n\t\t{\r\n\t\t\t$session_data = $this->session->userdata('logged_in');\r\n\t\t\t$data['username'] = $session_data['username'];\r\n\t\t\t$data['admin'] = $session_data['admin'];\r\n\t\t}\r\n\t\t// not admin\r\n\t\telse\r\n\t\t{\r\n\t\t\t// set username to null \r\n\t\t\t$data['username'] = '';\r\n\t\t\t// don't let anyone but admin have access\r\n\t\t\tshow_404();\r\n\t\t}\r\n\t\t\r\n\t\t// set active tab\r\n\t\t$data['welcome_active'] = \"\";\r\n\t\t$data['host_active'] = \"\";\r\n\t\t$data['event_active'] = \"active\";\r\n\t\t\r\n\t\t// load views\r\n\t\t$this->load->view('include/header',$data);\r\n\t\t$this->load->view('include/tabs',$data);\r\n\t\t$this->load->view('new_eng_class',$data);\r\n\t\t$this->load->view('include/footer');\t\r\n\t}", "function main()\t{\n\t\t\t\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t\t\t\t// Access check!\n\t\t\t\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t\t\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t\t\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t\tif (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))\t{\n\n\t\t\t\t\t\t\t// Draw the header.\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t\t\t\t$this->doc->form='<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\n\n\t\t\t\t\t\t\t// JavaScript\n\t\t\t\t\t\t$this->doc->JScode = '\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfunction confirmURL(text,URL){\n\t\t\t\t\t\t\t\t\tvar agree=confirm(text);\n\t\t\t\t\t\t\t\t\tif (agree) {\n\t\t\t\t\t\t\t\t\t\tjumpToUrl(URL);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t';\n\t\t\t\t\t\t$this->doc->postCode='\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t';\n\n\t\t\t\t\t\t$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\n\t\t\t\t\t\t\t. $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));\n\t\t\t\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t\t\t\t// Render content:\n\t\t\t\t\t\t$this->moduleContent();\n\n\n\t\t\t\t\t\t// ShortCut\n\t\t\t\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// If no access or if ID == zero\n\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}", "protected function confirmTemplateSwitch()\n\t{\n\t\tinclude_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';\n\t\t$this->ctrl->setReturn($this,'perm');\n\t\t$this->ctrl->setCmdClass('ildidactictemplategui');\n\t\t$dtpl_gui = new ilDidacticTemplateGUI($this->gui_obj);\n\t\t$this->ctrl->forwardCommand($dtpl_gui,'confirmTemplateSwitch');\n\t}", "public function __construct()\n\t{\n parent::__construct();\n if (!$this->authex->isAangemeld()) {\n redirect('login/inloggen');\n }\n $this->load->helper('form');\n $this->load->helper('url');\n $this->load->helper('form');\n $this->load->helper('notation');\n \n $gebruiker = $this->authex->getGebruikerInfo();\n if($gebruiker->soort == \"Gastspreker\"){\n redirect('gebruiker/toonMeldingGeenToegangGastspreker');\n }\n if($gebruiker->soort == \"Docent\"){\n redirect('gebruiker/toonMeldingGeenToegangDocent');\n }\n }", "function BeforeShowEdit(&$xt, &$templatefile, $values, &$pageObject)\n{\n\n\t\t$att = $xt->fetchVar(\"Approved_editcontrol\");\n$att = str_replace(\">\",\" DISABLED=DISABLED>\",$att);\n$xt->assign(\"Approved_editcontrol\",$att);\n\n\n$attz = $xt->fetchVar(\"Approvedby_editcontrol\");\n$attz = str_replace(\">\",\" DISABLED=DISABLED>\",$attz);\n$xt->assign(\"Approvedby_editcontrol\",$attz);\n\n$at1 = $xt->fetchVar(\"EmployeeID_editcontrol\");\n$at1 = str_replace(\">\",\" DISABLED=DISABLED>\",$at1);\n$xt->assign(\"EmployeeID_editcontrol\",$at1);\n\n//$at2 = $xt->fetchVar(\"Superior_editcontrol\");\n//$at2 = str_replace(\">\",\" DISABLED=DISABLED>\",$at2);\n//$xt->assign(\"Superior_editcontrol\",$at2);\n\n\n$at3 = $xt->fetchVar(\"Locked_editcontrol\");\n$at3 = str_replace(\">\",\" DISABLED=DISABLED>\",$at3);\n$xt->assign(\"Locked_editcontrol\",$at3);\n\n$at4 = $xt->fetchVar(\"Posted_editcontrol\");\n$at4 = str_replace(\">\",\" DISABLED=DISABLED>\",$at4);\n$xt->assign(\"Posted_editcontrol\",$at4);\n\n\n $attr = $xt->fetchVar(\"Superior_editcontrol\");\n $attr = str_replace(\">\",\" READONLY=READONLY>\",$attr);\n $xt->assign(\"Superior_editcontrol\",$attr);\n\n\n $att5 = $xt->fetchVar(\"Superior2_editcontrol\");\n $att5 = str_replace(\">\",\" READONLY=READONLY>\",$att5);\n $xt->assign(\"Superior2_editcontrol\",$att5);\n\n\n $att6 = $xt->fetchVar(\"1stApproval_editcontrol\");\n $att6 = str_replace(\">\",\" DISABLED=DISABLED>\",$att6);\n $xt->assign(\"1stApproval_editcontrol\",$att6);\n\n $att7 = $xt->fetchVar(\"2ndApproval_editcontrol\");\n $att7 = str_replace(\">\",\" DISABLED=DISABLED>\",$att7);\n $xt->assign(\"2ndApproval_editcontrol\",$att7);\n\n\n\n\n\n\n\n\n;\t\t\n}", "public function showteachersAction() { \r\n $teachers = $this->getDoctrine()\r\n ->getRepository(Teacher::class)\r\n ->findAll();\r\n\r\n foreach ($teachers as $teacher) {\r\n $teacher->getSubject();\r\n $teacher->getClassroom();\r\n }\r\n\r\n return $this->render('admin/admin-teacher/adminTeacherDashboard.html.twig', [\r\n 'teachers' => $teachers,\r\n ]);\r\n }", "private function notAdmin() : void\n {\n if( intval($this->law) === self::CREATOR_LAW_LEVEL)\n {\n (new Session())->set('user','error','Impossible d\\'effectuer cette action');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "public function choosePrize(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "public function relatorio4(){\n $this->isAdmin();\n }", "function ipal_make_student_form(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\tglobal $USER;\r\n\tglobal $course;\r\n\t$disabled='';\r\n\t\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t\r\n\tif($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t\t$question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t\t$qid=$question->question_id;\r\n\t\t$myFormArray= ipal_get_questions_student($qid);\r\n//\t\t$disabled=ipal_check_if_answered($USER->id,$myFormArray[0]['id'],$ipal_quiz->quiz_id,$course->id,$ipal->id);\r\n\t\techo \"<br><br><br>\";\r\n\t\techo \"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\"; \r\n\t\techo $myFormArray[0]['question'];\r\n\t\techo \"<br>\";\r\n\t\tif(ipal_get_qtype($qid) == 'essay'){\r\n\t\t\techo \"<INPUT TYPE=\\\"text\\\" NAME=\\\"a_text\\\" >\\n<br />\";\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=\\\"answer_id\\\" value=\\\"-1\\\">\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($myFormArray[0]['answers'] as $k=>$v){\r\n\t\t\techo \"<input type=\\\"radio\\\" name=\\\"answer_id\\\" value=\\\"$k\\\" \".$disabled.\"/> \".strip_tags($v).\"<br />\\n\";\r\n//\t\t\techo \"<br>\";\r\n\t\t\t}\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=a_text VALUE=\\\" \\\">\";\r\n\t\t}\r\n\techo \"<INPUT TYPE=hidden NAME=question_id VALUE=\\\"\".$myFormArray[0]['id'].\"\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=active_question_id VALUE=\\\"$question->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=course_id VALUE=\\\"$course->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=user_id VALUE=\\\"$USER->id\\\">\";\r\n\techo \"<INPUT TYPE=submit NAME=submit VALUE=\\\"Submit\\\" \".$disabled.\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=ipal_id VALUE=\\\"$ipal->id\\\">\";\r\n echo \"<INPUT TYPE=hidden NAME=instructor VALUE=\\\"\".findInstructor($course->id).\"\\\">\";\r\n\techo \"</form>\";\r\n\t}else{\r\n\techo \"<br><br>No Current Question.\";}\r\n}", "public function __construct(){\n\n // Ensure the EA access is loaded\n b_reg::load_module(EA_MODULE);\n EA_access();\n \n parent::__construct();\n \n bForm_Avatar::set_context(bAuth::$av);\n $authenticated = bAuth::authenticated();\n $this->who_is_here(array('VM_manager_here' => array('rank'=> 'RANK_vm_manager',\n\t\t\t\t\t\t\t 'def' => 'superUser_here'),\n\t\t\t 'VM_prg_coordinator_here'=> array('rank'=> 'RANK_vm_prg_coordinator',\n\t\t\t\t\t\t\t 'def' => 'VM_manager_here'),\n\t\t\t 'VM_visitor_here' => array('rank'=> 'RANK_vm_visitor'),\n\t\t\t 'VM_registrant_here' => array('rank'=> 'RANK_vm_registrant'),\n\t\t\t 'VM_stranger_here' => array('rank'=> 'RANK__authenticated'),\n\t\t\t 'VM_organizer_here' => array('IF' => ((VM::e_ID() && VM::$e->isOrganizer()) || VM::isOrganizer())),\n\t\t\t 'VM_endorser_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isEndorser') && bAuth::$av->isEndorser())),\n\t\t\t 'VM_employee_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isE') && bAuth::$av->isE())),\n\t\t\t 'VM_lt_visitor_here' => array('IF' => ($authenticated && method_exists(bAuth::$av,'isV') && bAuth::$av->isV())),\n\t\t\t ));\n\n $this->who_is_here(array('VM_guests_handlare_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_guests))),\n\t\t\t 'VM_rooms_updater_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_update_rooms))),\n\t\t\t 'VM_reimberser_here' =>array('IF'=> ($authenticated && VM_administrators()->isHandlingDuty(DUTY_reimbursement))),\n\t\t\t 'VM_unlocker_here' =>array('IF'=> ($authenticated &&(VM_administrators()->isHandlingDuty(DUTY_unlock_events)||VM_manager_here))),\n\t\t\t 'VM_external_registrant_here'=>array('IF'=>VM_registrant_here && !VM_lt_visitor_here && !VM_employee_here),\n\t\t\t 'VM_administrator_here' =>array('IF'=>VM_endorser_here || VM_organizer_here || VM_prg_coordinator_here), \n\t\t\t ));\n\n $this->who_is_here(array('VM_member_here' =>array('IF'=>EA_member_here() || VM_external_registrant_here || VM_organizer_here),\n\t\t\t ));\n }", "function BeforeShowAdd(&$xt, &$templatefile, &$pageObject)\n{\n\n\t\t$att = $xt->fetchVar(\"Approved_editcontrol\");\n$att = str_replace(\">\",\" DISABLED=DISABLED>\",$att);\n$xt->assign(\"Approved_editcontrol\",$att);\n\n\n$attz = $xt->fetchVar(\"Approvedby_editcontrol\");\n$attz = str_replace(\">\",\" DISABLED=DISABLED>\",$attz);\n$xt->assign(\"Approvedby_editcontrol\",$attz);\n\n$at1 = $xt->fetchVar(\"EmployeeID_editcontrol\");\n$at1 = str_replace(\">\",\" DISABLED=DISABLED>\",$at1);\n$xt->assign(\"EmployeeID_editcontrol\",$at1);\n\n\n$at3 = $xt->fetchVar(\"Locked_editcontrol\");\n$at3 = str_replace(\">\",\" DISABLED=DISABLED>\",$at3);\n$xt->assign(\"Locked_editcontrol\",$at3);\n\n$at4 = $xt->fetchVar(\"Posted_editcontrol\");\n$at4 = str_replace(\">\",\" DISABLED=DISABLED>\",$at4);\n$xt->assign(\"Posted_editcontrol\",$at4);\n\n\n $attr = $xt->fetchVar(\"Superior_editcontrol\");\n $attr = str_replace(\">\",\" READONLY=READONLY>\",$attr);\n $xt->assign(\"Superior_editcontrol\",$attr);\n\n $att5 = $xt->fetchVar(\"Superior2_editcontrol\");\n $att5 = str_replace(\">\",\" READONLY=READONLY>\",$att5);\n $xt->assign(\"Superior2_editcontrol\",$att5);\n\n\n $att6 = $xt->fetchVar(\"1stApproval_editcontrol\");\n $att6 = str_replace(\">\",\" READONLY=READONLY>\",$att6);\n $xt->assign(\"1stApproval_editcontrol\",$att6);\n\n $att7 = $xt->fetchVar(\"2ndApproval_editcontrol\");\n $att7 = str_replace(\">\",\" READONLY=READONLY>\",$att7);\n $xt->assign(\"2ndApproval_editcontrol\",$att7);\n\n\n\n\n\n\n\n;\t\t\n}", "public function class_wise_subject($class_id) {\n\t\t$page_data['class_id'] = $class_id;\n\t\t$this->load->view('backend/admin/subject/dropdown', $page_data);\n\t}", "function nonactivateTU(){\r\n\t\tif($this->session->userdata('logged_in')){\r\n\t\t\tif($this->session->userdata('id_role') == 1){\r\n\t\t\t\t$this->load->library('form_validation');\r\n\t\t\t\t$this->form_validation->set_rules('id_tu', 'ID Admin', 'required');\r\n\t\t\t\tif($this->form_validation->run() == FALSE){\r\n\t\t\t\t\t$this->session->set_flashdata('error', 'Missing required Field!');\r\n\t\t redirect('/tata_usaha');\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$id_tu = $this->input->post('id_tu');\r\n\t\t\t\t\t$this->load->model('Users');\r\n\t\t\t\t\t$res_update = $this->Users->changeStatus($id_tu, 0);\r\n\t\t\t\t\tif($res_update){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'Berhasil menonaktifkan petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$this->session->set_flashdata('error', 'Gagal menonaktifkan petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tredirect('/');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "function promote_class($param1 = '', $param2 = '', $param3 = '') {\n $page_data['teachers'] = $this->db->get('teacher')->result_array();\n $page_data['page_name'] = 'promote_class';\n $page_data['page_title'] = get_phrase('promote_class');\n $this->load->view('backend/index', $page_data);\n }", "function isteacher($courseid=0, $userid=0, $obsolete_includeadmin=true) {\n/// Is the user able to access this course as a teacher?\n global $CFG;\n\n if (empty($CFG->rolesactive)) { // Teachers are locked out during an upgrade to 1.7\n return false;\n }\n\n if ($courseid) {\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n } else {\n $context = get_context_instance(CONTEXT_SYSTEM);\n }\n\n return (has_capability('moodle/legacy:teacher', $context, $userid, false)\n or has_capability('moodle/legacy:editingteacher', $context, $userid, false)\n or has_capability('moodle/legacy:admin', $context, $userid, false));\n}", "function setupTemplate($subclass = false) {\n\t\tparent::validate();\n\n\t\t$templateMgr = &TemplateManager::getManager();\n\t\t$templateMgr->assign('pageHierachy', array(array(Request::url(null, 'theses'), 'plugins.generic.thesis.theses')));\n\t}", "function prn_aktywacja() {\n $DD[] = \"IT_LOGOWANIE\";\n return get_template(\"user_enter\",'',$DD);\n }", "function isteacherinanycourse($userid=0, $includeadmin=true) {\n global $USER, $CFG;\n\n if (empty($CFG->rolesactive)) { // Teachers are locked out during an upgrade to 1.7\n return false;\n }\n\n if (!$userid) {\n if (empty($USER->id)) {\n return false;\n }\n $userid = $USER->id;\n }\n\n if (!record_exists('role_assignments', 'userid', $userid)) { // Has no roles anywhere\n return false;\n }\n\n/// If this user is assigned as an editing teacher anywhere then return true\n if ($roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW)) {\n foreach ($roles as $role) {\n if (record_exists('role_assignments', 'roleid', $role->id, 'userid', $userid)) {\n return true;\n }\n }\n }\n\n/// If this user is assigned as a non-editing teacher anywhere then return true\n if ($roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {\n foreach ($roles as $role) {\n if (record_exists('role_assignments', 'roleid', $role->id, 'userid', $userid)) {\n return true;\n }\n }\n }\n\n/// Include admins if required\n if ($includeadmin) {\n $context = get_context_instance(CONTEXT_SYSTEM);\n if (has_capability('moodle/legacy:admin', $context, $userid, false)) {\n return true;\n }\n }\n\n return false;\n}", "function activation()\n {\t\n\t\t$data['fal'] = $this->fal_front->activation();\n\t\t$this->load->view($this->_container, $data); \n }", "public function add() {\n\t\n\t\t# Make sure user is logged in if they want to use anything in this controller\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect(\"/index/unauthorized\");\n\t\t}\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_teachers_add');\n\n\t\t$this->template->title = \"Add Teacher\";\n\n\t\t$client_files_head = array(\"/css/teachers_add.css\");\n\t\t$this->template->client_files_head = Utils::load_client_files($client_files_head);\n\n\t\t#$client_files_body = array(\"/js/ElementValidation.js\", \"/js/shout_out_utils.js\");\n\t\t#$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\t# Render template\n\t\techo $this->template;\n\t\t\n\t}", "public function agreementPage()\n\t{\n $currentUser = $this->getCurrentUser(true);\n\n $this->putComponent(\"validation\", \"icheck\", \"select2\");\n $this->putScript(\"scripts/pages/agreement\");\n\n $user_language = $currentUser->getLanguage()->code;\n\n //if (!parent::template_exists(\"pages/agreement/{$user_language}.tpl\")) {\n $user_language = $this->translate->getSystemLanguageCode();\n //} else {\n //parent::display('pages/agreement/default.tpl');\n //}\n parent::display(\"pages/agreement/{$user_language}.tpl\");\n \n\t}", "function first_user_as_teacher()\n {\n initialize_forge_management_permissions();\n $user = User::all()->first();\n $user->assignRole('teacher');\n }", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "public function manageTeachers()\n {\n $teacherArr = Teacher::all();\n $departmentArr = Department::all();\n return view('teacher.auth.register',\n ['teachers' => $teacherArr, 'count' => 0, 'departments' => $departmentArr]);\n }", "function __construct()\n\t{\n\t\t$this->setOpt('active_title',1);\t\t# Activation des titres !!!\n\t\t$this->setOpt('active_setext_title',0);\t# Activation des titres setext (EXPERIMENTAL)\n\t\t$this->setOpt('active_hr',1);\t\t\t# Activation des <hr />\n\t\t$this->setOpt('active_lists',1);\t\t# Activation des listes\n\t\t$this->setOpt('active_quote',1);\t\t# Activation du <blockquote>\n\t\t$this->setOpt('active_pre',1);\t\t# Activation du <pre>\n\t\t$this->setOpt('active_empty',1);\t\t# Activation du bloc vide øøø\n\t\t$this->setOpt('active_auto_urls',0);\t# Activation de la reconnaissance d'url\n\t\t$this->setOpt('active_auto_br',0);\t# Activation du saut de ligne automatique (dans les paragraphes)\n\t\t$this->setOpt('active_antispam',1);\t# Activation de l'antispam pour les emails\n\t\t$this->setOpt('active_urls',1);\t\t# Activation des liens []\n\t\t$this->setOpt('active_auto_img',1);\t# Activation des images automatiques dans les liens []\n\t\t$this->setOpt('active_img',1);\t\t# Activation des images (())\n\t\t$this->setOpt('active_anchor',1);\t\t# Activation des ancres ~...~\n\t\t$this->setOpt('active_em',1);\t\t\t# Activation du <em> ''...''\n\t\t$this->setOpt('active_strong',1);\t\t# Activation du <strong> __...__\n\t\t$this->setOpt('active_br',1);\t\t\t# Activation du <br /> %%%\n\t\t$this->setOpt('active_q',1);\t\t\t# Activation du <q> {{...}}\n\t\t$this->setOpt('active_code',1);\t\t# Activation du <code> @@...@@\n\t\t$this->setOpt('active_acronym',1); \t# Activation des acronymes\n\t\t$this->setOpt('active_ins',1);\t\t# Activation des ins ++..++\n\t\t$this->setOpt('active_del',1);\t\t# Activation des del --..--\n\t\t$this->setOpt('active_inline_html',1);\t# Activation du HTML inline ``...``\n\t\t$this->setOpt('active_footnotes',1);\t# Activation des notes de bas de page\n\t\t$this->setOpt('active_wikiwords',0);\t# Activation des mots wiki\n\t\t$this->setOpt('active_macros',1);\t\t# Activation des macros /// ///\n\t\t\n\t\t$this->setOpt('parse_pre',1);\t\t\t# Parser l'intérieur de blocs <pre> ?\n\t\t\n\t\t$this->setOpt('active_fr_syntax',1);\t# Corrections syntaxe FR\n\t\t\n\t\t$this->setOpt('first_title_level',3);\t# Premier niveau de titre <h..>\n\t\t\n\t\t$this->setOpt('note_prefix','wiki-footnote');\n\t\t$this->setOpt('note_str','<div class=\"footnotes\"><h4>Notes</h4>%s</div>');\n\t\t$this->setOpt('note_str_single','<div class=\"footnotes\"><h4>Note</h4>%s</div>');\n\t\t$this->setOpt('words_pattern',\n\t\t'((?<![A-Za-z0-9])([A-Z][a-z]+){2,}(?![A-Za-z0-9]))');\n\t\t\n\t\t$this->setOpt('auto_url_pattern',\n\t\t'%(?<![\\[\\|])(http://|https://|ftp://|news:)([^\"\\s\\)!]+)%msu');\n\t\t\n\t\t$this->setOpt('acronyms_file',dirname(__FILE__).'/acronyms.txt');\n\t\t\n\t\t$this->acro_table = $this->__getAcronyms();\n\t\t$this->foot_notes = array();\n\t\t$this->functions = array();\n\t\t$this->macros = array();\n\t\t\n\t\t$this->registerFunction('macro:html',array($this,'__macroHTML'));\n\t}", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function teacher($param1 = '', $param2 = '', $param3 = ''){\n\t\t$page_data['folder_name'] = 'teacher';\n\t\t$page_data['page_title'] = 'techers';\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "function __construct() {\n\t\tparent::addCheckBox(\"table\");\n /**\n * Definicion de tipos de campos\n */\n $this->assignType(\"id\", \"ID\", BaseView::HIDDEN);\n $this->assignType(\"name\", JText::_(\"COM_CTC_NAME\"), BaseView::STRING );\n\t\t$this->assignType(\"description\", JText::_(\"COM_CTC_DESCRIPTION\"), BaseView::BIG_STRING);\n\t\t$this->assignType(\"code\", JText::_(\"COM_CTC_CODE\"), BaseView::STRING,array(\n BaseView::TOOLTIP => \"Código de la incidencia.\" ));\n\t\t$this->assignType(\"workcode\", JText::_(\"COM_CTC_WORKCODE\"), BaseView::STRING,array(\n BaseView::TOOLTIP => JText::_(\"COM_CTC_WORKCODE_DESC\") ));\n\t\t$this->assignType(\"status_id\", JText::_(\"COM_CTC_STATUS\"), BaseView::ENTITY, array(\n BaseView::ENT_VAR_NAME => \"status\",\n BaseView::ENT_CLASS => \"Status\",\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_FILTER => null));\n\t\t$this->assignType(\"paid\", \"Remunerada\", BaseView::PICKLIST, array(\n\t\t\t'F' => \"No\",\n\t\t\t'T' => \"Si\"\n\t\t));\t\t\n\t\t$this->addAuthFields();\t\n\t\n /**\n * Definicion de vistas y sus acciones\n */\n $class = \"payrollnoticetype\";\n $this->addViewEx(\"form\", array());\n $this->addAction(\"form\", $class . \"_form_submit\", JText::_(\"COM_CTC_SAVE\"), \"save.png\");\n $this->addAction(\"form\", $class . \"_form_cancel\", JText::_(\"COM_CTC_CANCEL\"), \"remove.png\");\n\n $this->addView(\"table\", array(\"name\", \"description\",\"code\",\"workcode\",\"status_id\", \"paid\"));\n\t\t$this->addAuthView( \"table\" );\n\t\t\n $this->addAction(\"table\", $class . \"_table_edit\", JText::_(\"COM_CTC_EDIT\"), \"edit.png\");\n $this->addAction(\"table\", $class . \"_table_remove\", JText::_(\"COM_CTC_DELETE\"), \"delete.png\");\n \n $this->addView(\"dialog\", array());\n $this->addAction(\"dialog\", $class . \"_dialog_ok\", JText::_(\"COM_CTC_OK\"), \"accept.png\");\n $this->addAction(\"dialog\", $class . \"_dialog_cancel\", JText::_(\"COM_CTC_CANCEL\"), \"remove.png\");\n }", "function main() {\n global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n $config = $BE_USER->getTSConfig('x4econgress');\n\t\t$this->id = $config['properties']['pidList'];\n\t\t$this->showFields = $config['properties']['showFields'];\n\t\t\n\t\tif(empty($this->showFields)){\n\t\t\t$this->showFields = 'name,firstname,type,address,zip,city,country,email,remarks';\n\t\t}\n\t\t\n // Access check!\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n $access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\n if (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id)) {\n\t\t\n // Draw the header.\n $this->doc = t3lib_div::makeInstance(\"bigDoc\");\n $this->doc->backPath = $BACK_PATH;\n //$this->doc->form='<form action=\"\" method=\"POST\">';\n $backUrl = 'http://'.$_SERVER['HTTP_HOST'].'/';\n\t\t\t$backUrl .= 'typo3/mod.php?M=txx4econgressM1_txx4econgressM1';\n\t\t\tif (isset($_POST['x4econgress_congresses'])) {\n\t\t\t\t$backUrl .= '&x4econgress_congresses='.$_POST['x4econgress_congresses'];\n\t\t\t}\n // JavaScript\n $this->doc->JScode = '\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 0;\n function jumpToUrl(URL) {\n document.location = URL;\n }\n\t\t\t\t\tfunction jump(url,modName,mainModName)\t{\n\t\t\t\t\t// Clear information about which entry in nav. tree that might have been highlighted.\n\t\t\t\t\ttop.fsMod.navFrameHighlightedID = new Array();\n\t\t\t\t\t\n\t\t\t\t\tif (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)\t{\n\t\t\t\t\t\ttop.content.nav_frame.refresh_nav();\n\t\t\t\t\t}\n\n\t\t\t\t\ttop.nextLoadModuleUrl = url;\n\t\t\t\t\ttop.goToModule(modName);\n\t\t\t\t\t}\n\t\t\t\t\tvar T3_THIS_LOCATION = top.getModuleUrl(top.TS.PATH_typo3+\"../typo3conf/ext/x4econgress/mod1/index.php?\");\n\t\t\t\t\tT3_THIS_LOCATION = \"'.urlencode($backUrl).'\";\n </script>\n ';\n $this->doc->postCode='\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 1;\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = '.intval($this->id).';\n </script>\n ';\n\n $headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->divider(5);\n\n // Render content:\n $this->moduleContent();\n\n\n // ShortCut\n if ($BE_USER->mayMakeShortcut()) {\n $this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n }\n\n $this->content.=$this->doc->spacer(10);\n } else {\n // If no access or if ID == zero\n\n $this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n $this->doc->backPath = $BACK_PATH;\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->spacer(5);\n $this->content.=$this->doc->spacer(10);\n }\n }", "function sqlTeacherIDForm()\n\t{\n\t\t//echo '<hr>Nama class ini :' . __METHOD__ . '()<hr>';\n\t\t$sql = \"SELECT \"\n\t\t. \"teacher_name,teacher_address,teacher_emailid,teacher_qualification,teacher_doj,\"\n\t\t. \"teacher_ic,teacher_phone,teacher_acc,teacher_image,teacher_grade_id,teacher_id \"\n\t\t. \" FROM tbl_teacher \"\n\t\t. \" WHERE teacher_id = :id \"\n\t\t. \"\";\n\n\t\treturn $sql;\n\t}", "private function _displayForm()\n\t{\n\t\t$transactions = array('0'=>$this->l('Authorization'),'1'=>$this->l('Preauthorization'),'2'=>$this->l('Preauthorization confirmation'),'3'=>$this->l('Callback'), '5' => $this->l('Recurring transaction'), '6' => $this->l('Successive transaction'), '7' => $this->l('Preauthentication'), '8' => $this->l('Preauthentication confirmation'), '9' => $this->l('Cancellation of Preauthentication'), 'O' => $this->l('Delayed authorization'), 'P' => $this->l('Delayed authorization confirmation'), 'Q' => $this->l('Delayed authorization cancellation'), 'R' => $this->l('Released initial recurring deferred'), 'S' => $this->l('Successive recurrent released'));\n\t\t\n\t\t$transact = 0;\n\t\t$transact2 = 0;\n\t\t$transact3 = 0;\n\t\tif ( (Tools::getValue('trans') == \"\") and (isset($this->trans)) )\n\t\t\t$transact = $this->trans;\n\t\telse\n\t\t\t$transact = Tools::getValue('trans');\n\t\tif ( (Tools::getValue('trans2') == \"\") and (isset($this->trans2)) )\n\t\t\t$transact2 = $this->trans2;\n\t\telse\n\t\t\t$transact2 = Tools::getValue('trans2');\n\t\tif ( (Tools::getValue('trans3') == \"\") and (isset($this->trans3)) )\n\t\t\t$transact3 = $this->trans3;\n\t\telse\n\t\t\t$transact3 = Tools::getValue('trans3');\n\t\t// obtenemos las monedas dadas de alta en la tienda\n\t\t$currencies = Currency::getCurrencies();\n\t\tif ( (Tools::getValue('nombre') == \"\") and (isset($this->nombre)) )\n\t\t\t$nombre = $this->nombre;\n\t\telse\n\t\t\t$nombre = Tools::getValue('nombre');\n\t\tif ( (Tools::getValue('nombre2') == \"\") and (isset($this->nombre2)) )\n\t\t\t$nombre2 = $this->nombre2;\n\t\telse\n\t\t\t$nombre2 = Tools::getValue('nombre2');\n\t\tif ( (Tools::getValue('nombre3') == \"\") and (isset($this->nombre3)) )\n\t\t\t$nombre3 = $this->nombre3;\n\t\telse\n\t\t\t$nombre3 = Tools::getValue('nombre3');\n\t\tif ( (Tools::getValue('clave') == \"\") and (isset($this->clave)) )\n\t\t\t$clave = $this->clave;\n\t\telse\n\t\t\t$clave = Tools::getValue('clave');\n\t\tif ( (Tools::getValue('clave2') == \"\") and (isset($this->clave2)) )\n\t\t\t$clave2 = $this->clave2;\n\t\telse\n\t\t\t$clave2 = Tools::getValue('clave2');\n\t\tif ( (Tools::getValue('clave3') == \"\") and (isset($this->clave3)) )\n\t\t\t$clave3 = $this->clave3;\n\t\telse\n\t\t\t$clave3 = Tools::getValue('clave3');\n\t\t// Opciones para el select de monedas.\n\t\tif ( (Tools::getValue('moneda') == \"\") and (isset($this->moneda)) )\n\t\t\t$moneda = $this->moneda;\n\t\telse\n\t\t\t$moneda = Tools::getValue('moneda');\n\t\tif ( (Tools::getValue('moneda2') == \"\") and (isset($this->moneda2)) )\n\t\t\t$moneda2 = $this->moneda2;\n\t\telse\n\t\t\t$moneda2 = Tools::getValue('moneda2');\n\t\tif ( (Tools::getValue('moneda3') == \"\") and (isset($this->moneda3)) )\n\t\t\t$moneda3 = $this->moneda3;\n\t\telse\n\t\t\t$moneda3 = Tools::getValue('moneda3');\n\t\t\n\t\tif ( (Tools::getValue('codigo') == \"\") and (isset($this->codigo)) )\n\t\t\t$codigo = $this->codigo;\n\t\telse\n\t\t\t$codigo = Tools::getValue('codigo');\n\t\tif ( (Tools::getValue('codigo2') == \"\") and (isset($this->codigo2)) )\n\t\t\t$codigo2 = $this->codigo2;\n\t\telse\n\t\t\t$codigo2 = Tools::getValue('codigo2');\n\t\tif ( (Tools::getValue('codigo3') == \"\") and (isset($this->codigo3)) )\n\t\t\t$codigo3 = $this->codigo3;\n\t\telse\n\t\t\t$codigo3 = Tools::getValue('codigo3');\n\t\tif ( (Tools::getValue('terminal') == \"\") and (isset($this->terminal)) )\n\t\t\t$terminal = $this->terminal;\n\t\telse\n\t\t\t$terminal = Tools::getValue('terminal');\n\t\tif ( (Tools::getValue('terminal2') == \"\") and (isset($this->terminal2)) )\n\t\t\t$terminal2 = $this->terminal2;\n\t\telse\n\t\t\t$terminal2 = Tools::getValue('terminal2');\n\t\tif ( (Tools::getValue('terminal3') == \"\") and (isset($this->terminal3)) )\n\t\t\t$terminal3 = $this->terminal3;\n\t\telse\n\t\t\t$terminal3 = Tools::getValue('terminal3');\n\t\t// Opciones para activar/desactivar SSL\n\t\t$ssl = Tools::getValue('ssl', $this->ssl);\n\t\t$ssl_si = ($ssl == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$ssl_no = ($ssl == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para el comportamiento en error en el pago\n\t\t$error_pago = Tools::getValue('error_pago', $this->error_pago);\n\t\t$error_pago_si = ($error_pago == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$error_pago_no = ($error_pago == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para activar los idiomas\n\t\t$idiomas_estado = Tools::getValue('idiomas_estado', $this->idiomas_estado);\n\t\t$idiomas_estado_si = ($idiomas_estado == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$idiomas_estado_no = ($idiomas_estado == 'no') ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Opciones entorno\n\t\tif (!isset($_POST['urltpv']))\n\t\t\t$entorno = Tools::getValue('env', $this->env);\n\t\telse\n\t\t\t$entorno = $_POST['urltpv'];\n\t\t$entorno_real_redsys = ($entorno==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys = ($entorno==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa = ($entorno==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa = ($entorno==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 2\n\t\tif (!isset($_POST['urltpv2']))\n\t\t\t$entorno2 = Tools::getValue('env2', $this->env2);\n\t\telse\n\t\t\t$entorno2 = $_POST['urltpv2'];\n\t\t$entorno_real_redsys2 = ($entorno2==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys2 = ($entorno2==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa2 = ($entorno2==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa2 = ($entorno2==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 3\n\t\tif (!isset($_POST['urltpv3']))\n\t\t\t$entorno3 = Tools::getValue('env3', $this->env3);\n\t\telse\n\t\t\t$entorno3 = $_POST['urltpv3'];\n\t\t$entorno_real_redsys3 = ($entorno3==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys3 = ($entorno3==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa3 = ($entorno3==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa3 = ($entorno3==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones del tipo de firma\n\t\t$tipofirma = Tools::getValue('tipofirma', $this->tipofirma);\n\t \t$tipofirma_a = ($tipofirma==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c = ($tipofirma==1) ? ' checked=\"checked\" ' : '';\n \t\t$tipofirma2 = Tools::getValue('tipofirma2', $this->tipofirma2);\n\t \t$tipofirma_a2 = ($tipofirma2==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c2 = ($tipofirma2==1) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma3 = Tools::getValue('tipofirma3', $this->tipofirma3);\n\t \t$tipofirma_a3 = ($tipofirma3==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c3 = ($tipofirma3==1) ? ' checked=\"checked\" ' : '';\n\t \n\t // Opciones notificacion\n\t $notificacion = Tools::getValue('notificacion', $this->notificacion);\n\t\t$notificacion_s = ($notificacion==1) ? ' checked=\"checked\" ' : '';\n\t\t$notificacion_n = ($notificacion==0) ? ' checked=\"checked\" ' : '';\n\t\t// Opciones multimoneda\n\t $multimoneda = Tools::getValue('multimoneda', $this->multimoneda);\n\t\t$multimoneda_s = ($multimoneda==1) ? ' checked=\"checked\" ' : '';\n\t\t$multimoneda_n = ($multimoneda==0) ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Mostar formulario\n\t\t$this->_html .=\n\t\t'<form action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/contact.gif\" />'.$this->l('Virtual POS configuration').'</legend>\n\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"4\" id=\"form\" style=\"font-size:12px;margin-bottom:3px\">\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 1</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre\" value=\"'.htmlentities($nombre, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></div></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave\" value=\"'.$clave.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal\" value=\"'.$terminal.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo\" value=\"'.$codigo.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_c\" value=\"1\"'.$tipofirma_c.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_a\" value=\"0\"'.$tipofirma_a.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 2</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv2\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys2.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys2.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa2.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa2.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre2\" value=\"'.htmlentities($nombre2, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave2\" value=\"'.$clave2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal2\" value=\"'.$terminal2.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda2\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda2 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected2.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo2\" value=\"'.$codigo2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_c2\" value=\"1\"'.$tipofirma_c2.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_a2\" value=\"0\"'.$tipofirma_a2.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans2\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact2 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected2.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 3</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv3\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys3.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys3.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa3.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa3.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre3\" value=\"'.htmlentities($nombre3, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave3\" value=\"'.$clave3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal3\" value=\"'.$terminal3.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda3\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\tif ($moneda3 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected3.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo3\" value=\"'.$codigo3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_c3\" value=\"1\"'.$tipofirma_c3.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_a3\" value=\"0\"'.$tipofirma_a3.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t<td><select name=\"trans3\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact3 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected3.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/cog.gif\" />'.$this->l('Customization').'</legend>\n\t\t\t\t<table border=\"0\" width=\"680\" cellpadding=\"0\" cellspacing=\"0\" id=\"form\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('Multicurrency activation (only in stores with more than one terminal)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_1\" value=\"1\"'.$multimoneda_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_0\" value=\"0\"'.$multimoneda_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('HTTP notification (if disabled not process order and empty your cart)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_1\" value=\"1\"'.$notificacion_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_0\" value=\"0\"'.$notificacion_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('URL validation with SSL').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_1\" value=\"si\" '.$ssl_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_0\" value=\"no\" '.$ssl_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('On error, allowing choose another payment method').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_1\" value=\"si\" '.$error_pago_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_0\" value=\"no\" '.$error_pago_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('Enable languages in POS').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_si\" value=\"si\" '.$idiomas_estado_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_no\" value=\"no\" '.$idiomas_estado_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t<input class=\"button\" name=\"btnSubmit\" value=\"'.$this->l('Save configuration').'\" type=\"submit\" />\n\t\t</form>';\n\t}", "function onAction_agent_trojan()\n {\n $bAskPasscode = true;\n $code = false;\n\n $this->set('ask_passcode', false);\n\n if (isset($_POST['passcode']))\n {\n $code = $_POST['passcode'];\n }\n else if (isset($_GET['passcode']))\n {\n $code = $_GET['passcode'];\n }\n\n if ($code === PASSCODE_TROJAN)\n {\n $bAskPasscode = false;\n }\n\n if ($bAskPasscode === true)\n {\n // no passcode set or wrong, so must ask user\n $this->m_bRender = true;\n $this->set('ask_passcode', true);\n }\n else\n {\n // do some actions...\n\n // finally... redirect to main page\n $this->redirect('/');\n }\n }", "function _dropbox_authorize_content($assignment_id,$student_id)\n{\n global $user_id;\n global $class_id;\n global $class_level;\n // Any student other than the user is not allowed to see the content\n if($user_id != $student_id && $class_level == 1)\n return false;\n // We know that the teacher is part of the class, make sure the assignment is part of it as well\n $result = good_query(\"SELECT id FROM dropbox_assignments WHERE id = $assignment_id AND class_id = $class_id\");\n return (mysqli_num_rows($result) == 1);\n}", "function user_TCAform_test2(&$PA, &$fobj) {\r\n\t\tglobal $LANG;\r\n\t\t$LANG->includeLLFile(\"EXT:civserv/res/locallang_user_be_msg.php\");\r\n\t\t$ms_container_name='unbekannt'; //dummy \r\n\t\t$ms_container_pid = $PA['row']['pid'];\r\n\t\tif(preg_match('/NEW/', $PA['row']['uid'])){\r\n\t\t\t// select mandant-roles from table pages where the doktype is 'Model Service Container'\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t'title, tx_civserv_ms_mandant, tx_civserv_ms_approver_one, tx_civserv_ms_approver_two',\t\t\t\t// Field list for SELECT\r\n\t\t\t\t'pages ',\t\t\t\t\t\t\t// Tablename, local table\r\n\t\t\t\t'deleted=0 AND hidden=0 AND doktype= \\'242\\' AND uid='.$PA['row']['pid'],\t\t\t\t\t\t\t\t// Optional additional WHERE clauses\r\n\t\t\t\t'',\t\t\t\t\t\t\t\t\t\t\t\t\t// Optional GROUP BY field(s), if none, supply blank string.\r\n\t\t\t\t'',\t\t\t\t\t\t\t\t// Optional ORDER BY field(s), if none, supply blank string.\r\n\t\t\t\t'' \t\t\t\t\t\t\t\t\t\t\t\t\t// Optional LIMIT value ([begin,]max), if none, supply blank string.\r\n\t\t\t);\r\n\t\t\t$value=0;\r\n\t\t\t$text='';\r\n\t\t\twhile ($data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { //precisely once......\r\n\t\t\t\t$ms_container_name = $data['title'];\r\n\t\t\t\tswitch ($PA['field']){\r\n\t\t\t\t\tcase 'ms_mandant':\r\n\t\t\t\t\t\t$value = $data['tx_civserv_ms_mandant'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'ms_approver_one':\r\n\t\t\t\t\t\t$value = $data['tx_civserv_ms_approver_one'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'ms_approver_two':\r\n\t\t\t\t\t\t$value = $data['tx_civserv_ms_approver_two'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($value == 0){ // mandant roles not set in modelservice container? return!\r\n\t\t\t\t$div_open= '\r\n\t\t\t\t\t<div style=\"\r\n\t\t\t\t\t\t border: 2px dashed #666666;\r\n\t\t\t\t\t\t width : 90%;\r\n\t\t\t\t\t\t margin: 5px 5px 5px 5px;\r\n\t\t\t\t\t\t padding: 5px 5px 5px 5px;\"\r\n\t\t\t\t\t\t >';\r\n\t\t\t\t$info_img = '<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/required_h.gif','width=\"18\" height=\"16\"').' title=\"'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close',1).'\" alt=\"\" />';\r\n\t\t\t\t$msg .= '<p>'.$info_img.'&nbsp;&nbsp;'.$LANG->getLL(\"tx_civserv_user_be_msg.tx_civserv_model_service.no_mandant_roles\").'</p>';\r\n\t\t\t\t$msg = str_replace('###ms_container_name###', $ms_container_name, $msg);\r\n\t\t\t\t$msg = str_replace('###ms_container_uid###', $ms_container_pid, $msg);\r\n\t\t\t\treturn $div_open.$msg.$div_close;\r\n\t\t\t}else{\r\n\t\t\t\t//get human readable names for the mandant-roles\r\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t\t'cm_community_name',\t\t\t \t\t\t// SELECT ...\r\n\t\t\t\t\t'tx_civserv_conf_mandant',\t\t\t// FROM ...\r\n\t\t\t\t\t'cm_community_id = '.$value,\t// AND title LIKE \"%blabla%\"', // WHERE...\r\n\t\t\t\t\t'', \t\t\t\t\t\t// GROUP BY...\r\n\t\t\t\t\t'', \t\t\t\t\t\t// ORDER BY...\r\n\t\t\t\t\t'' \t\t\t\t\t\t\t// LIMIT to 10 rows, starting with number 5 (MySQL compat.)\r\n\t\t\t\t);\r\n\t\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t\t\t\t$text = $row['cm_community_name'];\t\t\t\r\n\t\t\t\t$div_open='<div style=\"width : 90%; margin: 5px 5px 5px 5px; padding: 5px 5px 5px 5px; border:0;\">';\r\n\t\t\t\t$html_field='<input type=\"hidden\"\tname=\"'.$PA['itemFormElName'].'\"\r\n\t\t\t\t\t\t\t\tvalue=\"'.$value.'\"\r\n\t\t\t\t\t\t\t\t'.$PA['onFocus'].'/>\r\n\t\t\t\t\t\t\t<span>'.$text.' ('.$LANG->getLL(\"tx_civserv_user_be_msg.tx_civserv_model_service.community_code\").': '.$value.')</span>';\r\n\t\t\t\t$div_close='</div>';\r\n\t\t\t} //mandant roles not set correctly!!!\r\n\t\t}else{\t// old record\t\r\n\t\t\t$value='';\r\n\t\t\t$text='';\r\n\t\t\tswitch ($PA['field']){\r\n\t\t\t\tcase 'ms_mandant':\r\n\t\t\t\t\t$value = $PA['row']['ms_mandant'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ms_approver_one':\r\n\t\t\t\t\t$value = $PA['row']['ms_approver_one'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ms_approver_two':\r\n\t\t\t\t\t$value = $PA['row']['ms_approver_two'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//get human readable names for the mandant-roles\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t'cm_community_name',\t\t\t \t\t\t// SELECT ...\r\n\t\t\t\t'tx_civserv_conf_mandant',\t\t\t// FROM ...\r\n\t\t\t\t'cm_community_id = '.$value,\t// AND title LIKE \"%blabla%\"', // WHERE...\r\n\t\t\t\t'', \t\t\t\t\t\t// GROUP BY...\r\n\t\t\t\t'', \t\t\t\t\t\t// ORDER BY...\r\n\t\t\t\t'' \t\t\t\t\t\t\t// LIMIT to 10 rows, starting with number 5 (MySQL compat.)\r\n\t\t\t);\r\n\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t\t\t$text = $row['cm_community_name'];\t\t\t\r\n\t\t\t$div_open = '<div style=\"width : 90%; margin: 5px 5px 5px 5px; padding: 5px 5px 5px 5px;\">';\r\n\t\t\t$html_field = $text.\" (Gemeindekennziffer: \".$value.\")\";\r\n\t\t\t$div_close = '</div>';\r\n\t\t}\r\n\t\treturn $div_open.$html_field.$div_close;\r\n\t}", "public function class_wise_subject($class_id) {\n\t\t$page_data['class_id'] = $class_id;\n\t\t$this->load->view('backend/student/subject/dropdown', $page_data);\n\t}", "public function sub_eng_class()\r\n\t{\r\n\t\t// get post data\r\n\t\t$data['post'] = $this->input->post();\r\n\t\t// update db\r\n\t\t$this->caifmodel->eng_class($data['post']);\r\n\t\t// redirect\r\n\t\tredirect(base_url().'events/eng_class','location');\r\n\t}", "public function enrollment_view_page() \n {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $this->load->model('internal_user_model');\n $tenant_id = $this->tenant_id;\n $loggedin_user_id = $this->user->user_id;\n extract($_POST);\n if ($search_select == 1) \n {\n $user_id = $taxcode_id;\n } \n else \n {\n $user_id = $trainee_id;\n }\n $account_type = $this->input->post('account_type');\n $this->load->library('form_validation');\n $this->form_validation->set_rules('course', 'Course', 'required');\n if ($this->form_validation->run() == FALSE) {\n $data['courses'] = $this->get_active_classcourse_list_by_tenant($tenant_id);\n if ($course) {\n $result = $this->classtraineemodel->get_trainee_classes($this->tenant_id, $course, $trainee_id, $taxcode_id);\n foreach ($result as $k => $row) {\n if ($row->class_pymnt_enrol == 'PDENROL') {\n $totalbooked = $this->class->get_class_booked($row->course_id, $row->class_id, $this->tenant_id);\n if ($totalbooked >= $row->total_seats) {\n unset($result[$k]);\n }\n }\n }\n $data['classes'] = $result;\n }\n $data['companies'] = $this->company->get_activeuser_companies_for_tenant($tenant_id);\n $data['page_title'] = 'Class Trainee';\n $data['main_content'] = 'classtrainee/addnewenroll';\n //$data['sideMenuData'] = $this->sideMenu;\n $this->load->view('layout', $data);\n } else {\n $data['courses'] = $courses = $this->course->get_course_detailse($course);\n $data['course_manager'] = rtrim($this->course->get_managers($courses->crse_manager), ', ');\n $data['courseLevel'] = $this->course->get_metadata_on_parameter_id($courses->certi_level);\n $data['classes'] = $classes = $this->class->get_class_details($tenant_id, $class);\n \n \n \n /* get the sales executive name based on course- prit* 18-07-2016*/\n $course_salesexec = $this->class->get_course_salesexec1($tenant_id, $course);\n $sales=array();\n foreach ($course_salesexec as $value){\n $sales[]=$value->user_id;\n \n }\n $sales_executive= implode(',', $sales);\n //$data['salesexec'] = $this->class->get_class_salesexec($tenant_id, $classes->course_id, $classes->sales_executive);\n $data['salesexec'] = $this->class->get_class_salesexec($tenant_id, $classes->course_id, $sales_executive);\n \n \n $totalbooked = $this->class->get_class_booked($classes->course_id, $classes->class_id, $tenant_id);\n $data['available'] = $classes->total_seats - $totalbooked;\n $data['ClassPay'] = rtrim($this->course->get_metadata_on_parameter_id($classes->class_pymnt_enrol), ', ');\n $data['ClassLang'] = rtrim($this->course->get_metadata_on_parameter_id($classes->class_language), ', ');\n $data['ClassLoc'] = $this->get_classroom_location($classes->classroom_location, $classes->classroom_venue_oth);\n $data['ClassTrainer'] = $this->class->get_trainer_names($classes->classroom_trainer);\n $data['LabTrainer'] = $this->class->get_trainer_names($classes->lab_trainer);\n $data['Assessor'] = $this->class->get_trainer_names($classes->assessor);\n $data['TrainingAide'] = $this->class->get_course_manager_names($classes->training_aide);\n $data['gstrate'] = $gstrate = $this->classtraineemodel->get_gst_current();\n $data['gstlabel'] = $gst_label = ($courses->gst_on_off == 1) ? 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($courses->subsidy_after_before), ', ') : 'GST OFF';\n $data['subsidy_type'] = $this->classtraineemodel->get_subsidy_type($tenant_id);\n if ($account_type == 'individual') {\n $data['trainee_name'] = $this->classtraineemodel->get_notenrol_trainee_name('', '', $user_id, $tenant_id);\n $data['discount'] = $discount = $this->classtraineemodel->calculate_discount_enroll($user_id, 0, $class, $course, $classes->class_fees); \n $data['feesdue'] = $feesdue = round($classes->class_fees - round((($discount['discount_rate'])/100 * ($classes->class_fees)),2),2);\n $data['gst_total'] = $this->classtraineemodel->calculate_gst($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, 0, $gstrate);\n $data['netdue'] = $this->classtraineemodel->calculate_net_due($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, 0, $gstrate);\n } elseif ($account_type == 'company') {\n $data['company_details'] = $company_details = $this->company->get_company_details($tenant_id, $company);\n if ($company[0] == \"T\") {\n $tenant_details = fetch_tenant_details($tenant_id);\n $data['company_details'][0]->company_name = $tenant_details->tenant_name;\n }\n $data['discount'] = $discount = $this->classtraineemodel->calculate_discount_enroll(0, $company, $class, $course, $classes->class_fees);\n $discount_label = $discount['discount_label'];\n $discount_rate = round($discount['discount_rate'],4);\n $discount_amount = round(($classes->class_fees * ($discount_rate / 100) ),2);\n if ($discount_amount > $classes->class_fees) {\n $discount_rate = 100;\n $discount_amount = $classes->class_fees;\n }\n $feesdue = round( ($classes->class_fees - $discount_amount),2);\n $company_net_due = 0;\n $company_unit_fees = 0;\n $company_discount_amount = 0;\n $company_gst_total = 0;\n if (!empty($control_6)) {\n $data['trainees'] = $this->classtraineemodel->get_trainee_details_for_trainee_ids($tenant_id, $control_6);\n }\n foreach ($control_6 as $user_id) {\n $gst_total = $this->classtraineemodel->calculate_gst($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, 0, $gstrate);\n $calculated_net_due = $this->classtraineemodel->calculate_net_due($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, 0, $gstrate);\n $company_net_due = round(($company_net_due + $calculated_net_due),2);\n $company_unit_fees = round( ($company_unit_fees + $classes->class_fees),2);\n $company_discount_amount = round( ($company_discount_amount + $discount_amount),2);\n $company_gst_total = round( ($company_gst_total + $gst_total),2);\n }\n $data['company_net_due'] = $company_net_due;\n $data['company_unit_fees'] = $company_unit_fees;\n $data['company_gst_total'] = $company_gst_total;\n $data['company_discount_amount'] = round($discount_amount,2); \n $data['company_discount_label'] = $discount_label; \n $data['company_discount_rate'] = $discount_rate;\n $data['pending_payments'] = $this->classtraineemodel->check_company_pending_payment($company);\n }\n $role = $this->internal_user_model->check_sales_exec1($loggedin_user_id);\n if($role->role_id!==\"ADMN\")\n {\n if ($this->user->role_id == 'SLEXEC' || $this->user->role_id=='CRSEMGR' || $this->user->role_id=='TRAINER') \n {\n $data['salesexec_check'] = 1;\n }\n }\n $data['tenant_id'] = $tenant_id;\n $data['page_title'] = 'Class Trainee';\n $data['main_content'] = 'classtrainee/enrollpayment';\n // $data['sideMenuData'] = $this->sideMenu;\n $data['restriction_flag'] = $this->input->post('restriction_flag');///added by shubhranshu\n $data['privilage'] = $this->input->post('privilage'); ///added by shubhranshu\n $this->load->view('layout', $data);\n }\n }", "public function t_pass()\n\t{\n\t\tif ($this->session->userdata('id_admin')) {\n\t\t$this->load->view('admin/layout/header');\n\t\t$this->load->view('add_passing');\n\t\t$this->load->view('admin/layout/footer');\n\t} //hak akses jika guru\n\t\telseif ($this->session->userdata('id_guru')) {\n\t\t$this->load->view('guru/layout/header');\n\t\t$this->load->view('add_passing');\n\t\t$this->load->view('guru/layout/footer');\n\t}\n\t}", "public function index() { \n $data['sideMenuData'] = fetch_non_main_page_content();\n $user_id = $this->uri->segment(3); \n $activation_key = $this->uri->segment(4); \n $is_valid = FALSE;\n $message=\"\"; \n $is_valid = $this->trainee_model->verify_trainee_user($user_id, $activation_key); \n if ($is_valid) { \n $data['message'] = 'Y';\n }else{\n $data['message'] = 'N';\n } \n $data['page_title'] = 'TMS Activation page';\n $this->load->view('common/activation', $data);\n }", "public function isTeacher($id){\n\t\treturn ($this->field('level',array('id'=>$id)) == 2);\n\t}", "public function show(Teacher $teacher)\n {\n $this->authorize('admin.teacher.show', $teacher);\n\n // TODO your code goes here\n }", "public function __construct()\n {\n parent::__construct();\n $this\n ->load\n ->helper(\"url\");\n\n $this\n ->load\n ->model(\"MEmpresa\");\n $this\n ->load\n ->model(\"MCups\");\n\n if ($this\n ->session\n ->userdata('rol_user') == 2 || $this\n ->session\n ->userdata('rol_user') == 3)\n {\n echo \"<p><b>ACCESO DENEGADO.</b> Señor usuario, se encuentra intentando acceder\" . \" a un sitio al cual no tiene permiso de acceso.</p>\";\n exit;\n }\n\n }", "public function Professional(){\n\t\tparent::__construct();\n\t\tif($this->session->userdata(\"userdetails\")==NULL){\n\t\t\tredirect(base_url());\n\t\t}\n\t\telse{\n\t\t\t$obj=$this->session->userdata(\"loggedinas\");\n\t\t\tif($obj==\"student\"){\n\t\t\t\tredirect(\"student/home\");\n\t\t\t}elseif($obj==\"teacher\"){\n\t\t\t\tredirect(\"teacher/home\");\n\t\t\t}elseif($obj==\"tpo\"){\n\t\t\t\tredirect(\"tpo/home\");\n\t\t\t}\n\t\t}\n\t}", "public function ivtd()\n {\n session_start();\n if (!isset($_SESSION[\"Instructor\"])) {\n\n header('Location: ../inicio');\n\n } else {\n\n $this->vista('invitado/menu');\n\n }\n }", "public function hasTeacher(){\r\n return $this->_has(4);\r\n }", "function pnh_franchise_activate_imei()\r\n\t{\r\n\t\t$user=$this->erpm->auth(CALLCENTER_ROLE);\r\n\t\t\r\n\t\t$data['fran_list'] = $this->db->query(\"select franchise_id,franchise_name from pnh_m_franchise_info where is_suspended = 0 order by franchise_name \");\t\r\n\t\t$data['page']=\"pnh_franchise_activate_imei\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t}", "public function lcformAction(){\n \n $id = $this->getEvent()->getRouteMatch()->getParam('id');\n $subid = $this->getEvent()->getRouteMatch()->getParam('subparam');\n $lecturermodule = \"\";\n if($subid){\n $lecturermodule = $this->em->getRepository(\"\\Application\\Entity\\Lecturermodule\")->find($subid);\n }\n \n \n $deptentity = $this->em->getRepository(\"\\Application\\Entity\\Staff\")->findOneBy(array(\"fkUserid\"=>$this->userid));;\n //Get selected module information\n $module = $this->em->getRepository(\"\\Application\\Entity\\Classmodule\")->find($id);\n \n //Get form\n $form = new \\Application\\Form\\Lecturermodule($this->em,$deptentity->getFkDeptid()->getPkDeptid());\n \n $form->bind($this->request->getPost());\n if($this->request->getPost('save')){\n $form->setData($this->request->getPost());\n if($form->isValid()){\n $formData = $form->getData();\n \n //If request other departments option is not selected\n if($formData['Lecturermodule']['fkStaffid'] != \"-1\"){\n \n if($subid){\n //Get existing record information\n $entity = $lecturermodule;\n }else{\n //Set new entity\n $entity = new \\Application\\Entity\\Lecturermodule();\n }\n \n //Delete serviced module first\n $this->exams->deletefromdb(\"\\Application\\Entity\\Servicedmodule\", array(\"fkClassmoduleid\"=>$module->getPkClassmoduleid()));\n \n //Get selected staff entity\n $staffentity = $this->em->getRepository('\\Application\\Entity\\Staff')->find($formData['Lecturermodule']['fkStaffid']);\n \n $entity->setFkClassmoduleid($module);\n $entity->setFkStaffid($staffentity);\n $this->exams->saveLecturerModule($entity);\n $this->redirect()->toRoute(\"examination\",array(\"action\"=>\"lecturermodule\"));\n }else{\n //Define custom validation\n $validator = new \\Zend\\Validator\\Callback(function($formvalue){\n //Checking if department has been selected on not\n return empty($formvalue['fkReqdeptid'])?false:true;\n });\n \n $validator->setMessage(\"Select department\");\n\n if($validator->isValid($formData)){\n \n //Delete any lecturer assigned to the module\n $this->exams->deletefromdb(\"\\Application\\Entity\\Lecturermodule\", array(\"fkClassmoduleid\"=>$module->getPkClassmoduleid()));\n \n //Get servicing department entity\n $servicingdeptentity = $this->em->getRepository('\\Application\\Entity\\Department')->find($formData['fkReqdeptid']);\n \n //If the module is already assigned update\n $currentmodule = $this->em->getRepository('\\Application\\Entity\\Servicedmodule')->findOneBy(array(\"fkClassmoduleid\"=>$module->getPkClassmoduleid()));\n if(count($currentmodule)>0){\n $entity = $currentmodule;\n }else{\n //Save serviced entity\n $entity = new \\Application\\Entity\\Servicedmodule();\n }\n \n $entity->setFkClassmoduleid($module);\n $entity->setReqdept($deptentity->getFkDeptid());\n $entity->setServicingdept($servicingdeptentity);\n $entity->setFlag(\"REQUESTED\");\n if($this->exams->saveServicedModule($entity)){\n //If allocatre, send an email to hod\n }\n $this->redirect()->toRoute(\"examination\",array(\"action\"=>\"lecturermodule\"));\n }else{\n $messages = $validator->getMessages();\n $form->get('fkReqdeptid')->setMessages(array($messages['callbackValue']));\n }\n \n }\n \n \n \n }\n }\n \n return new ViewModel(array(\"module\"=>$module,\"form\"=>$form,\"details\"=>$lecturermodule));\n }", "public function launchControls(){\n if(strlen($this->params['pseudo'])<8){\n $this->error['pseudo']='Min 8 caracteres';\n }\n\n if(strlen($this->params['password'])<8){\n $this->error['password']='Min 8 caracteres';\n }\n\n \n if(empty($this->error)==false){\n return $this->error;\n }\n else{\n \n \n $bdd=new BddManager();\n $user=new User;\n $user->setPseudo($this->params['pseudo']);\n $user->setPassword($this->params['password']);\n $userRepository = $bdd->getUserRepository();\n $user = $userRepository->checkUsernamePassword($user);\n\n\n \n if(empty($user)){\n \n $this->error['identifiants']='Pseudonyme ou Mot de passe incorrect';\n return $this->error;\n }\n\n else{\n \n $_SESSION[\"user\"] = $user;\n // Flight::redirect('/');\n }\n }\n }", "public function classwise()\n {\n $class=classes::where('bid', Auth::guard('web')->user()->bId)->get();\n\n return view('backend.pages.mystudent.classwiseStudent')->with('class', $class);\n\n }", "public function actionPlanclassesvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t/**\n\t\t * Declaring Session Variables**\n\t\t */\n\t\t$this->layout = 'main';\n\t\t$session = \\Yii::$app->session;\n\t\t$logged_user_id = $session ['client_user_id'];\n\t\t$arr_offer_types = array ();\n\t\t$validation_rule_ids = array ();\n\t\t$update_validations = array ();\n\t\t$arrvalidations = array ();\n\t\t$arrsection_elements = array ();\n\t\t$validated_rule_ids = array ();\n\t\t$arrvalidation_errors = array ();\n\t\t$post_validation_errors = array ();\n\t\t$old_plan_type = '';\n\t\t\n\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t$common_validation_component = new CommonValidationsComponent ();\n\t\t$model_element_master = new TblAcaElementMaster ();\n\t\t$model_plan_coverage_type = new TblAcaPlanCoverageType ();\n\t\t$model_plan_offer_type_years = new TblAcaPlanOfferTypeYears ();\n\t\t$model_plan_coverage_type_offered = new TblAcaPlanCoverageTypeOffered ();\n\t\t$model_plan_emp_contributions = new TblAcaEmpContributions ();\n\t\t$model_plan_emp_contributions_premium = new TblAcaEmpContributionsPremium ();\n\t\t\n\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\n\t\tif (! empty ( $get_company_id )) {\n\t\t\t\n\t\t\t\n\t\t\t/**\n\t\t\t * Encrypted company ID*\n\t\t\t */\n\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t$encrypt_plan_class_id = $get_company_id ['plan_class_id'];\n\t\t\t\n\t\t\tif (! empty ( $encrypt_company_id ) && ! empty ( $encrypt_plan_class_id )) {\n\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t$plan_class_id = $encrypt_component->decryptUser ( $encrypt_plan_class_id ); // Decrypted plan class Id\n\t\t\t\t \n\t\t\t\t// getting company details\n\t\t\t\t$company_details = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t] )->one ();\n\t\t\t\t\n\t\t\t\t// checking if the validation starts for this company\n\t\t\t\t\n\t\t\t\t$company_validation = TblAcaCompanyValidationStatus::find ()->where ( [ \n\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t'is_initialized' => 1 \n\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t'is_completed' => 0 \n\t\t\t\t] )->One ();\n\t\t\t\t\n\t\t\t\t// / getting plan class name\n\t\t\t\t\n\t\t\t\t$plan_class_details = TblAcaPlanCoverageType::find ()->where ( [ \n\t\t\t\t\t\t'plan_class_id' => $plan_class_id \n\t\t\t\t] )->One ();\n\t\t\t\t// / getting data from plan class validation log\n\t\t\t\tif (! empty ( $plan_class_details )) {\n\t\t\t\t\t\n\t\t\t\t\t$validation_rule_ids = [ \n\t\t\t\t\t\t\t'63',\n\t\t\t\t\t\t\t'64',\n\t\t\t\t\t\t\t'65',\n\t\t\t\t\t\t\t'66',\n\t\t\t\t\t\t\t'67',\n\t\t\t\t\t\t\t'68',\n\t\t\t\t\t\t\t'69',\n\t\t\t\t\t\t\t'70',\n\t\t\t\t\t\t\t'71',\n\t\t\t\t\t\t\t'72',\n\t\t\t\t\t\t\t'73',\n\t\t\t\t\t\t\t'74',\n\t\t\t\t\t\t\t'148'\n\t\t\t\t\t];\n\t\t\t\t\t\n\t\t\t\t\t$element_ids = [ \n\t\t\t\t\t\t\t'76',\n\t\t\t\t\t\t\t'77',\n\t\t\t\t\t\t\t'78',\n\t\t\t\t\t\t\t'79',\n\t\t\t\t\t\t\t'80',\n\t\t\t\t\t\t\t'81',\n\t\t\t\t\t\t\t'82',\n\t\t\t\t\t\t\t'83',\n\t\t\t\t\t\t\t'84',\n\t\t\t\t\t\t\t'85',\n\t\t\t\t\t\t\t'86',\n\t\t\t\t\t\t\t'87' \n\t\t\t\t\t];\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *Check for validation errors***\n\t\t\t\t\t */\n\t\t\t\t\t$validation_results = TblAcaPlanClassValidationLog::find ()->select ( 'validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\n\t\t\t\t\tif (! empty ( $validation_results )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $validation_results as $validations ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$arrvalidations [] = $validations->validation_rule_id;\n\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_message'] = $validations->validationRule->error_message;\n\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_code'] = $validations->validationRule->error_code;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Get all errors for general info *\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$get_post_validation_errors = TblAcaValidationRules::find ()->select ( 'rule_id, error_code, error_message' )->where ( [ \n\t\t\t\t\t\t\t\t'rule_id' => $validation_rule_ids \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $get_post_validation_errors )) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $get_post_validation_errors as $errors ) {\n\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_message'] = $errors->error_message;\n\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_code'] = $errors->error_code;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * *************get section elements*********************\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$section_ids = [ \n\t\t\t\t\t\t\t\t'9',\n\t\t\t\t\t\t\t\t'10',\n\t\t\t\t\t\t\t\t'11' \n\t\t\t\t\t\t];\n\t\t\t\t\t\t$all_elements = $model_element_master->FindallbysectionIds ( $section_ids );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$arrsection_elements = ArrayHelper::map ( $all_elements, 'element_id', 'element_label' );\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * ****************Get plan offer type years**************************\n\t\t\t\t\t\t */\n\t\t\t\t\t\t\n\t\t\t\t\t\t$all_offer_types = $model_plan_offer_type_years->FindbyplanclassId ( $plan_class_id );\n\t\t\t\t\t\tif (! empty ( $all_offer_types )) {\n\t\t\t\t\t\t\t$arr_offer_types = ArrayHelper::map ( $all_offer_types, 'plan_year', 'plan_year_value', 'plan_year_type' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$model_plan_coverage_type = $plan_class_details;\n\t\t\t\t\t\t$old_plan_type = $model_plan_coverage_type->plan_offer_type;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * *Get plan class coverage type*\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$plan_coverage_type_offered = $model_plan_coverage_type_offered->FindplanbyId ( $plan_class_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $plan_coverage_type_offered )) {\n\t\t\t\t\t\t\t$model_plan_coverage_type_offered = $plan_coverage_type_offered;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Get Emp contribution*\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$emp_contribution_details = $model_plan_emp_contributions->FindbycoveragetypeId ( $plan_coverage_type_offered->coverage_type_id );\n\t\t\t\t\t\t\tif (! empty ( $emp_contribution_details )) {\n\t\t\t\t\t\t\t\t$model_plan_emp_contributions = $emp_contribution_details;\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 * Get Emp contribution premium*\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$emp_contribution_premium_details = $model_plan_emp_contributions_premium->FindbyempcontributionId ( $emp_contribution_details->emp_contribution_id );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (! empty ( $emp_contribution_premium_details )) {\n\t\t\t\t\t\t\t\t\t$model_plan_emp_contributions_premium = $emp_contribution_premium_details;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$plan_class_post_details = \\Yii::$app->request->post ();\n\t\t\t\t\t\tif (! empty ( $plan_class_post_details )) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// begin transaction\n\t\t\t\t\t\t\t$transaction = \\Yii::$app->db->beginTransaction ();\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (! empty ( $plan_class_post_details ['TblAcaPlanCoverageType'] )) {\n\t\t\t\t\t\t\t\t\t$plan_coverage_type = $this->PlanCoverageType ( $company_id, $plan_class_id, $plan_class_post_details );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (! empty ( $plan_coverage_type ['success'] ) && ! empty ( $plan_coverage_type ['plan_class_id'] )) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$model_plan_coverage_type = TblAcaPlanCoverageType::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t'plan_class_id' => $plan_class_id \n\t\t\t\t\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * ****************Get plan offer type years**************************\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$all_offer_types = $model_plan_offer_type_years->FindbyplanclassId ( $plan_class_id );\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $all_offer_types )) {\n\t\t\t\t\t\t\t\t\t\t\t$arr_offer_types = ArrayHelper::map ( $all_offer_types, 'plan_year', 'plan_year_value', 'plan_year_type' );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (! empty ( $plan_class_post_details ['TblAcaPlanCoverageType'] )) {\n\t\t\t\t\t\t\t\t\t$plantype = $plan_class_post_details ['TblAcaPlanCoverageType']['plantype'];\n\t\t\t\t\t\t\t\t\t$plan_coverage_type_offered_result = $this->Coveragetypeoffered ( $company_id, $plan_class_id, $plan_class_post_details );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (! empty ( $plan_coverage_type_offered_result ['success'] ) && ! empty ( $plan_coverage_type_offered_result ['coverage_type_id'] )) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$post_coverage_type_id = $plan_coverage_type_offered_result ['coverage_type_id'];\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * *Get plan class coverage type*\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t$model_plan_coverage_type_offered = $model_plan_coverage_type_offered->FindplanbyId ( $plan_class_id );\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $plan_class_post_details ['TblAcaEmpContributions'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$plan_emp_contribution_result = $this->Empcontribution ( $company_id, $plan_class_id, $plan_class_post_details );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $plan_emp_contribution_result ['success'] ) && ! empty ( $plan_emp_contribution_result ['emp_contribution_id'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$post_emp_contribution_id = $plan_emp_contribution_result ['emp_contribution_id'];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * *Get plan class coverage type*\n\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\t$model_plan_emp_contributions = TblAcaEmpContributions::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'emp_contribution_id' => $post_emp_contribution_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// validate general plan info\n\t\t\t\t\t\t\t\t$validate_results = $common_validation_component->ValidateindividualPlanclass ( $company_id, $plan_class_id, $element_ids );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (! empty ( $validate_results ['error'] )) {\n\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $validate_results ['error'] );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$validation_success = $validate_results ['success'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (! in_array ( 0, $validation_success, TRUE )) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tTblAcaPlanClassValidationLog::deleteAll ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t'and',\n\t\t\t\t\t\t\t\t\t\t\t\t'company_id = :company_id',\n\t\t\t\t\t\t\t\t\t\t\t\t'plan_class_id = :plan_class_id',\n\t\t\t\t\t\t\t\t\t\t\t\t[ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'in',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'validation_rule_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$validation_rule_ids \n\t\t\t\t\t\t\t\t\t\t\t\t] \n\t\t\t\t\t\t\t\t\t\t], [ \n\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t':plan_class_id' => $plan_class_id \n\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\n \n\t\t\t\t\t\t\t\t\t\tif($plantype != $old_plan_type )\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log =TblAcaCompanyValidationStatus::find()->where(['company_id'=>$company_id])->one();\t\t\n\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->is_medical_data = 0;\n\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->is_initialized = 0;\n\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->is_executed = 0;\t\t\n\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->save();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalValidationLog::deleteAll ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalEnrollmentPeriodValidationLog::deleteAll ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif($plantype == 1)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tTblAcaValidationLog::deleteAll ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'and',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'company_id = :company_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'in',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'validation_rule_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t142 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t] \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t], [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m = \tnew TblAcaValidationLog();\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m->company_id = $company_id;\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m->validation_rule_id = 142;\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m->modified_date = date ( 'Y-m-d H:i:s' );\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m->is_validated = 1;\n\t\t\t\t\t\t\t\t\t\t\t$model_validation_log_m->save();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Plan Class saved successfully' );\n\t\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tforeach ( $validation_success as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\tif ($value == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_message'] = $post_validation_errors [$key] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_code'] = $post_validation_errors [$key] ['error_code'];\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_message'] = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_code'] = '';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$transaction->rollBack ();\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} catch ( \\Exception $e ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\t\t\t\t$result ['error'] = $msg;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$transaction->rollBack ();\n\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t'/client/validateforms/planclassesvalidation?c_id=' . $encrypt_company_id.'&plan_class_id='.$encrypt_plan_class_id \n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn $this->render ( 'planclassesvalidation', array (\n\t\t\t\t\t\t\t\t'company_detals' => $company_details,\n\t\t\t\t\t\t\t\t'plan_class_details' => $plan_class_details,\n\t\t\t\t\t\t\t\t'model_plan_coverage_type' => $model_plan_coverage_type,\n\t\t\t\t\t\t\t\t'model_plan_offer_type_years' => $model_plan_offer_type_years,\n\t\t\t\t\t\t\t\t'model_plan_coverage_type_offered' => $model_plan_coverage_type_offered,\n\t\t\t\t\t\t\t\t'model_plan_emp_contributions' => $model_plan_emp_contributions,\n\t\t\t\t\t\t\t\t'model_plan_emp_contributions_premium' => $model_plan_emp_contributions_premium,\n\t\t\t\t\t\t\t\t'arrsection_elements' => $arrsection_elements,\n\t\t\t\t\t\t\t\t'arr_offer_types' => $arr_offer_types,\n\t\t\t\t\t\t\t\t'arrvalidations' => $arrvalidations,\n\t\t\t\t\t\t\t\t'arrvalidation_errors' => $arrvalidation_errors,\n\t\t\t\t\t\t\t\t'encoded_company_id' => $_GET ['c_id'],\n\t\t\t\t\t\t\t\t'encrypt_plan_class_id' => $encrypt_plan_class_id,\n\t\t\t\t\t\t\t\t'company_validation' => $company_validation \n\t\t\t\t\t\t) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Plan Class already validated' );\n\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t'/client/validateforms?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t'/client/companies' \n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form = '<form action=\"\" method=\"post\">';\n\n\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL) {\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . intval($this->id) . ';\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content .= $this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content .= $this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content .= $this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}", "function Tareas_admin_new()\n{\n\tif (!SecurityUtil::checkPermission('Tareas::', '::', ACCESS_ADMIN)) {\n\t\treturn LogUtil::registerPermissionError();\n\t}\n \t//Lenguaje\n\t$dom = ZLanguage::getModuleDomain('Tareas');\n\t\n\t// Obtener todas las variables del modulo\n\t$modvars = pnModGetVar('Tareas');\n\t\n\t$prioridades = explode(\"/\", $modvars['prioridad']);\n\t$estados \t = explode(\"/\", $modvars['estado']);\n\t\n\t// Construimos y devolvemos la Vista\n\t$render = & pnRender::getInstance('Tareas');\n\t//Pasamos variables a plantilla\n\t$render->assign('prioridades', $prioridades);\n\t$render->assign('estados', $estados);\n\n\treturn $render->fetch('Tareas_admin_new.htm');\n \n}", "function init_tab_contracthtml() {\n\tif(has_permission('teampassword','','view') || is_admin() || is_client_logged_in()){\n\t\techo '<li role=\"presentation\" class=\"\">\n\t <a href=\"#items_relate\" aria-controls=\"items_relate\" role=\"tab\" data-toggle=\"tab\">\n\t <i class=\"fa fa-key\" aria-hidden=\"true\"></i> ' . _l('items_relate') . '\n\t </a>\n\t </li>';\n }\n}", "function showTemplateForm($idt = \"\") {\n\t\t$tmpl = new PluginTemplate();\n\t\tif ($idt != \"\")\t$tmpl->readFromDb($idt);\n\t\t$tmpl->showForm();\n\t}", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function elaqe(){\n $this->protect();\n\t$cavab=$this->dtbs->cedvel('elaqe');\n\t$data['melumat']=$cavab;\n\t$this->load->view('back/elaqe/anasehife',$data);\n}", "public function val_reg_teach(){\n\t\t$this->form_validation->set_rules('teacher_id', 'Teacher ID', 'trim|numeric|max_length[25]|callback_chk_teach_id|is_unique[teacher_account_tbl.teacher_id]');\n\t\t$this->form_validation->set_rules('username', 'Username', 'trim|alpha_numeric|max_length[100]');\n\t\t$this->form_validation->set_rules('pass', 'Password', 'trim');\n\t\t$this->form_validation->set_rules('c_pass', 'Confirm Password', 'trim|matches[pass]');\n\n\t\t$this->form_validation->set_message('chk_teach_id', 'Invalid ID');\n\t\t$con = $this->form_validation->run();\n\t\tif ($con) {\n\t\t\t\n\t\t\t// model inserting the teacher_account to the database\n\t\t\t$Q = $this->teach_Acc->create_Acc();\n\n\t\t\tif ($Q) {\n\t\t\t\techo json_encode(array('status' => true));\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\techo json_encode(array('status' => false));\n\t\t\t#echo validation_errors();\n\t\t}\n\t}", "public function profile_admin()\n {\n parent::__construct();\n\t\t$this->setAttribute('method', 'post');\n\t\t$this->setAttribute('class', 'profile_form');\n \n\t\t$this->add(array(\n 'name' => 'user_name',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Full Name\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Full Name\", \n\t\t\t ),\n ));\n\t\t\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_email',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Email\",\n ),\n\t\t\t\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required email checkemail_exclude', \n\t\t\t\t\"placeholder\" => \"Email Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_address',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Address\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_phone',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Phone Number\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Phone Number\", \n\t\t\t\t'id'=>'user_phone', \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_city',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"City\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"City\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_state',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"State\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"State\", \n\t\t\t ),\n ));\n\t\t$this->add(array(\n 'name' => 'user_country',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Country\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Country\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n\t\t\t'name' => 'user_image',\n\t\t\t'type' => 'file',\t\t\t\n\t\t\t'options' =>array(\n\t\t\t\t'label' => \"Profile Image\",\n\t\t\t),\n\t\t\t\"accept\"=>\"image/*\",\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'default', \n\t\t\t\t\"id\" => \"user_image\", \n\t\t\t\t\"accept\"=>\"image/*\"\t\t\t\t\n\t\t\t ),\n\t\t));\t\n }", "function check_for_tutor() {\n\tif ( $_SESSION[\"user_level\"] != ADMIN && $_SESSION[\"user_level\"] != TUTOR) {\n\t\theader ('Location: index.php');\n\t}\n}", "function driverinfo() {\n global $user;\n $current_driver = new CAnmalan;\n $selected_driver = $current_driver->id();\n//#####################################################################\n// $content = \"<div id='form-driver'>\\n\";\n// $content .= \"<form id='select-driver' action='' method='post'>\\n\";\n// $content .= \"<fieldset>\\n\";\n// $content .= \"<legend>\\nFörare\\n</legend>\\n\";\n// $content .= \"<p>\\n\";\n// if ($selected_driver < 0) {\n// $content .= \"<input type='hidden' name='use_driver' value= -2>\\n\";\n// } else {\n//// Här börjar rutinen för inloggad förare \n// $content .= \"<div class='driver-form-row'>\\n\";\n// $content .= \"<select id='use-driver' name='use_driver'>\";\n//// Om inloggad är admin val för ny förare\n// if ($user->role() == 1 AND $selected_driver != -1) {\n// $content .= \"<option value='-1'>Ny förare</option>\\n\";\n// }\n//// Förarna läggs in i select-kontrollen. Inloggad markeras som vald\n// foreach ($user->users() as $user_data_id => $driver_data) {\n// $mark_selected = ($user_data_id == $selected_driver) ? 'SELECTED' : '';\n// $content .= \"<option value='{$user_data_id}' {$mark_selected}>{$driver_data['name']}</option>\\n\";\n// }\n// $content .= \"</select>\\n\";\n// $content .= \"</div>\\n\";\n//// $content .= \"<div class='driver-form-label'>\\n<input id='visa' type='submit' value='Visa'>\\n\";\n//// $content .= \"</div>\\n\";\n// $content .= \"</fieldset>\\n\";\n// $content.=\"</form>\";\n// \n// }\n $content = \"<div id='form-driverinfo'>\\n\";\n $content .= \"<form action='' method='post'>\\n\";\n $content .= \"<fieldset>\\n\";\n $content .= \"<legend>Anmälan</legend>\\n\";\n $content .= \"<input type='hidden' name='use_driver' value={$current_driver->id()}>\\n\";\n $content .= \"<div class='driver-form-row'>\\n\";\n if ($selected_driver > 0) {\n\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>\\nDu är anmäld till Svinnock tangomaraton med följande val \\n</label>\\n</div>\\n\";\n $content .= \"</div>\\n\";\n }\n $content .= \"<div class='driver-form-label'>\\n<label>\\nFörnamn \\n</label>\\n</div>\\n\";\n $content .= \"<div class='driver-form-input'>\\n<input id='name' type='text' name='name' value='{$current_driver->name()}' autocomplete='off'>\\n\";\n $content .= \"</div>\\n\";\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>\\nEfternamn \\n</label>\\n</div>\\n\";\n $content .= \"<div class='driver-form-input'>\\n<input id='display_name' type='text' name='display_name' value='{$current_driver->display_name()}'>\\n\\n\";\n $content .= \"</div>\\n\";\n\n if ($selected_driver < 0) {\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>\\nEmail \\n</label>\\n</div>\\n\";\n $content .= \"<div class='driver-form-input'>\\n<input id='acronym' type='text' name='acronym' value='{$current_driver->acronym()}' autocomplete='off'>\\n</div>\\n\\n\";\n $content .= \"</div>\\n\";\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>Password </label>\\n</div>\";\n $content .= \"<div class='driver-form-input'>\\n<input id='password' type='text' name='password' value='' autocomplete='off'>\\n</div>\\n\\n\";\n $content .= \"</div>\\n\";\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>\\nRepetera \\n</label>\\n</div>\\n\";\n $content .= \"<div class='driver-form-input'>\\n<input id='password_check' type='text' name='password_check' value='' autocomplete='off'>\\n</div>\\n\\n\";\n $content .= \"</div>\\n\";\n }\n $counter = -1;\n//här kommer fälten från user-posten\n foreach ($current_driver->driver_data($selected_driver) as $driver_data) {\n $counter = ($driver_data->type <2)?$counter +1 : $counter;\n if ($driver_data->type >= 0) {\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<div class='driver-form-label'>\\n<label>\\n{$driver_data->user_data_descr} \\n</label>\\n</div>\";\n $content .= \"<div class='driver-form-label'>\\n\";\n if ($driver_data->type == 0) {\n $content .= \"<input type='text' name='value[{$counter}]' value='{$driver_data->value}' autocomplete='off'>\\n\";\n } elseif ($driver_data->type == 1) {\n $checked = isset($driver_data->value) ? 'checked' : '';\n $content .= \"<input type='checkbox' name='value[{$counter}]' $checked >\\n\";\n }elseif ($driver_data->type ==2) { \n $content .= \"<input type='radio' name='value[{$counter}]' $checked >\\n\";\n }\n $content .= \"<input type='hidden' name='key[{$counter}]' value='{$driver_data->user_data_key}'>\\n\";\n $content .= \"<input type='hidden' name='user_data_id[{$counter}]' value='{$driver_data->user_data_id}'>\\n\";\n $content .= \"<input type='hidden' name='post_id[{$counter}]' value='{$driver_data->id}'>\\n\";\n $content .= \"</div>\\n\";\n }\n }\n\n $content .= \"<div class='driver-form-row'>\\n\";\n $content .= \"<button id='save' type='submit' name='save' value='{$selected_driver}'>Spara</button>\\n\";\n $content .= \"</div>\\n\";\n $content .= \"\";\n $content .= \"</fieldset>\";\n $content .= \"</form>\";\n $content .= \"</div>\";\n\n return $content;\n}", "public function activation($cnestudent)\r\n {\r\n $req=$this->student->changeetat($cnestudent); // change the etat\r\n $this->students(); // show the update list of student\r\n }", "private function klantGebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $this->model->maakKlantGebruiker();\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> klant gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Klang gebruiker aanmaken', 1);\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n $klanten = $this->model->geefKlanten();\n $this->view->set('klanten', $klanten);\n }", "function recommends_req_wizard_student_info($form, &$form_state) {\n $form = array();\n $form['streq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n '#prefix' => '<div id=\"formlimit\">',\n '#suffix' => '</div>'\n );\n \n \n $form['streq']['prefix'] = array(\n '#type' => 'select',\n '#title' => t('Name prefix'),\n '#size' => 1,\n '#required' => TRUE,\n '#options' => array(\n \t'Mr.' => t('Mr.'),\n \t'Ms.' => t('Ms.'),\n \t'Mrs.' => t('Mrs.'), \n ),\n );\n \n $form['streq']['first_name'] = array(\n '#type' => 'textfield',\n '#title' => t('First name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['first_name']) ? $form_state['values']['first_name'] : '',\n );\n $form['streq']['initial'] = array(\n '#type' => 'textfield',\n '#title' => t('Initial'),\n '#size' => 3,\n '#maxlength' => 20,\n '#default_value' => !empty($form_state['values']['initial']) ? $form_state['values']['initial'] : '',\n );\n $form['streq']['last_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Last name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['last_name']) ? $form_state['values']['last_name'] : '',\n );\n \n $form['streq']['suffix'] = array(\n '#type' => 'textfield',\n '#title' => t('Name suffix'),\n '#size' => 5,\n '#maxlength' => 50,\n '#default_value' => !empty($form_state['values']['suffix']) ? $form_state['values']['suffix'] : '',\n );\n $form['streq']['email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['email']) ? $form_state['values']['email'] : '',\n\n );\n $form['streq']['reqby'] = array(\n '#type' => 'hidden',\n '#title' => t('Date recommendations required by'),\n '#size' => 10,\n '#maxlength' => 15,\n '#description' => t('Date in the form of yyyy/mm/dd.'),\n \n );\n $form['streq']['comments'] = array(\n '#type' => 'textarea',\n '#title' => t('Statement of intent, Point of view'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n '#default_value' => !empty($form_state['values']['comments']) ? $form_state['values']['comments'] : '',\n\n );\n return $form;\n}", "public function londontec_students(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_students';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Students',\n\t\t\t'courselist'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function activateTU(){\r\n\t\tif($this->session->userdata('logged_in')){\r\n\t\t\tif($this->session->userdata('id_role') == 1){\r\n\t\t\t\t$this->load->library('form_validation');\r\n\t\t\t\t$this->form_validation->set_rules('id_tu', 'ID Admin', 'required');\r\n\t\t\t\tif($this->form_validation->run() == FALSE){\r\n\t\t\t\t\t$this->session->set_flashdata('error', 'Missing required Field!');\r\n\t\t redirect('/tata_usaha');\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$id_tu = $this->input->post('id_tu');\r\n\t\t\t\t\t$this->load->model('Users');\r\n\t\t\t\t\t$res_update = $this->Users->changeStatus($id_tu, 1);\r\n\t\t\t\t\tif($res_update){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'Berhasil mengakifkan kembali petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$this->session->set_flashdata('error', 'Gagal mengakifkan kembali petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tredirect('/');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function addteacher()\n {\n return view('admin.addteacher');\n }", "function run()\r\n {\r\n $trail = BreadcrumbTrail :: get_instance();\r\n $trail->add_help('course_type general');\r\n\r\n $type = Request :: get(WeblcmsManager :: PARAM_TYPE);\r\n $course_type_ids = Request :: get(WeblcmsManager :: PARAM_COURSE_TYPE);\r\n\r\n if (! $this->get_user() || ! $this->get_user()->is_platform_admin())\r\n {\r\n $this->display_header();\r\n Display :: error_message(Translation :: get('NotAllowed', null ,Utilities:: COMMON_LIBRARIES));\r\n $this->display_footer();\r\n exit();\r\n }\r\n\r\n //else\r\n if (($type == 'course_type' && $course_type_ids) || ($type == 'all'))\r\n {\r\n $this->change_course_type_activity($course_type_ids);\r\n }\r\n\r\n else\r\n {\r\n $this->display_header();\r\n $this->display_error_message(Translation :: get('NoObjectsSelected', null ,Utilities:: COMMON_LIBRARIES));\r\n $this->display_footer();\r\n }\r\n\r\n }", "private function gebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $id = $this->model->maakGebruiker();\n if (isset($_FILES['foto']))\n {\n $this->model->updateFoto($id);\n }\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Gebruiker toevoegen', 'Gelukt');\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n }", "public function adicionarprofessor() {\n\t\tself::header();\n\t\t$this->load->view('administracao/adicionarprofessor');\n\t\tself::footer();\n\t}", "public function showTeacherLoginForm()\n {\n return view('auth.login');\n }", "public function beforeRender()\n {\n parent::beforeRender();\n\n if (isset($this->section->data)) {\n $u = $this->em->getRepository(User::class)->findOneBy(['mff' => $this->section->data->uid]);\n if ($u) {\n $this->flashMessage('Jiný uživatel již má účet propojený s UK těmito LDAP údaji.', 'error');\n } else {\n $current_crank = $this->info->getCrank();\n\n $this->info->setMff($this->section->data->uid);\n $this->info->setCrank($current_crank + 5);\n $this->em->flush();\n\n $this->flashMessage('Nyní jsi ověřený matfyzák!', 'success');\n }\n\n unset($this->section->data);\n $this->redirect('this');\n }\n\n $this->template->setup = $this->setup;\n\n $this['accForm']['username']->setDefaultValue($this->info->getUsername());\n $this['accForm']['name']->setDefaultValue($this->info->getName());\n $this['accForm']['email']->setDefaultValue($this->info->getEmail());\n\n $this['avatarForm']['avatar']->setDefaultValue($this->info->getAvatar());\n }" ]
[ "0.61245656", "0.61019784", "0.6096379", "0.604956", "0.59938014", "0.5983298", "0.586553", "0.57333034", "0.57308257", "0.57274574", "0.57020843", "0.5671908", "0.5658355", "0.5646518", "0.56351596", "0.5628341", "0.56267303", "0.56240946", "0.5622967", "0.56087977", "0.560484", "0.5602906", "0.5600774", "0.5592237", "0.5582187", "0.5581697", "0.5569123", "0.5564511", "0.5559729", "0.5554639", "0.5547389", "0.55337864", "0.5532282", "0.5524144", "0.55230093", "0.55194587", "0.5518844", "0.55146486", "0.550146", "0.5497397", "0.5486965", "0.5464786", "0.54623723", "0.54594034", "0.5455607", "0.5446776", "0.543484", "0.54281193", "0.542737", "0.54257673", "0.54116744", "0.54062885", "0.5402468", "0.53915685", "0.53876406", "0.5383265", "0.5380935", "0.53805137", "0.5374336", "0.53728634", "0.5369608", "0.5367147", "0.5359572", "0.53508615", "0.5350658", "0.5343097", "0.53419936", "0.5338394", "0.5338359", "0.5338298", "0.5337408", "0.5334296", "0.5332523", "0.53292805", "0.5327204", "0.53247637", "0.5321153", "0.5316416", "0.5315489", "0.5314805", "0.5310597", "0.53096926", "0.530357", "0.53032666", "0.5300172", "0.52997166", "0.5298286", "0.52943885", "0.5292933", "0.5290746", "0.5288806", "0.5288629", "0.5287196", "0.528706", "0.5283552", "0.5282869", "0.52819526", "0.52818906", "0.52787536", "0.5278424" ]
0.5552707
30
Get the connection using name
public function getUse() { if (isset($this->use)) { return $this->use; } else return $this->getDefaultUse(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private function connection($name) { return self::$connections[$name]['connection']; }", "public static function connection($name=null){\n\t\treturn self::instance()->conn($name);\n\t}", "function findConnection(string $name);", "public function connection($name = 'default')\n {\n return Arr::get($this->clients, $name ?: 'default');\n }", "public function connection($name = null)\n {\n $name = $name ?: 'default';\n $pid_name =getmypid().\"_\".$name;\n\n if (isset($this->connections[$pid_name])) {\n return $this->connections[$pid_name];\n }\n\n return $this->connections[$pid_name] = $this->resolve($name);\n }", "public function connection($name = null)\n {\n $name = $name ?: $this->getDefaultConnection();\n\n return $this->connections[$name] = $this->get($name);\n }", "public function connection($name = null)\n {\n $name = $name ?: $this->getDefaultConnection();\n\n if (!isset($this->connections[$name])) {\n $this->connections[$name] = $this->makeConnection($name);\n }\n\n return $this->connections[$name];\n }", "public static function get($name){\n\t\tif($name instanceof dbDriver) return $name;\n $name = trim(strtolower($name));\n\n return isset(self::$connections[$name])\n ? self::$connections[$name]\n : NULL;\n }", "protected function getConnection( $name )\n\t{\n\t\tif( !isset( $this->connections[$name] ) ) {\n\t\t\treturn $this->connections[$name] = $this->dbm->acquire( $name );\n\t\t}\n\n\t\treturn $this->connections[$name]->connect();\n\t}", "public static function getDbConnection($name = \"\")\r\n\t{\r\n\t\t$pool = Application::getInstance()->getDbConnectionPool();\r\n\t\treturn $pool->getConnection($name);\r\n\t}", "public static function conn($name='default')\n {\n if (!isset(self::$connections[$name])) {\n if ($name != 'default') throw new \\Exception(\"MySQL connection '$name' doesn't exist.\");\n self::$connections[$name] = new static();\n }\n \n return self::$connections[$name];\n }", "public function connection($name = null);", "public function connection($name = null)\n {\n $name = $name ?: $this->getDefaultDriver();\n\n // If the connection has not been resolved yet we will resolve it now as all\n // of the connections are resolved when they are actually needed so we do\n // not make any unnecessary connection to the various queue end-points.\n if (! isset($this->connections[$name])) {\n $this->connections[$name] = $this->resolve($name);\n\n $this->connections[$name]->setContainer($this->app);\n\n $this->connections[$name]->setEncrypter($this->app['encrypter']);\n }\n\n return $this->connections[$name];\n }", "public function connection($name = null): ConnectionInterface;", "public static function connection($name = 'default')\n {\n $databaseConfig = self::getConnectionConfiguration($name);\n\n /** @var Driver $driver */\n $driver = self::driver($name);\n\n $username = isset($databaseConfig['username']) ? $databaseConfig['username'] : null;\n $password = isset($databaseConfig['password']) ? $databaseConfig['password'] : null;\n $options = isset($databaseConfig['options']) ? $databaseConfig['options'] : array();\n\n // Create connection if we don't have it already\n if (! isset(self::$connections[$name])) {\n $connection = $driver->connect($databaseConfig, $username, $password, $options);\n\n self::$connections[$name] = $connection;\n }\n\n return self::$connections[$name];\n }", "public static function connection($connectionName = 'default')\n {\n return self::getGlobal()->getConnection($connectionName);\n }", "public function connection($name = null)\n {\n list($name, $type) = $this->parseConnectionName($name);\n if(! $this->isExistConfig($name))\n {\n $name = $this->getDefaultConnection();\n }\n \n if(! isset($this->connections[$name]))\n {\n $connection = $this->makeConnection($name);\n $this->connections[$name] = $connection;\n }\n \n // 当指定了type, 同时使用master slave模式的情况下, 设置master或者slave\n if ( ! is_null($type) && $this->connections[$name] instanceof Doctrine\\DBAL\\Connections\\MasterSlaveConnection)\n {\n $this->connections[$name]->connect($type);\n }\n \n return $this->connections[$name];\n }", "public function connection($name = null)\n {\n if (is_null($name))\n $name = $this->getDefaultConnection();\n\n if (!isset($this->connectionPoolCache[$name])) {\n $poolConfig = $this->poolConfigs[$name] ?? ($this->poolConfigs['default'] ?? null);\n $dbConfig = $this->connectionConfig($name);\n\n $dbPool = new DbPool();\n $dbPool->init((new DbPoolConfig($poolConfig, $dbConfig))->setNodeName($name));\n\n $this->connectionPoolCache[$name] = $dbPool;\n }\n\n return $this->getConnection($name);\n }", "public function connection($name = null)\n {\n $name = $name ?: $this->getDefaultDriver();\n\n // If the connection has not been resolved yet we will resolve it now as all\n // of the connections are resolved when they are actually needed so we do\n // not make any unnecessary connection to the various queue end-points.\n if (! isset($this->connections[$name])) {\n $this->connections[$name] = $this->resolve($name);\n\n $this->connections[$name]->setContainer($this->app);\n }\n\n return $this->connections[$name];\n }", "public function getConnection($connName = null);", "private static function _getMongoConnection($name)\n {\n $config = Eb_Application_Config::getConfig()->resources->db;\n\n if (isset($config->$name))\n {\n // Only one instance available, so choose this one\n $config = $config->$name;\n }\n\n // Create the connection\n $connection = new Mongo($config->connection_string, array('replicaSet' => true));\n\n return $connection;\n }", "public static function getConnection($name)\n {\n if (isset(self::$connections[$name]))\n return self::$connections[$name];\n\n $config = include APPPATH.'config/database.php';\n\n if ( ! isset($config['connections'][$name]))\n {\n throw new Candy_Exception('Database connection '.$name.' not defined in configuration');\n }\n\n $config = $config['connections'][$name];\n\n try \n {\n self::$connections[$name] = new PDO(\"{$config['driver']}:host={$config['hostname']};dbname={$config['database']}\", $config['username'], $config['password']);\n } \n catch (PDOException $ex) \n {\n throw new Candy_Exception($ex->getMessage(), $ex->getCode()); \n }\n\n return self::$connections[$name];\n }", "public static function get($name = null)\n {\n if ( ! self::$connectionMade) {\n throw new RuntimeException('No Database connections exist. Please connect using Capsule\\Database\\Connection::make and try again.');\n }\n return static::getResolver()->connection($name);\n }", "public function getConnectionName();", "public function getConnectionName();", "public function getConnectionName();", "static public function connection($name = null)\n {\n if ($name === null) {\n $name = self::$activeConnectionName;\n \n if (!$name) {\n if (self::$defaultConnectionName) {\n $name = self::$defaultConnectionName;\n self::setConnection($name);\n self::$defaultConnectionName = null;\n } else {\n throw new Exception\\RuntimeException(\"No database connection is active\");\n }\n }\n } else {\n self::create_connection($name);\n }\n \n return self::$_connections[$name];\n }", "function getConnection(string $name=null);", "public function getConnection(?string $name = null);", "public function getConnection($name = null)\n {\n // TODO: Implement getConnection() method.\n }", "public function getConnection(?string $name = null): Connection\n {\n return $this->manager->connection($name);\n }", "private static function _getConnection($name)\n {\n $config = Eb_Application_Config::getConfig()->resources->db;\n\n if (!isset($config->$name))\n {\n /*\n TODO replace this with an exception instead of a false\n */\n return false;\n }\n\n $connection = Zend_Db::factory($config->$name->adapter, array(\n 'host' => $config->$name->server,\n 'username' => $config->$name->username,\n 'password' => $config->$name->password,\n 'dbname' => $config->$name->dbname\n ));\n\n return $connection;\n }", "function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function connection(?string $name = null): ConnectionInterface\n {\n if (is_null($name)) {\n $name = $this->getDefaultConnection();\n }\n\n return $this->connections[$name];\n }", "public static function connection($name)\n {\n return static::$app['db']->connection($name)->getSchemaBuilder();\n }", "public function getConnectionName()\n {\n return array_search($this, self::$connections, true) ?: null;\n }", "public function getConnection()\n {\n return config('ring_central.connection.name');\n }", "public static function connection($name=null)\n {\n if (static::isProxied()) {\n return new Builder(static::$app['db']->connection($name));\n } else {\n return parent::getFacadeAccessor();\n }\n }", "public function getConnection($name = null)\n {\n return $this->entityManager->getConnection();\n }", "function getConnection() {\n\t\tself::createConnection( $this->_connectionName );\n\t\treturn Kwerry::$_connections[ $this->_connectionName ];\n\t}", "public static function connection($name = null)\n {\n }", "public function getConnection(string $name = 'default') : PDO\n {\n // fail if the connection name cannot be found\n if ( ! isset($this->connections[$name]) and ! isset($this->cache[$name])) {\n throw new DBConnectionNotFound(\"Connection name `$name` not found.\");\n }\n\n // return the active connection if it is in the cache\n if (isset($this->cache[$name])) {\n return $this->cache[$name];\n }\n\n // get the connection settings\n $connection = $this->connections[$name];\n // retrieve and cache the connection if successful\n $this->cache[$name] = $this->makeDriverConnection($connection['driver'], $connection);\n\n if ( ! array_key_exists('dsn', $this->connections[$name])) {\n $this->connections[$name]['dsn'] = $connection['dsn'];\n $this->config['connections'][$name]['dsn'] = $connection['dsn'];\n }\n\n return $this->cache[$name];\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function getConnection($name = ''): QueryBuilderInterface\n\t{\n\t\t// If the parameter is a string, use it as an array index\n\t\tif (is_scalar($name) && isset($this->connections[$name]))\n\t\t{\n\t\t\treturn $this->connections[$name];\n\t\t}\n\t\telse if (empty($name) && ! empty($this->connections)) // Otherwise, return the last one\n\t\t{\n\t\t\treturn end($this->connections);\n\t\t}\n\n\t\t// You should actually connect before trying to get a connection...\n\t\tthrow new InvalidArgumentException('The specified connection does not exist');\n\t}", "public function get(string $name = null)\n {\n $name = $name ?? $this->default;\n\n if ($this->exists($name)) {\n return $this->connections[$name];\n }\n\n throw new ContainerException(\"The connection connection '$name' does not exist.\");\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public static function connection($connectionName = null)\n {\n $connectionName = coalesce($connectionName, 'mysql');\n $connection = try_get(self::$connections, $connectionName);\n\n if($connection)\n {\n $key = self::generateKey(\n try_get($connection, 'url'),\n try_get($connection, 'username'),\n try_get($connection, 'password')\n );\n\n if(isset(self::$activeConnections[$key]))\n {\n return self::$activeConnections[$key];\n }\n\n $connection = new QueryHelper(\n try_get($connection, 'url'),\n try_get($connection, 'username'),\n try_get($connection, 'password')\n );\n }\n else\n {\n die(\"Connection '$connectionName' is not defined!\");\n }\n\n return $connection;\n }", "protected function makeConnection($name)\n {\n $config = $this->getConfig($name);\n $connectionParams = $config;\n if (isset($config['slave']) || isset($config['master']))\n {\n $connectionParams['wrapperClass'] = 'Doctrine\\DBAL\\Connections\\MasterSlaveConnection';\n }\n \n $conn = DriverManager::getConnection($connectionParams, $this->configuration);\n \n return $conn;\n }", "public function getDBConnection(string $conName) {\n foreach ($this->getDBConnections() as $connNameStored => $connObj) {\n if ($connNameStored == $conName || $connObj->getName() == $conName) {\n return $connObj;\n }\n }\n }", "public function getConnection(?string $name = null): Connection\n {\n if ($this->hasConnection($name = $name ?? $this->default)) {\n return $this->connections[$name];\n }\n\n throw new ContainerException(\"The LDAP connection [$name] does not exist.\");\n }", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "public function connection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function getConnection($db_name = null) {\n\t\tif (is_null($db_name)) {\n\t\t\t$db_name = $this->getDbName();\n\t\t}\n\n\t\treturn Controller::getInstance()->getContext()->getDatabaseConnection($db_name);\n\t}", "public function getConnectionName()\n {\n return $this->connectionName;\n }", "public function getSMTPConnection(string $name) {\n if (isset($this->getSMTPConnections()[$name])) {\n return $this->getSMTPConnections()[$name];\n }\n }", "public function getConnectionName()\n {\n return config('google-ads-api.database.connection') ?? $this->connection;\n }", "public function getConnection()\n\t{\n\t\treturn static::$instances[$this->_instance];\n\t}", "public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}", "private static function getConnectionConfiguration($name)\n {\n $databaseConfig = Configuration::get('database.connections');\n if (isset($databaseConfig[$name])) {\n $databaseConfig = $databaseConfig[$name];\n } else {\n $databaseConfig = null;\n }\n\n if ($databaseConfig === null) {\n throw new ConfigurationException(\"Database configuration for connection '\" . $name . \"' doesn't exists!\");\n }\n\n if (! isset($databaseConfig['driver'])) {\n throw new ConfigurationException(\"Database configuration for connection '\" . $name . \"' is invalid!\");\n }\n\n return $databaseConfig;\n }", "public function getConnection($name = null)\n {\n if (null === $name) {\n $name = $this->defaultConnection;\n }\n\n if (!isset($this->connections[$name])) {\n throw new \\InvalidArgumentException(sprintf('Doctrine Connection named \"%s\" does not exist.', $name));\n }\n\n return $this->container->get($this->connections[$name]);\n }", "function connectionName ()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn $this->conn_name;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getConnectionName()\n {\n return config('yotpo.database.connection') ?? $this->connection;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n return $this;\n }", "public function get_connection()\n {\n return $this->connection();\n }", "private function connection()\n {\n return Database::connection($this->connectionName);\n }", "public function getConnectionName()\n\t{\n\t\treturn empty($this->db_conn) ? $this->db_conn_name : $this->getConnection()->getName();\n\t}", "public static function getConnection() {\n return self::$defaultConnection;\n }", "public function useConnectionName($name)\n {\n $this->settings->set(Doctrine1KnownSettingsEnum::CONNECTION_NAME, $name);\n return $this;\n }", "public function setConnection($name);", "public function get($name)\n {\n if (Shopware::VERSION !== '___VERSION___') {\n if (version_compare(Shopware::VERSION, '4.3.3', '<') && $name === 'dbal_connection') {\n return $this->get('models')->getConnection();\n }\n\n if (version_compare(Shopware::VERSION, '4.2.0', '<')) {\n if ($name === 'loader') {\n return $this->Application()->Loader();\n }\n\n $name = ucfirst($name);\n\n return $this->Application()->Bootstrap()->getResource($name);\n }\n }\n\n return parent::get($name);\n }", "static public function getConnection()\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }", "public function getConnection()\n {\n return($this->connx);\n }", "public function get_connection()\n {\n }", "public function connectionConfig($name = null)\n {\n if (is_null($name))\n $name = $this->getDefaultConnection();\n\n if (! isset($this->connections[$name])) {\n throw new DbException(\"database connection {$name} config not exists...\");\n }\n return $this->value($this->connections[$name]);\n }", "public function setConnectionName($name)\n\t{\n\t\t$this->db_conn_name = $name;\n\t\t\n\t\treturn $this;\n\t}", "public function setConnectionName($name);", "protected function resolve($name)\n {\n $config = $this->getConfig($name);\n\n return $this->getConnector($config['driver'])->connect($config);\n }", "public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }", "function getDefaultConnection()\n{\n\tglobal $cman;\n\treturn $cman->getDefault();\n}", "public function getConnection()\n {\n return $this->resolver->connection();\n }", "public function __get($name): Database\n {\n return $this->mongoConnection->$name;\n }", "protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}", "public function GetConn() {\n\n return $this->\n config['dbconn'];\n }", "public function getConnectionName()\n {\n return config('telescope.storage.database.connection');\n }", "public function getConnection(){\n\t\tif(!isset($this->connection)){\n\t\t\t$this->connection = $this->connect($this->connectionParams);\n\t\t}\n\n\t\treturn $this->connection;\n\t}", "public function get_connection()\n {\n return $this->connection;\n }", "public function getConnection()\r\n\t{\r\n\t\treturn $this->connection;\r\n\t}", "public function getConnection(){\n\t\treturn $this->connection;\n\t}", "public function getDefaultConnectionName();", "public static function connect($config = array(), $name = 0)\n\t{\n\t\treturn self::$connection = self::$registry[$name] = new DibiConnection($config, $name);\n\t}", "public function getConn() {\n\t\tif ($this->conn) {\n\t\t\treturn $this->conn;\n\t\t}\n\t}", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function get_current_connection()\n {\n }", "public function getConnection($connectionName)\n {\n if (!array_key_exists($connectionName, $this->connections)) {\n throw new Exception\\DatabaseConnectionWasNotFound($connectionName);\n }\n\n return $this->connections[$connectionName];\n }" ]
[ "0.87603086", "0.8390307", "0.8249926", "0.82293946", "0.8165101", "0.8012678", "0.8002587", "0.78540653", "0.78529716", "0.7778252", "0.7685722", "0.7643416", "0.76245755", "0.7618163", "0.76161104", "0.75996184", "0.7587031", "0.75678104", "0.75615615", "0.75579906", "0.74950814", "0.74870884", "0.74816847", "0.7469903", "0.7469903", "0.7469903", "0.7462688", "0.74565244", "0.740257", "0.7395882", "0.73829633", "0.7329535", "0.73069674", "0.72779226", "0.7220446", "0.71572727", "0.7153262", "0.7136008", "0.71320397", "0.7130979", "0.7118332", "0.71116453", "0.70912266", "0.70912266", "0.7081077", "0.70707774", "0.70655483", "0.70655483", "0.7063324", "0.7060546", "0.70586324", "0.70561045", "0.7047604", "0.70445967", "0.70217794", "0.69402784", "0.692756", "0.6882963", "0.6875771", "0.6818601", "0.68170387", "0.6809423", "0.6808144", "0.6794283", "0.6787073", "0.6774234", "0.67550856", "0.67125815", "0.6700665", "0.66583043", "0.66456884", "0.6643699", "0.66433215", "0.66356635", "0.66356635", "0.66356635", "0.6613542", "0.66024286", "0.65977806", "0.6592804", "0.65894306", "0.6542784", "0.6540169", "0.65317506", "0.65259534", "0.6518775", "0.6513958", "0.65036976", "0.6501307", "0.64987713", "0.64790833", "0.64626247", "0.6441861", "0.64278674", "0.642774", "0.6416148", "0.6404757", "0.64013934", "0.64013934", "0.636953", "0.63682234" ]
0.0
-1
Get the default use tag
public function getDefaultUse() { if (isset($this->getRoot()->use)) { return $this->getRoot()->use; } else return '*'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultTag(): string|null;", "protected function get_tag() {\n\t\treturn self::TAG;\n\t}", "function getTag($name, $default = 0) {\n if(empty($this -> $name)) {\n return $default ;\n } else {\n return $this -> $name ;\n }\n }", "public function getTag(): ?string\n {\n return $this->tag;\n }", "public function getTag(): string\n {\n return $this->tag;\n }", "private function getTag()\n {\n return $this->tag;\n }", "public function getTag(): string|null;", "function _getDefaultTagname($parent)\n {\n if (is_string($this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG])) {\n return $this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG];\n }\n if (isset($this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG][$parent])) {\n return $this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG][$parent];\n } elseif (isset($this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG]\n ['#default'])\n ) {\n return $this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG]['#default'];\n } elseif (isset($this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG]\n ['__default'])\n ) {\n // keep this for BC\n return $this->options[XML_SERIALIZER_OPTION_DEFAULT_TAG]['__default'];\n }\n return 'XML_Serializer_Tag';\n }", "public function getTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\treturn $this->primarySearchData[$this->ref_tag];\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getTag()\n {\n return $this->_params['tag'];\n }", "public function get_tag()\n {\n }", "public function getTag()\n {\n return $this->get('tag');\n }", "private static function get_default_cache_tag()\n {\n return CacheableConfig::is_running_test() ? CACHEABLE_STORE_TAG_DEFAULT_TEST : CACHEABLE_STORE_TAG_DEFAULT;\n }", "public function tag()\r\n\t{\r\n\t\treturn $this->tag;\r\n\t}", "public function tag()\r\n\t{\r\n\t\treturn $this->tag;\r\n\t}", "public function getTag(): string;", "public function getUse() {\n if (isset($this->use)) {\n return $this->use;\n } else return $this->getDefaultUse();\n }", "public function tag()\n\t{\n\t\treturn $this->tag;\n\t}", "public function tag(): string\n {\n return $this->tag;\n }", "public static function tag_language_default(FTL_Binding $tag)\n\t{\n\t\treturn self::output_value($tag, $tag->getValue('def'));\n\t}", "function getSelectedAdTag() {\n\treturn constant($_GET['adTag']);\n}", "public function getTag()\n {\n return $this->tag;\n }", "public function getTag()\n {\n return $this->tag;\n }", "public function getTag()\n {\n return $this->tag;\n }", "public function getTag();", "public function getTag();", "public\n\tfunction getTagLabel(): string {\n\t\treturn $this->tagLabel;\n\t}", "public function get_default(){\n\t\treturn $this->default;\n\t}", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function tag() { return $this->_m_tag; }", "public function getTag() {\n return $this->_tag;\n }", "public function getTag()\n {\n }", "public function getTag()\n\t{\n\t\treturn $this->data['tag'];\n\t}", "public static function getDefault()\r\n {\r\n return self::get('default');\r\n }", "public function getBase() {\n\t\t\t\n\t\t\treturn $this->tag;\n\t\t\t\n\t\t}", "public function getTag()\n {\n return $this->getAdapter()->getTag();\n }", "public static function getDefault()\n {\n return self::$default;\n }", "private function retrieve_tag() {\n\t\t$replacement = null;\n\n\t\tif ( isset( $this->args->ID ) ) {\n\t\t\t$tags = $this->get_terms( $this->args->ID, 'post_tag' );\n\t\t\tif ( $tags !== '' ) {\n\t\t\t\t$replacement = $tags;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function tag(): string;", "public function getDefault(): string\n {\n return $this->default;\n }", "public function getDefault(): string\n {\n return $this->default;\n }", "public function getUse()\n {\n return $this->use;\n }", "public function getUse()\n {\n return $this->use;\n }", "public function getTag()\n {\n return $this->name;\n }", "public function __toString()\n {\n try {\n return $this->getTag('default');\n } catch (\\Exception $e) { // TODO be more specific, maybe!\n return '';\n };\n }", "public function CurrentTag() {\n\t\t$tagID = $this->request->getVar('tag');\n\n\t\tif (isset($tagID)) {\n\t\t\treturn TaxonomyTerm::get_by_id('TaxonomyTerm', (int)$tagID);\n\t\t}\n\t}", "public function getDefault()\n {\n return $this->default;\n }", "public function getDefault()\n {\n return $this->getOption('default');\n }", "public function t_default($sTag) {\n\t\treturn $this->t_case($sTag);\n\t}", "public function getDefault()\n\t\t{\n\t\t\treturn $this->default;\n\t\t}", "public static function getTag(&$params)\n\t{\n\t\t$user = JFactory::getUser();\n\t\t$tag = JRequest::getString(JUtility::getHash('language'), null ,'cookie');\n\t\tif(empty($tag) && $user->id) {\n\t\t\t$tag = $user->getParam('language');\n\t\t}\n\t\treturn $tag;\n\t}", "public function getGitTagPlaceholder()\n {\n if (isset($this->raw->{'git-tag'})) {\n return $this->raw->{'git-tag'};\n }\n\n return null;\n }", "public function getDefault()\n {\n return $this->get($this->default);\n }", "function getDefault()\n {\n return $this->_defValue;\n }", "public function getUserTag()\n {\n return $this->UserTag;\n }", "public function getCurrentVersionTag()\n {\n $version = $this->getVersionJsn();\n return $version['tag'];\n }", "public function getSource() {\n return 'tag';\n }", "abstract protected function getTag() : Tag;", "protected function registerTag(): string\n {\n return 'var';\n }", "public function getDefault();", "function getTag($tag)\n {\n //print \"getting tag\\n\";\n return $this->_tagDTD->toTagStr($tag);\n }", "public function getDefaultDefinition(): string;", "function tagName(){\n return 'TAG NAME HERE';\n}", "public function getFirstTagDataProvider() {}", "public function getDefault(): ?string;", "static public function noop($tag)\n {\n return $tag;\n }", "public function getDefaultVal(): string\n {\n return $this->defaultText;\n }", "function get_default_type()\n\t{\n\t\treturn 'normal';\n\t}", "public function getTag()\n {\n return 'try';\n }", "public function getProductDefault($needle)\n {\n $defaults = $this->getProductDefaults();\n\n if (array_key_exists($needle, $defaults)) {\n return $defaults[$needle];\n }\n\n return null;\n }", "public function defaultCode()\n {\n \tif (!$lang = $this->model->where('is_default', '=', 1)->first()) {\n \t\treturn false;\n \t}\n\n \treturn $lang->code;\n }", "function getDefaultWithOid() {\n\t\t// 8.0 is the first release to have this setting\n\t\t// Prior releases don't have this setting... oids always activated\n\t\treturn 'on';\n\t\t}", "private function getRobotsDefaultCustomInstructions()\n {\n return trim((string)$this->scopeConfig->getValue(\n self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS,\n ScopeConfigInterface::SCOPE_TYPE_DEFAULT\n ));\n }", "public function getCreatedUsing()\n {\n if (array_key_exists(\"createdUsing\", $this->_propDict)) {\n return $this->_propDict[\"createdUsing\"];\n } else {\n return null;\n }\n }", "function deco_get_tagline($tagline = null)\n{ \n if (!$tagline) {\n \n $tagline = get_theme_option('Tagline') ? \n get_theme_option('Tagline') : \n 'Add a tagline for your site in theme options';\n }\n \n return $tagline; \n \n}", "public function getDefault($var);", "function get_tag_name( $tag ) {\n $tag_name = get_tag_data( $tag , 'tag_name' );\n return $tag_name;\n}", "public function getDefault()\n\t{\n\t\treturn $this->byId( \"##@BUILDER.strDefaultConnID s##\" );\n\t}", "public function getTag()\n {\n return 'get';\n }", "public function getTagName()\n {\n return $this->_tag;\n }", "function getTag(): string\n\t{\n\t\treturn $this->username.\"#\".$this->discriminator;\n\t}", "public function getTag()\n {\n return 'restr';\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public function getDefault()\n {\n return $this->config['config']['default'] ?? null;\n }", "public static function get_default_element_setting_value($shortcodes=false, $group='', $tag='', $tab='', $name='') {\n if($shortcodes==false) $shortcodes = SUPER_Shortcodes::shortcodes();\n if(isset($shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'])){\n return $shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'];\n }else{\n return '';\n }\n }", "public function getDefaultValue()\n {\n\treturn $this->default;\n }", "protected static function getDefaultKey()\n {\n $aliases = self::getAliases();\n return reset($aliases);\n }", "public static function getBbTagType();", "public function Get_Tag() {\n // Populate the curly tags\n $tag = array(\n 'code' => $this->tag,\n 'category' => $this->category,\n 'hint' => $this->hint,\n 'name' => $this->name,\n 'method' => array($this,'_Render'),\n );\n // Return the tag\n return $tag;\n }", "public function getTagName() {}", "public function getName()\n {\n return 'tag';\n }", "public function getName()\n {\n return 'tag';\n }", "private function _getTagGroup()\n {\n $tagGroupId = $this->_getTagGroupId();\n\n if ($tagGroupId !== false) {\n return Craft::$app->getTags()->getTagGroupByUid($tagGroupId);\n }\n\n return null;\n }", "public function getOptionUseField()\r\n\t{\r\n\t\t$field = (string) Mage::getStoreConfig('ec/preferences/use_custom_option_field');\r\n\t\t\r\n\t\tif ('' === $field)\r\n\t\t{\r\n\t\t\t$field = self::DEFAULT_CUSTOM_OPTION_FIELD;\r\n\t\t}\r\n\t\t\r\n\t\treturn $field;\r\n\t}", "protected function get_default() {\n\t\treturn false;\n\t}", "public function getCanonical(): ?TagInterface;" ]
[ "0.75661653", "0.692143", "0.68892187", "0.6643984", "0.65091926", "0.64992255", "0.6458422", "0.6436237", "0.6385614", "0.6384073", "0.63671577", "0.6366389", "0.63467205", "0.63408554", "0.63408554", "0.6335441", "0.6330788", "0.6320616", "0.63121", "0.62464976", "0.6202257", "0.6175114", "0.6175114", "0.6175114", "0.61517566", "0.61517566", "0.61483186", "0.6126273", "0.6125993", "0.6125993", "0.6125993", "0.6125993", "0.6125993", "0.6109647", "0.6096572", "0.6095379", "0.60786295", "0.6075155", "0.60741895", "0.60464287", "0.6039989", "0.60326266", "0.60321206", "0.60321206", "0.6009736", "0.6009736", "0.59719163", "0.5935077", "0.5925766", "0.5912153", "0.5871059", "0.5846942", "0.5808325", "0.5785736", "0.5784008", "0.57613903", "0.5748373", "0.57270354", "0.5720051", "0.5708878", "0.5685702", "0.5680454", "0.56608343", "0.5651278", "0.5640874", "0.5633831", "0.5622575", "0.5608422", "0.5606289", "0.5598845", "0.5597006", "0.5589133", "0.5587932", "0.55817044", "0.5576866", "0.5573221", "0.55600005", "0.5559722", "0.55539846", "0.5545632", "0.5539027", "0.55377567", "0.55360544", "0.5534803", "0.5524332", "0.5521988", "0.5521988", "0.55091023", "0.5499643", "0.5497591", "0.54946595", "0.548997", "0.5486183", "0.54856807", "0.54594815", "0.54594815", "0.5456613", "0.54466355", "0.5441543", "0.54388165" ]
0.6638231
4
Get the table name
public function getTableName() { if (isset($this->table)) { return $this->table; } else return $this->name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "public static function get_table_name()\n {\n return self::TABLE_NAME;\n }", "public function get_table_name(){\n return $this->table_name();\n }", "public function get_table_name() {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->__get(\"table_name\");\n }", "public static function getTableName(){\n\t\treturn self::$table_name;\n\t}", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public static function getTableName()\n {\n return _DB_PREFIX_ . self::$definition['table'];\n }", "public static function getTableName()\n {\n return self::getDatabaseName() . '.' . self::NAME;\n }", "public function getTableName( )\n {\n return $this->table_name;\n }", "protected function table(): string\n {\n return $this->tableName;\n }", "public function table_name()\n\t{\n\t\treturn $this->table_name;\n\t}", "protected function getTableName(): string {\n return self::TABLE_NAME;\n }", "function table_name() {\n\t\tif ($this->table) {\n\t\t\treturn $this->table;\n\t\t} else {\n\t\t\treturn $this->_get_type();\n\t\t}\n\n\t}", "public function table_name ()\n {\n return $this->app->table_names->entries;\n }", "protected function table () : string {\n return $this->guessName();\n }", "protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}", "public function getTableName(): string\n {\n return $this->tableNames[0];\n }", "public function getTableName() {\n\t\t$dbName = empty($this->_dbName) ? '' : ($this->_dbName . '.');\n\t\t$tableName = $dbName . $this->_tableName;\n\t\treturn ($tableName);\n\t}", "public static function getTableName() {\n return self::$tableName;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public static function getTableName()\n {\n return ((new self)->getTable());\n }", "public function getTableName() {\n\t\treturn $this -> _name;\n\t}", "function getTableName()\r\n\t{\r\n\t\tif ( $this->table == null ) return (null );\r\n\t\treturn( $this->table->table_name());\r\n\t}", "public static function tablename() {\n return self::TABLE;\n }", "public function getTableName()\n\t{\n\t\treturn $this->getPrefix().$this->tableName;\n\t}", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName(): string\n {\n return $this->getEntityDao()->getTableName();\n }", "public static function getTableName()\n {\n $type = static::getType();\n return $type::getTableName();\n }", "public function getTableName()\r\n {\r\n return $this->tableName;\r\n }", "protected static function get_table_name() {\n return null;\n }", "public static function getTableName()\n {\n return self::getConfig()->get('scheme/tableName');\n }", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "function getTableName(): string;", "public function getTableName()\n\t{\n\t\treturn $this->tableName;\n\t}", "public function getTableName();", "public function getTableName();", "private static function get_table_name() {\n\n $class = get_called_class();\n\n return strtolower($class);\n\n }", "public function getTableName() {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->prefix . $this->table;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTableName(){\n\t\treturn $this->_table;\n\t}", "protected function getTableName()\n {\n return $this->database->getPrefix() . $this->table;\n }", "public function getTblName()\n {\n return $this->tbl_name;\n }", "public function getTableName()\n {\n return $this->_tableName;\n }", "public function getTableName() {}", "public function getTableName() {}", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->_table;\n }", "public function getTableName() ;", "public function getTableName() : string\n {\n if ($this->tableName !== null) {\n return $this->tableName;\n }\n\n return $this->reflectionClass->getShortName();\n }", "public function getTableName(){\n\t\treturn $this->tableName;\n\t}", "public function getTableName(){\n\t\t $table = get_class($this);\n\t\treturn strtolower(substr($table, strripos($table, \"\\\\\")+1));\n\t}", "public function\n\t\tget_table_name()\n\t{\n\t\tif (!isset($this->table_name)) {\n\t\t\t$sxe = $this->get_simple_xml_element();\n\t\t\t\n\t\t\t$this->table_name = (string)$sxe->table['name'];\n\t\t}\n\t\t\n\t\treturn $this->table_name;\n\t}", "function get_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->prefix . $this->table_name;\n\t}", "final public function getTableName()\n\t\t{\n\t\t\treturn $this->_tableName;\n\t\t}", "public function getTableName(){\n return $this->tableName;\n }", "public function _tablename() {\n if (isset($this->_table) && !isNull($this->_table)) {\n return $this->_table;\n } else {\n return camel_case_to_underscore(get_class($this));\n }\n }", "public static function getTableName() {\n return str_replace(\"-\", '_', self::getFolderName()) . 's';\n }", "public static function table_name() {\n $table_name = strtolower(get_called_class());\n\n if (!in_array($table_name, ApplicationSql::tablenames()))\n throw new TableNotFoundException(\"Veritabanında böyle bir tablo mevcut değil\", $table_name);\n\n return $table_name;\n }", "function get_table_name () {\r\n\t\treturn $this->wpdb->prefix . $this->_table_name;\r\n\t}", "function getTableName() {\n return $this->tableName;\n }", "public function getTable()\n {\n if (! isset($this->table)) {\n return str_replace('\\\\', '', Str::snake(Str::plural(class_basename($this))));\n }\n\n return $this->table;\n }", "public static function get_db_table_name(){\n global $TFUSE;\n return $TFUSE->ext->seek->get_db_table_name();\n }", "public function getTableName(): string;", "public function getTableName(): string;", "private function getTableName()\n {\n $class = get_class($this);\n\n $mem = new Cache();\n if ($tableName = $mem->get($class . '-table-name')) {\n return $tableName;\n }\n\n $break = explode('\\\\', $class);\n $ObjectName = end($break);\n $className = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ObjectName));\n $tableName = Inflect::pluralize($className);\n\n $mem->add($class . '-table-name', $tableName, 1440);\n\n return $tableName;\n }", "public function getTableName() {\n\t\t$table = strtolower(get_called_class());\n\t\tif ($table == 'person')\n\t\t\treturn 'people';\n\t\tswitch (substr($table, -1)) {\n\t\t\tcase 'y': return substr($table, 0, -1) . 'ies';\n\t\t\tcase 's': return $table . 'es';\n\t\t}\n\t\treturn $table . 's';\n\t}", "public function getTableName() {\n return $this->mapping['table'];\n }", "function get_table_name()\n {\n global $table_prefix;\n global $wpdb;\n $prefix = $table_prefix;\n if ($wpdb != null && $wpdb->prefix != null) {\n $prefix = $wpdb->prefix;\n }\n return apply_filters('ngg_datamapper_table_name', $prefix . $this->_object_name, $this->_object_name);\n }", "public function getTable()\n {\n if (! isset($this->table)) {\n return str_replace(\n '\\\\',\n '',\n Str::snake(Str::plural(class_basename(self::class)))\n );\n }\n\n return $this->table;\n }", "abstract public static function getTableName();", "abstract public static function getTableName();", "public function getTable()\n {\n if (isset($this->table)) {\n return $this->table;\n }\n\n return str_replace('\\\\', '', Str::snake(Str::plural(class_basename($this))));\n }", "public function getTable()\n {\n if (isset($this->table)) {\n return $this->table;\n }\n return str_replace('\\\\', '', Str::snake(Str::singular(class_basename($this))));\n }", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "public function getTableName()\n {\n if ($this->tableName) {\n return $this->tableName;\n }\n\n return $this->namingStrategy->classToTableName($this->name);\n }", "public static function table_name(): string {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->prefix . 'sb_' . static::TABLE;\n\t}", "public function getTableName(){\r\n\t\treturn strtolower(get_class($this));\r\n\t}", "protected function getTableName () {\n $class = explode('\\\\', get_class($this));\n\n return strtolower(end($class));\n }", "public static function getTableName()\n {\n return static::getConfig()[self::CONFIG_TABLE_NAME];\n }", "public static function getTable() : string {\n\t\t$namespacedClassParts = explode(\"\\\\\", get_called_class());\n\t\t$table = array_pop($namespacedClassParts);\n\t\t$table = preg_replace(\"/([a-z0-9])([A-Z0-9])/\", '$1_$2', $table);\n\t\t$table = strtolower($table);\n\t\treturn $table;\n\t}", "public function getTable() {\n if ( isset( $this->table ) ) {\n return $this->table;\n }\n\n $table = str_replace( '\\\\', '', snake_case( str_plural( class_basename( $this ) ) ) );\n\n return $this->getConnection()->db->prefix . $table ;\n }", "public static function getTableName()\n {\n return Str::snake(Str::pluralStudly(class_basename(get_called_class())));\n }", "public function table() {\n\t\treturn static::$table ?: strtolower(Str::plural(class_basename($this)));\n\t}", "public static function tableName(): string;", "abstract protected function getTableName();", "abstract protected function getTableName();" ]
[ "0.87493235", "0.8735879", "0.87249297", "0.8660773", "0.8588095", "0.8579911", "0.8570862", "0.8570862", "0.8570862", "0.85706013", "0.8569707", "0.8566761", "0.8544769", "0.8541197", "0.85325557", "0.8528673", "0.85208464", "0.8519042", "0.8500149", "0.84937036", "0.8482849", "0.8481615", "0.84756756", "0.84616643", "0.8459415", "0.8439687", "0.83960795", "0.8390472", "0.8381684", "0.8381684", "0.8381684", "0.8381684", "0.8364552", "0.83563375", "0.8351605", "0.8349001", "0.8343379", "0.8340359", "0.8340359", "0.8340359", "0.8339879", "0.83305305", "0.8328583", "0.8328583", "0.8324863", "0.832197", "0.83206713", "0.8315067", "0.83111125", "0.83111125", "0.82873374", "0.828565", "0.82780474", "0.82721424", "0.8250965", "0.8250965", "0.8246589", "0.8246589", "0.82326645", "0.8221772", "0.8220877", "0.82129127", "0.8207083", "0.82031995", "0.8203096", "0.8193141", "0.8186119", "0.8163171", "0.8158233", "0.8154929", "0.8145063", "0.8111668", "0.8101828", "0.8078959", "0.80722404", "0.80722404", "0.8065601", "0.8065431", "0.8064565", "0.80370486", "0.80152404", "0.80112773", "0.80112773", "0.7999024", "0.79984725", "0.79905194", "0.79905194", "0.79905194", "0.7989345", "0.7986334", "0.7984304", "0.7983778", "0.79822063", "0.79652005", "0.79589206", "0.7956601", "0.7951766", "0.79362", "0.7920219", "0.7920219" ]
0.84642744
23
Get current adapter class name
public function getClassName() { if (isset($this->generate_as)) { return $this->generate_as; } else return ucfirst($this->name).'AdapterImpl'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdapterClassName() {\n return $this->adapterClassName;\n }", "public function getAdapterClassName() {\n if ($this->class) {\n return $this->class;\n } elseif (!$this->getInterface()) {\n return $this->getClassName();\n } else return null;\n }", "public function getAdapterClass() {\n return $this->adapterClass;\n }", "public function getAdapterName()\n {\n return $this->adapterName;\n }", "function getAdapterName();", "public function getAdapterFullName()\n {\n return '\\ZendQueue\\Adapter\\\\' . $this->getAdapterName();\n }", "function get_driver_class_name()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n $adapter = $this->getAdapter();\n\n if ($adapter) {\n return $adapter;\n }\n\n $scheme = $this->dsn->scheme;\n\n return 'Cake\\Log\\Engine\\\\' . ucfirst($scheme) . 'Log';\n }", "function getClassName() {\n\t\treturn 'lib.pkp.classes.metadata.MetadataDescriptionDummyAdapter';\n\t}", "protected function _getClassName()\n {\n $this->_checkAdapter();\n return static::$_classMap[$this->_adapter->getDialect()];\n }", "public function getAdapterType();", "public function getAdapterName()\n {\n return 'Db';\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getAdapterConnection(): string\n {\n return $this->adapter;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getDriverName()\r\n {\r\n $reflect = new \\ReflectionClass($this);\r\n $namespace = $reflect->getNamespaceName();\r\n\r\n return substr(strrchr($namespace, \"\\\\\"), 1);\r\n }", "public function get_adapter()\n {\n return $this->_adapter;\n }", "public function getName()\n {\n return __CLASS__;\n }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->req->getAdapter();\n\t}", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "function getName()\n {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getDriverClass(): string\n {\n return static::$sDriverClass;\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function getClassName()\n {\n return $this->activityClass;\n }", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getAdapterMethod();", "public function getViewHelperClassName() {}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public function getQueryAdapterClass();", "public static function className() : string {\n return get_called_class();\n }", "public function get_class()\n {\n return $this->class;\n }", "public static function adapter()\n {\n return self::connectionManager()->getAdapter(static::connectionName());\n }", "protected function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->feedbackClass;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getAdapter();", "public function getAdapter();", "public function getAdapter()\r\n {\r\n }", "public function getClassName() ;", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getWidgetViewHelperClassName() {}", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClass()\n {\n return $this->_className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName();", "public function getClassName();", "public function driver()\n {\n return strtolower($this->driver);\n }", "public function getClassName() {\n return $this->className;\n }", "public function getAdapter() : Adapter\n {\n return $this->adapter;\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "protected function getAdapterNamespace()\n {\n return \"Adapters\\ThirdParty\";\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }" ]
[ "0.8546139", "0.84628975", "0.81053686", "0.7996842", "0.77670175", "0.75999993", "0.74073064", "0.7398324", "0.7089851", "0.7083192", "0.7073418", "0.69100595", "0.68582356", "0.68246233", "0.67926466", "0.6727503", "0.67229354", "0.67229354", "0.6694077", "0.6690192", "0.6690192", "0.6687286", "0.6687286", "0.6687286", "0.6687286", "0.6687286", "0.6687286", "0.6687286", "0.6687286", "0.6685345", "0.66707", "0.66686976", "0.66616344", "0.665764", "0.66414434", "0.6635751", "0.66075623", "0.6603615", "0.657792", "0.6559746", "0.6559746", "0.6528454", "0.6519741", "0.651442", "0.651248", "0.6466114", "0.64519686", "0.64484453", "0.644702", "0.6446944", "0.642631", "0.64242244", "0.6417378", "0.6396442", "0.6387391", "0.6382082", "0.63725007", "0.63696045", "0.63618004", "0.63325703", "0.6326442", "0.63166", "0.63166", "0.63166", "0.63166", "0.63024354", "0.63024354", "0.63019294", "0.6299981", "0.6299346", "0.6283194", "0.6283194", "0.6271306", "0.62701756", "0.6260366", "0.62565315", "0.62513137", "0.6250445", "0.6250445", "0.6250445", "0.6250445", "0.6250445", "0.6250445", "0.6250445", "0.6250445", "0.62369275", "0.6231741", "0.6231741", "0.62306166", "0.62306166", "0.6230474", "0.6220396", "0.62118304", "0.6208305", "0.62079245", "0.62079245", "0.61879826", "0.6186148", "0.6185036", "0.6172698" ]
0.7958611
4
Get the class name to implement
public function getImplements() { return array( 'pdoMap_Dao_IAdapter', $this->getGeneratedInterface() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() ;", "public function getClassName() : string;", "public function getClassName(): string;", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getClassName() { return __CLASS__; }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public static function getClassName() {\n return get_called_class();\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "protected function getClassName(): string\n {\n return $this->className;\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName() {\n if (isset($this->generate_as)) {\n return $this->generate_as;\n } else return ucfirst($this->name).'AdapterImpl';\n }", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClass()\n {\n return $this->_className;\n }", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "function getName()\n {\n return get_class($this);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getName()\n {\n return static::CLASS;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "public function getClass($name = null);", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClass() {}", "public function getClass() {}", "public function getClass() {}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "function get_driver_class_name()\n {\n return get_called_class();\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "function __toString()\n {\n return __CLASS__;\n }", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();", "public function getClass();" ]
[ "0.8252415", "0.8252415", "0.823351", "0.823351", "0.823351", "0.823351", "0.82120967", "0.8058368", "0.80380785", "0.8036677", "0.8011524", "0.80057263", "0.79868454", "0.79303575", "0.7917281", "0.7911965", "0.787799", "0.787799", "0.78604215", "0.78296787", "0.782636", "0.7813096", "0.7809209", "0.7805089", "0.7801846", "0.7796026", "0.77906233", "0.7784998", "0.77814645", "0.77643156", "0.77643156", "0.77610046", "0.77526563", "0.77452356", "0.77452356", "0.7744688", "0.77018315", "0.7663528", "0.76605237", "0.76371855", "0.7625597", "0.76167333", "0.76145625", "0.7596195", "0.7587094", "0.757332", "0.7572009", "0.7572009", "0.7572009", "0.7572009", "0.7572009", "0.7572009", "0.7570395", "0.7560155", "0.7560155", "0.7560155", "0.7560155", "0.7560155", "0.7560155", "0.7560155", "0.7560155", "0.7522863", "0.7511074", "0.7511074", "0.7503427", "0.749775", "0.74853504", "0.74853504", "0.74397075", "0.7433348", "0.7427248", "0.74270964", "0.74175805", "0.7378033", "0.7370827", "0.7346249", "0.7319122", "0.73126453", "0.73083645", "0.73074996", "0.7298988", "0.7298988", "0.72988206", "0.72857", "0.7267684", "0.7263652", "0.7219189", "0.7216219", "0.7201655", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032", "0.7196032" ]
0.0
-1
Get the generated interface name
public function getGeneratedInterface() { return 'I'.ucfirst($this->name).'Adapter'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function name(): string\n {\n return 'interface';\n }", "protected function getInterfaceDefinition($name) {\n return 'Webforge\\Types\\Interfaces\\\\'.$name;\n }", "abstract protected function generateName();", "public function getUniqueName()\n {\n \t// load the identifiers\n $identifier = $this->getIdentifier();\n $aspectClassName = get_class($this->getPointcut()->getAspect());\n $interceptWithMethod = $this->getPointcut()->interceptWithMethod();\n\t\t// return the concatenated unique name\n return \"$identifier::$aspectClassName::$interceptWithMethod\";\n }", "public function GenerateInterface($name = null) {\n\t\t\tif (!$name) $name = $this->getGeneratedInterface(); \n\t\t\t$this->writeLine('interface '.$name.' {'); \n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->writeSignature(true); \n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->writeSignature(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->writeSignature(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->writeSignature(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->writeSignature(true); \n $this->writeLine('}');\n }", "public function getInterfaceCode();", "public function name()\n {\n return Formatter::format(\n $this->identifierParts,\n $this->getOutputFormat()\n );\n }", "protected function getStub(): string\n {\n $stubPrefix = '';\n\n if (str_contains($this->getNameInput(), config('repository.repository_path', 'Repositories'))) {\n $stubPrefix = 'repository.';\n }\n\n return LarepositoryServiceProvider::$packageLocation\n . DIRECTORY_SEPARATOR\n . 'stubs' . DIRECTORY_SEPARATOR\n . 'Repository' . DIRECTORY_SEPARATOR\n . $stubPrefix . 'interface.stub';\n }", "protected function getStubName()\n {\n $stub = '/observer-plain.stub';\n\n if ($this->option('model')) {\n $stub = '/observer.stub';\n }\n\n return $stub;\n }", "public function getClassName() {\n if (isset($this->generate_as)) {\n return $this->generate_as;\n } else return ucfirst($this->name).'AdapterImpl';\n }", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function getComponentInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\ComponentHas' . $this->type . 'Interface';\n }", "public function getInternalName();", "public function get_name();", "public function get_name();", "public function get_name();", "public function getName()\n {\n return Language::_('Ispapi.name', true);\n }", "public function getNodename();", "public static function getServiceId(): string\n {\n return RequestInterface::class;\n }", "public function getInterfaceId()\n {\n return $this->interfaceId;\n }", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "private function auto_name(){\n\n // the name starts from the class name Tbutton1 etc\n // toString inherits method from Tcontrol\n // which inherits from Object\n \n $prefix=toString($this);\n // get current count\n $counter=count($this->names);\n // create name\n $name=$prefix.'_'.$counter;\n \n return $name;\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "protected function getControllerStubName()\n {\n $version = '';\n if ($this->option('api-version')) {\n $version = '-version-based';\n }\n\n return parent::getControllerStubName() . $version;\n }", "public function getCommandInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\' . $this->type . 'CommandInterface';\n }", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "private function getInterfaceName($fileParts)\n {\n $interfaceName = preg_replace(\"@([A-Z])@\", \"-$1\", $fileParts[count($fileParts) - 1]);\n $interfaceName = explode('-', strtolower(trim($interfaceName, '-')))[0];\n \n return \"interface-$interfaceName.php\";\n }", "public function getCompiledName()\n\t{\n\t\treturn \"{$this->getFingerprint()}.{$this->type}\";\n\t}", "protected function getStubName(): string\n {\n return '/controller.stub';\n }", "function getName(): string;", "function getName(): string;", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public static function getName()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "public function getInterfaceText();", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public static function getName();", "public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }", "public static function getName(ModelInterface $model) : string\n {\n return strtolower($model->getSource());\n }", "protected function getInterfacePath()\n {\n return './app/Repositories/' . $this->className . 'Interface.php';\n }", "public function getInternalName()\n {\n return ($this->isGlobal() ? 'g_' : 'f_') . str_replace('\\\\', '_', $this->namespace) . '_' . $this->getName();\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function getName()\n {\n return 'HiQDev General Use Yii 2 Extension Generator';\n }", "abstract public function getTypeName();", "static public function getName();", "public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }", "public function getName(): string\n {\n return 'IfThenPay Multibanco Gateway';\n }", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;" ]
[ "0.7561654", "0.67842674", "0.6774712", "0.6696295", "0.6657731", "0.6585888", "0.6551176", "0.64950436", "0.648664", "0.6471242", "0.6444275", "0.6396577", "0.639656", "0.6378045", "0.6378045", "0.6378045", "0.6369798", "0.6356752", "0.63536525", "0.635339", "0.6336516", "0.6312162", "0.6309241", "0.6278059", "0.6278059", "0.6275324", "0.6267147", "0.62563014", "0.6242477", "0.6242477", "0.6242477", "0.62414783", "0.6235761", "0.62288487", "0.6227356", "0.6227356", "0.6223401", "0.6203863", "0.6198243", "0.61944336", "0.6194002", "0.6192083", "0.6173501", "0.6166529", "0.61660016", "0.6161977", "0.6156856", "0.6156422", "0.6133203", "0.6133203", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.61320305", "0.6115058", "0.6115058", "0.6115058", "0.6115058", "0.61062384", "0.6093948", "0.6086811", "0.608664", "0.60861653", "0.60719603", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562", "0.6069562" ]
0.75436175
1
Get the generated interface name
public function getInterface() { return $this->implements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function name(): string\n {\n return 'interface';\n }", "public function getGeneratedInterface() {\n\t\t\treturn 'I'.ucfirst($this->name).'Adapter';\t\n\t\t}", "protected function getInterfaceDefinition($name) {\n return 'Webforge\\Types\\Interfaces\\\\'.$name;\n }", "abstract protected function generateName();", "public function getUniqueName()\n {\n \t// load the identifiers\n $identifier = $this->getIdentifier();\n $aspectClassName = get_class($this->getPointcut()->getAspect());\n $interceptWithMethod = $this->getPointcut()->interceptWithMethod();\n\t\t// return the concatenated unique name\n return \"$identifier::$aspectClassName::$interceptWithMethod\";\n }", "public function GenerateInterface($name = null) {\n\t\t\tif (!$name) $name = $this->getGeneratedInterface(); \n\t\t\t$this->writeLine('interface '.$name.' {'); \n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->writeSignature(true); \n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->writeSignature(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->writeSignature(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->writeSignature(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->writeSignature(true); \n $this->writeLine('}');\n }", "public function getInterfaceCode();", "public function name()\n {\n return Formatter::format(\n $this->identifierParts,\n $this->getOutputFormat()\n );\n }", "protected function getStub(): string\n {\n $stubPrefix = '';\n\n if (str_contains($this->getNameInput(), config('repository.repository_path', 'Repositories'))) {\n $stubPrefix = 'repository.';\n }\n\n return LarepositoryServiceProvider::$packageLocation\n . DIRECTORY_SEPARATOR\n . 'stubs' . DIRECTORY_SEPARATOR\n . 'Repository' . DIRECTORY_SEPARATOR\n . $stubPrefix . 'interface.stub';\n }", "protected function getStubName()\n {\n $stub = '/observer-plain.stub';\n\n if ($this->option('model')) {\n $stub = '/observer.stub';\n }\n\n return $stub;\n }", "public function getClassName() {\n if (isset($this->generate_as)) {\n return $this->generate_as;\n } else return ucfirst($this->name).'AdapterImpl';\n }", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function getComponentInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\ComponentHas' . $this->type . 'Interface';\n }", "public function getInternalName();", "public function get_name();", "public function get_name();", "public function get_name();", "public function getName()\n {\n return Language::_('Ispapi.name', true);\n }", "public function getNodename();", "public function getInterfaceId()\n {\n return $this->interfaceId;\n }", "public static function getServiceId(): string\n {\n return RequestInterface::class;\n }", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "private function auto_name(){\n\n // the name starts from the class name Tbutton1 etc\n // toString inherits method from Tcontrol\n // which inherits from Object\n \n $prefix=toString($this);\n // get current count\n $counter=count($this->names);\n // create name\n $name=$prefix.'_'.$counter;\n \n return $name;\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "protected function getControllerStubName()\n {\n $version = '';\n if ($this->option('api-version')) {\n $version = '-version-based';\n }\n\n return parent::getControllerStubName() . $version;\n }", "public function getCommandInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\' . $this->type . 'CommandInterface';\n }", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "private function getInterfaceName($fileParts)\n {\n $interfaceName = preg_replace(\"@([A-Z])@\", \"-$1\", $fileParts[count($fileParts) - 1]);\n $interfaceName = explode('-', strtolower(trim($interfaceName, '-')))[0];\n \n return \"interface-$interfaceName.php\";\n }", "public function getCompiledName()\n\t{\n\t\treturn \"{$this->getFingerprint()}.{$this->type}\";\n\t}", "protected function getStubName(): string\n {\n return '/controller.stub';\n }", "function getName(): string;", "function getName(): string;", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public static function getName()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "public function getInterfaceText();", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }", "public static function getName();", "public static function getName(ModelInterface $model) : string\n {\n return strtolower($model->getSource());\n }", "protected function getInterfacePath()\n {\n return './app/Repositories/' . $this->className . 'Interface.php';\n }", "public function getInternalName()\n {\n return ($this->isGlobal() ? 'g_' : 'f_') . str_replace('\\\\', '_', $this->namespace) . '_' . $this->getName();\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "public function name();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function getName()\n {\n return 'HiQDev General Use Yii 2 Extension Generator';\n }", "abstract public function getTypeName();", "public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "static public function getName();", "public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }", "public function getName(): string\n {\n return 'IfThenPay Multibanco Gateway';\n }", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;", "public function getName(): string;" ]
[ "0.75606626", "0.7544979", "0.67841804", "0.6774879", "0.66955847", "0.6658735", "0.6586861", "0.6549893", "0.6494723", "0.6484905", "0.6470596", "0.64428055", "0.63962895", "0.63948846", "0.63760513", "0.63760513", "0.63760513", "0.63671815", "0.635424", "0.6354084", "0.63536185", "0.63381773", "0.6310768", "0.6307157", "0.62764543", "0.62764543", "0.6275704", "0.6265435", "0.62561363", "0.6240815", "0.6240815", "0.6240815", "0.62402195", "0.6235875", "0.6227435", "0.62256217", "0.62256217", "0.6221023", "0.62023467", "0.61985165", "0.6192501", "0.6192078", "0.6190341", "0.6171143", "0.6163868", "0.6163697", "0.61607385", "0.6157804", "0.61554134", "0.61309826", "0.61309826", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61299944", "0.61127627", "0.61127627", "0.61127627", "0.61127627", "0.610583", "0.6092348", "0.6084761", "0.6084142", "0.6082856", "0.6070074", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716", "0.6067716" ]
0.0
-1
Get the parent class name
public function getExtends() { return 'pdoMap_Dao_Adapter'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentClassName()\n {\n return $this->Parent()->getClassName();\n }", "function get_parent_class() {\n\t\t$args = func_get_args();\n\t\treturn strtolower(call_user_func_array(\"get_parent_class\", $args));\n\t}", "public function getParentClass() {}", "public function getParentName()\n {\n return $this->getParentContext()->getName();\n }", "abstract protected function getParentObjectName();", "protected function name()\n\t{\n\t\t/**\n\t\t * `parent` is still the parent class in the class hierarchy, not\n\t\t * the trait.\n\t\t */\n\t\treturn parent::name().' bat';\n\t}", "public function getParentName() {\n\t\t\t$parent = new Page();\n\t\t\t$parent->loadByGUID($this->parent);\n\t\t\treturn $parent->name;\n\t\t}", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public static function getClassName() {\n return get_called_class();\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getClassName() ;", "public function getParentFieldName()\n {\n return $this->prototype->getParentFieldName();\n }", "public function getClassName() { return __CLASS__; }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getName()\n {\n return __CLASS__;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getClassName();", "public function getClassName();", "function packageNameWithParent()\n {\n $parent = $this->getParent();\n return ucwords($parent) . $this->getPackageName();\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getParentTitle()\n {\n if ($parent = $this->Parent()) {\n return $parent->Title ?: ($parent->ClassName . ' #' . $parent->ID);\n }\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "function getName()\n {\n return get_class($this);\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName() {\n return $this->className;\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "protected function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getParentPluginName() {}", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getTableName()\n {\n return $this->parentTable->getName();\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getParentSourceName() {\n return $this->parentSource;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "function getClassName($relativeClassName);", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName(): string;", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public static function label()\n {\n return Str::singular(class_basename(get_called_class()));\n }", "protected function getBaseClassName() {\r\n\t\tif(method_exists(static::$className, 'getBaseClassName')) {\r\n\t\t\treturn call_user_func(array(static::$className, 'getBaseClassName'));\r\n\t\t} else {\r\n\t\t\treturn mb_substr(static::$className, 0, -6);\r\n\t\t}\r\n\t}", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getParentNameSpace(){\n return $this->_namespace;\n }", "public function getDataParentName()\r\n\t{\r\n\t\tif (is_null($this->data_parent))\r\n\t\t{\r\n\t\t\t$this->data_parent = $this->getDataParent();\r\n\t\t}\r\n\t\tif ( ! is_null($this->data_parent))\r\n\t\t\treturn $this->data_parent->name;\r\n\r\n\t\treturn NULL;\r\n\t}", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function getClassName() {\n\t\treturn $this->_className;\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 getCommandParentName(): string\n\t{\n\t\treturn CliCreate::COMMAND_NAME;\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() : string;", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public function getClassName() : string\n {\n\n return $this->className;\n }", "abstract public function parent();", "public function getParentType()\n {\n return $this->getParent();\n }", "public function getParent()\n {\n }", "public static function getClassName() {\n return self::$className;\n }", "public function get_parent();", "public function getClass()\n {\n return $this->_className;\n }", "public function getParentIdentifier()\n {\n return $this->parent;\n }" ]
[ "0.8713466", "0.80483663", "0.7939863", "0.7850326", "0.7715777", "0.74151266", "0.7348355", "0.7317825", "0.7284351", "0.7275702", "0.7259765", "0.7220434", "0.7171742", "0.7061621", "0.7058512", "0.70424855", "0.7004986", "0.7004986", "0.7004986", "0.7004986", "0.7003044", "0.6970298", "0.69636685", "0.6960801", "0.6960801", "0.6960648", "0.6957667", "0.69560295", "0.69436765", "0.6928831", "0.6928831", "0.6905038", "0.6890786", "0.6882668", "0.6878958", "0.6878775", "0.68778557", "0.6862731", "0.68516815", "0.68399805", "0.68399805", "0.6838104", "0.6831923", "0.6822095", "0.6808414", "0.6808414", "0.6808414", "0.6808414", "0.6808414", "0.6808414", "0.6808414", "0.6808414", "0.6794876", "0.679164", "0.6788742", "0.6786139", "0.67843926", "0.6781369", "0.67708385", "0.6751293", "0.67453337", "0.67453337", "0.6744278", "0.6743117", "0.67379653", "0.6732542", "0.6732542", "0.6731133", "0.67281926", "0.67243505", "0.67216396", "0.6719461", "0.6719461", "0.6713631", "0.6709972", "0.6704363", "0.6694032", "0.6692906", "0.66729283", "0.6670763", "0.66619706", "0.6658758", "0.6636075", "0.6636075", "0.6636075", "0.6636075", "0.6636075", "0.6636075", "0.6636075", "0.66335505", "0.66261834", "0.6625101", "0.6596914", "0.6587485", "0.6581226", "0.65808016", "0.65750116", "0.6559897", "0.6551697", "0.65426755", "0.6530871" ]
0.0
-1
Generate the mapping interface
public function GenerateInterface($name = null) { if (!$name) $name = $this->getGeneratedInterface(); $this->writeLine('interface '.$name.' {'); if (isset($this->select_one)) foreach($this->select_one as $rq) $rq->writeSignature(true); if (isset($this->select)) foreach($this->select as $rq) $rq->writeSignature(true); if (isset($this->insert)) foreach($this->insert as $rq) $rq->writeSignature(true); if (isset($this->update)) foreach($this->update as $rq) $rq->writeSignature(true); if (isset($this->delete)) foreach($this->delete as $rq) $rq->writeSignature(true); $this->writeLine('}'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function defineMapping();", "abstract protected function getMapping();", "abstract protected function getMapping();", "public function getMapping() {}", "abstract protected function buildMap();", "public function getMappings();", "public function getMappings();", "public function getExportMappings()\n {\n }", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "protected function generateMapFile()\n {\n $namespace = $this->getNamespace();\n $class = $this->options['class'];\n\n $php = <<<EOD\n<?php\n\nnamespace $namespace;\n\nuse $namespace\\\\Base\\\\${class}Map as Base${class}Map;\nuse $namespace\\\\${class};\nuse \\\\Pomm\\\\Exception\\\\Exception;\nuse \\\\Pomm\\\\Query\\\\Where;\n\nclass ${class}Map extends Base${class}Map\n{\n}\n\nEOD;\n\n return $php;\n }", "abstract protected function getMapper(): MapperInterface;", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "public static function map() {\n if (count($argv) > 1) { \n $args = self::getArguments();\n $options = self::convertArgsToOptions($args);\n $class_map = self::routeUsingOpts($options);\n }\n else {\n $class_map = self::checkBaseDir();\n $options = self::convertArgsToOptions();\n } \n \n $ser_array = self::serializeClassMap($class_map, $options['type']);\n self::writeSerialized($ser_array);\n print_r($class_map);\n \n }", "protected function _createMapping() {\n $mapping = parent::_createMapping();\n $mapping->callbacks()->onAfterMapping = array(\n $this, 'callbackSortPageIds'\n );\n return $mapping;\n }", "private function generateMaps(): void\n {\n $this->socketMap = $this->streamMap = [\n self::RESOURCE => [\n self::READ => [],\n self::WRITE => []\n ],\n self::HANDLER => [\n self::READ => [],\n self::WRITE => []\n ]\n ];\n\n $socketCount = $streamCount = 0;\n\n\n\n // Sockets\n foreach ($this->sockets as $id => $binding) {\n /** @var resource|Socket $socket */\n $socket = $binding->getIoResource();\n $resourceId = $this->identifySocket($socket);\n\n if ($binding->isStreamBased()) {\n /** @var resource $socket */\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n } else {\n $this->socketMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->socketMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $socketCount++;\n }\n }\n\n\n // Streams\n foreach ($this->streams as $id => $binding) {\n /** @var resource $stream */\n $stream = $binding->getIoResource();\n $resourceId = (int)$stream;\n\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $stream;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n }\n\n\n // Signals\n $this->signalMap = [];\n\n foreach ($this->signals as $id => $binding) {\n foreach (array_keys($binding->signals) as $number) {\n $this->signalMap[$number][$id] = $binding;\n }\n }\n\n // Cleanup\n if (!$socketCount) {\n $this->socketMap = null;\n }\n\n if (!$streamCount) {\n $this->streamMap = null;\n }\n\n $this->generateMaps = false;\n }", "private function setupMapping()\n {\n $this->mapping = array();\n $fields = array();\n\n $aliases = array_keys($this->getJoinSettings());\n\n foreach ($aliases as $i => $alias) {\n $fields = array_merge($fields, $this->mapAlias($alias));\n }\n\n $this->mapping['fields'] = array_replace_recursive($fields, $this->getCustomMapping());\n $this->mapping['joins'] = $this->getJoinSettings();\n }", "abstract protected function initializeMappedTypes();", "public function reverseMap(): MappingInterface;", "public function buildClassAliasMapFile() {}", "public function getDtdMapping();", "public function generateMappings(){\n\n if( !count($this->mappings) ){\n return '';\n }\n\n $this->source_keys = array_flip(array_keys($this->sources));\n\n\n // group mappings by generated line number.\n $groupedMap = $groupedMapEncoded = array();\n foreach($this->mappings as $m){\n $groupedMap[$m['generated_line']][] = $m;\n }\n ksort($groupedMap);\n\n $lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;\n\n foreach($groupedMap as $lineNumber => $line_map){\n while(++$lastGeneratedLine < $lineNumber){\n $groupedMapEncoded[] = ';';\n }\n\n $lineMapEncoded = array();\n $lastGeneratedColumn = 0;\n\n foreach($line_map as $m){\n $mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);\n $lastGeneratedColumn = $m['generated_column'];\n\n // find the index\n if( $m['source_file'] ){\n $index = $this->findFileIndex($m['source_file']);\n if( $index !== false ){\n $mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);\n $lastOriginalIndex = $index;\n\n // lines are stored 0-based in SourceMap spec version 3\n $mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);\n $lastOriginalLine = $m['original_line'] - 1;\n\n $mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);\n $lastOriginalColumn = $m['original_column'];\n }\n }\n\n $lineMapEncoded[] = $mapEncoded;\n }\n\n $groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';\n }\n\n return rtrim(implode($groupedMapEncoded), ';');\n }", "function generate_map_file(){\n\t\t$map = ms_newMapObj($this->default_map_file);\n\t\t$n_layers = count($this->viewable_layers);\n\t\t// go through and create new \n\t\t// layer objects for those layers\n\t\t// that have their display property set\n\t\t// to true, adding them to the\n\t\t// map object\n\t\tfor($i = 0; $i < $n_layers; $i++){\n\t\t\tif($this->viewable_layers[$i]->display == \"true\"){\n\t\t\t\t$layer = ms_newLayerObj($map);\n\t\t\t\t$layer->set(\"name\", $this->viewable_layers[$i]->layer_name);\n\t\t\t\t$layer->set(\"status\", MS_OFF);\n\t\t\t\t$layer->set(\"template\", \"nepas.html\");\n\t\t\t\t$this->set_ms_layer_type($layer, $this->viewable_layers[$i]);\n\t\t\t\t$layer->set(\"connectiontype\", MS_POSTGIS);\n\t\t\t\t$layer->set(\"connection\", $this->dbconn->mapserver_conn_str);\n\t\t\t\t$this->set_ms_data_string($layer, $this->viewable_layers[$i]);\n\t\t\t\t$layer->setProjection($this->viewable_layers[$i]->layer_proj);\n\t\t\t\t// added to allow getfeatureinfo requests on\n\t\t\t\t// this layer via WMS\n\t\t\t\t$layer->setMetaData(\"WMS_INCLUDE_ITEMS\", \"all\");\n\t\t\t\t// generate a CLASSITEM directive \n\t\t\t\tif($this->viewable_layers[$i]->layer_ms_classitem != \"\")\n\t\t\t\t\t$layer->set(\"classitem\", $this->viewable_layers[$i]->layer_ms_classitem);\n\n\t\t\t\t// generate classes that this\n\t\t\t\t// layer contains\n\t\t\t\t$n_classes = count($this->viewable_layers[$i]->layer_classes);\n\t\t\t\tfor($j = 0; $j < $n_classes; $j++){\n\t\t\t\t\t$ms_class_obj = ms_newClassObj($layer);\n\t\t\t\t\t$ms_class_obj->set(\"name\", $this->viewable_layers[$i]->layer_classes[$j]->name);\n\t\t\t\t\t$ms_class_obj->setExpression($this->viewable_layers[$i]->layer_classes[$j]->expression);\n\t\t\t\t\tforeach($this->viewable_layers[$i]->layer_classes[$j]->styles as $style){\n\t\t\t\t\t\t$ms_style_obj = ms_newStyleObj($ms_class_obj);\n\t\t\t\t\t\t$ms_style_obj->color->setRGB($style->color_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->color_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->color_b);\n\t\t\t\t\t\t// set bg color\n\t\t\t\t\t\t$ms_style_obj->backgroundcolor->setRGB($style->bgcolor_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->bgcolor_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->bgcolor_b);\n\t\t\t\t\t\t// set outline color\n\t\t\t\t\t\t$ms_style_obj->outlinecolor->setRGB($style->outlinecolor_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->outlinecolor_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->outlinecolor_b);\n\t\t\t\t\t\tif($style->symbol_name != \"\"){\n\t\t\t\t\t\t\t$ms_style_obj->set(\"symbolname\", $style->symbol_name);\n\t\t\t\t\t\t\t// check for valid size\n\t\t\t\t\t\t\tif($style->symbol_size != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"size\", $style->symbol_size);\n\t\t\t\t\t\t\t// check for valid angle\n\t\t\t\t\t\t\tif($style->angle != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"angle\", $style->angle);\n\t\t\t\t\t\t\t// check for valid width\n\t\t\t\t\t\t\tif($style->width != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"width\", $style->width);\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}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($map->save($this->output_mapfile) == MS_FAILURE){\n\t\t\techo \"mapfile could not be saved\";\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\treturn $this->output_mapfile;\t\n\t}", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true\n ),\n 'APP_ID' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateVarchar128'),\n ),\n 'CODE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateVarchar128'),\n ),\n 'TYPE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateType'),\n ),\n 'HANDLER' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateHandler'),\n ),\n 'DATE_ADD' => array(\n 'data_type' => 'datetime',\n 'default_value' => new Main\\Type\\DateTime(),\n ),\n 'AUTHOR_ID' => array(\n 'data_type' => 'integer',\n 'default_value' => 0,\n ),\n 'AUTHOR' => array(\n 'data_type' => '\\Bitrix\\Main\\UserTable',\n 'reference' => array(\n '=this.AUTHOR_ID' => 'ref.ID'\n ),\n 'join_type' => 'LEFT',\n ),\n );\n }", "public function getTypeMap()\n {\n }", "protected abstract function map();", "public function getIsoMapping() {}", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\t'PROFILE_ID' => new Entity\\IntegerField('PROFILE_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'PROFILE_EXEC_ID' => new Entity\\IntegerField('PROFILE_EXEC_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'DATE_EXEC' => new Entity\\DateTimeField('DATE_EXEC', array(\n\t\t\t\t'default_value' => ''\n\t\t\t)),\n\t\t\t'TYPE' => new Entity\\StringField('TYPE', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'ENTITY_ID' => new Entity\\IntegerField('ENTITY_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'FIELDS' => new Entity\\TextField('FIELDS', array()),\n\t\t\t'PROFILE' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileTable',\n\t\t\t\tarray('=this.PROFILE_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'PROFILE_EXEC' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE_EXEC',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileExecTable',\n\t\t\t\tarray('=this.PROFILE_EXEC_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_ELEMENT' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_ELEMENT',\n\t\t\t\t'\\Bitrix\\Iblock\\ElementTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_SECTION' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_SECTION',\n\t\t\t\t'\\Bitrix\\Iblock\\SectionTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t);\n\t}", "public static function getMap()\n {\n return [\n 'ID' => [\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('GENERATOR_ENTITY_ID_FIELD'),\n ],\n 'STEP' => [\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('GENERATOR_ENTITY_ITEMS_STEP_FIELD'),\n ],\n 'STATUS' => [\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('GENERATOR_ENTITY_STATUS_FIELD'),\n ],\n 'ITEMS_PER_STEP' => [\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('GENERATOR_ENTITY_ITEMS_PER_STEP_FIELD'),\n ],\n 'CREATED' => [\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('GENERATOR_ENTITY_CREATED_FIELD'),\n ],\n ];\n }", "public function mapsFrom(self $keygen)\n {\n return self::maps($keygen, $this);\n }", "public abstract function toMap(): array;", "protected function _createCidToGidMap() {}", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('TEMPLATE_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PROVIDER', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\ReferenceField('TEMPLATE', '\\Bitrix\\DocumentGenerator\\Model\\Template',\n\t\t\t\t['=this.TEMPLATE_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "protected function get_class_mapper() {\n\t\t$class_mapper = array();\n\n\t\t/*\n\t\t * rsvp\n\t\t * @link https://indieweb.org/rsvp\n\t\t */\n\t\t$class_mapper['rsvp'] = 'rsvp';\n\n\t\t/*\n\t\t * invite\n\t\t * @link https://indieweb.org/invitation\n\t\t */\n\t\t$class_mapper['invitee'] = 'invite';\n\n\t\t/*\n\t\t * repost\n\t\t * @link https://indieweb.org/repost\n\t\t */\n\t\t$class_mapper['repost'] = 'repost';\n\t\t$class_mapper['repost-of'] = 'repost';\n\n\t\t/*\n\t\t * likes\n\t\t * @link https://indieweb.org/likes\n\t\t */\n\t\t$class_mapper['like'] = 'like';\n\t\t$class_mapper['like-of'] = 'like';\n\n\t\t/*\n\t\t * favorite\n\t\t * @link https://indieweb.org/favorite\n\t\t */\n\t\t$class_mapper['favorite'] = 'favorite';\n\t\t$class_mapper['favorite-of'] = 'favorite';\n\n\t\t/*\n\t\t * bookmark\n\t\t * @link https://indieweb.org/bookmark\n\t\t */\n\t\t$class_mapper['bookmark'] = 'bookmark';\n\t\t$class_mapper['bookmark-of'] = 'bookmark';\n\n\t\t/*\n\t\t * tag\n\t\t * @link https://indieweb.org/tag\n\t\t */\n\t\t$class_mapper['tag-of'] = 'tag';\n\t\t$class_mapper['category'] = 'tag';\n\n\t\t/*\n\t\t * read\n\t\t * @link https://indieweb.org/read\n\t\t */\n\t\t$class_mapper['read-of'] = 'read';\n\t\t$class_mapper['read'] = 'read';\n\n\t\t/*\n\t\t * listen\n\t\t * @link https://indieweb.org/listen\n\t\t */\n\t\t$class_mapper['listen-of'] = 'listen';\n\t\t$class_mapper['listen'] = 'listen';\n\n\t\t/*\n\t\t * watch\n\t\t * @link https://indieweb.org/watch\n\t\t */\n\t\t$class_mapper['watch-of'] = 'watch';\n\t\t$class_mapper['watch'] = 'watch';\n\n\t\t/*\n\t\t * follow\n\t\t * @link https://indieweb.org/follow\n\t\t */\n\t\t$class_mapper['follow-of'] = 'follow';\n\n\t\t/*\n\t\t * replies\n\t\t * @link https://indieweb.org/replies\n\t\t */\n\t\t$class_mapper['in-reply-to'] = 'comment';\n\t\t$class_mapper['reply'] = 'comment';\n\t\t$class_mapper['reply-of'] = 'comment';\n\n\t\treturn apply_filters( 'webmention_mf2_class_mapper', $class_mapper );\n\t}", "public function getMapping()\n {\n return $this->mapping;\n }", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "function attemptMapping($input, $output)\r\n\t{\r\n\t\t//Copy pasted from AdapterAction\r\n\t\t$target = $output;\r\n $lpos = strrpos($target, \".\");\r\n if ($lpos === false) {\r\n $classname = $target;\r\n\t\t\t$uriclasspath = $target . \".php\";\r\n $classpath = $this->_basecp . $target . \".php\";\r\n } else {\r\n $classname = substr($target, $lpos + 1);\r\n $classpath = $this->_basecp . str_replace(\".\", \"/\", $target) . \".php\"; // removed to strip the basecp out of the equation here\r\n \t$uriclasspath = str_replace(\".\", \"/\", $target) . \".php\"; // removed to strip the basecp out of the equation here\r\n\t\t}\r\n\t\t\r\n\t\t//Let's try to instantiate the class\r\n\t\t\r\n\t\tchdir(dirname($classpath)); // now change to the directory of the classpath. Possible relative to gateway.php\r\n $fileIncluded = @include_once(\"./\" . basename($classpath)); // include the class file\r\n $fileExists = @file_exists(basename($classpath)); // see if the file exists\r\n \r\n if (!class_exists($classname)) { // Just make sure the class name is the same as the file name\r\n if ($fileExists) { // file exists probably with errors\r\n $ex = new AMFException(E_USER_ERROR, \"The mapped class {\" . $classname . \"} could not be loaded. The class file exists but may contain syntax errors.\", __FILE__, __LINE__);\r\n AMFException::throwException($this->bodyObj, $ex);\r\n return;\r\n } else {\r\n $ex = new AMFException(E_USER_ERROR, \"The mapped class {\" . $classname . \"} could not be found under the class path {\" . $classpath . \"}\", __FILE__, __LINE__);\r\n AMFException::throwException($this->bodyObj, $ex);\r\n return;\r\n } \r\n return $input;\r\n }\r\n else\r\n {\r\n\t\t\t//Instantiate new class\r\n\t\t\t$mapped = new $classname();\r\n\t\t\tif(is_array($input))\r\n\t\t\t{\r\n\t\t\t\tforeach($input as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($key != '_explicitType')\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\t//Input values\r\n\t\t\t\t\t\t$mapped->$key = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $mapped;\r\n\t\t}\r\n\t}", "function setUp() {\n\n $this->oResolver= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter());\n $aMap=array();\n $oL0ClassOne=&new layer0\\ClassOne(\" <b>Text Passed to The Instance created manually layer0->ClassOne</b>\");\n $aMap['layer2\\ClassOne']=&$oL0ClassOne;\n //$this->oResolverWithMap= new reflection\\ResolverByReflection(new reflection\\resolveInterfaceByName\\ResolveInterfaceByNameFirstLetter(),);\n\n }", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true\n ),\n 'OBJECT_ID' => array(\n 'data_type' => 'integer',\n 'required' => true\n ),\n 'TASK_ID' => array(\n 'data_type' => 'integer',\n 'required' => true\n ),\n 'ACCESS_CODE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateAccessCode')\n ),\n 'DOMAIN' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateDomain')\n ),\n 'NEGATIVE' => array(\n 'data_type' => 'integer',\n 'required' => true\n ),\n 'OBJECT' => array(\n 'data_type' => 'Bitrix\\Disk\\DiskObject',\n 'reference' => array('=this.OBJECT_ID' => 'ref.ID'),\n ),\n 'TASK' => array(\n 'data_type' => 'Bitrix\\Task\\Task',\n 'reference' => array('=this.TASK_ID' => 'ref.ID'),\n ),\n );\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\tnew Entity\\StringField('EXTERNAL_CHAT_ID', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateVarChar')\n\t\t\t)),\n\t\t\tnew Entity\\StringField('CONNECTOR', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateVarChar')\n\t\t\t)),\n\t\t\tnew Entity\\StringField('EXTERNAL_MESSAGE_ID', array(\n\t\t\t\t'validation' => array(__CLASS__, 'validateVarChar')\n\t\t\t)),\n\t\t);\n\t}", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "public function getMapper(){ \n $mapper = new Profile_Model_ObjectView_Mapper();\n return $mapper;\n }", "protected function generateJson(){\n\n $sourceMap = array();\n $mappings = $this->generateMappings();\n\n // File version (always the first entry in the object) and must be a positive integer.\n $sourceMap['version'] = self::VERSION;\n\n\n // An optional name of the generated code that this source map is associated with.\n $file = $this->getOption('sourceMapFilename');\n if( $file ){\n $sourceMap['file'] = $file;\n }\n\n\n // An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry.\tThis value is prepended to the individual entries in the 'source' field.\n $root = $this->getOption('sourceRoot');\n if( $root ){\n $sourceMap['sourceRoot'] = $root;\n }\n\n\n // A list of original sources used by the 'mappings' entry.\n $sourceMap['sources'] = array();\n foreach($this->sources as $source_uri => $source_filename){\n $sourceMap['sources'][] = $this->normalizeFilename($source_filename);\n }\n\n\n // A list of symbol names used by the 'mappings' entry.\n $sourceMap['names'] = array();\n\n // A string with the encoded mapping data.\n $sourceMap['mappings'] = $mappings;\n\n if( $this->getOption('outputSourceFiles') ){\n // An optional list of source content, useful when the 'source' can't be hosted.\n // The contents are listed in the same order as the sources above.\n // 'null' may be used if some original sources should be retrieved by name.\n $sourceMap['sourcesContent'] = $this->getSourcesContent();\n }\n\n // less.js compat fixes\n if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){\n unset($sourceMap['sourceRoot']);\n }\n\n return json_encode($sourceMap);\n }", "public static function updateMapping()\n {\n $db = static::getDb();\n $command = $db->createCommand();\n $command->setMapping(static::index(), static::type(), static::mapping());\n }", "public function getMapping() {\n return $this->mapping;\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\t'ORDER_NEW_TASK' => new Entity\\StringField('ORDER_NEW_TASK', array(\n\t\t\t\t'required' => true\n\t\t\t))\n\t\t);\n\t}", "public function mapFor()\n {\n // Here we tell Doctrine that this mapping is for the Scientist object.\n return Article::class;\n }", "public function getMapper(){ \n $mapper = new Wf_Model_WfProcesso_Mapper();\n return $mapper;\n }", "public function getDataMapper() {}", "public function getPropertyMappingConfiguration() {}", "public function getTypeMapper();", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('ID', [\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\IntegerField('REGION_ID', [\n\t\t\t\t'required' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('CODE', [\n\t\t\t\t'required' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PHRASE'),\n\t\t\tnew Main\\Entity\\ReferenceField('REGION', '\\Bitrix\\DocumentGenerator\\Model\\Region',\n\t\t\t\t['=this.REGION_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public function getCustomMapping()\n {\n return $this->custom_mapping;\n }", "public static function init()\n {\n if (self::$_map != null) {\n return;\n }\n\n self::$_map = [\n self::CONTACT => [\n 'tableName' => \\app\\models\\Contact::tableName(),\n 'label' => 'contact'\n ],\n self::ADDRESS => [\n 'tableName' => \\app\\models\\Address::tableName(),\n 'label' => 'address'\n ],\n self::BANK_ACCOUNT => [\n 'tableName' => \\app\\models\\BankAccount::tableName(),\n 'label' => 'bank account',\n 'viewRoute' => 'bank-account/view'\n ],\n self::ATTACHMENT => [\n 'tableName' => \\app\\models\\Attachment::tableName(),\n 'label' => 'attachment'\n ],\n self::CATEGORY => [\n 'tableName' => \\app\\models\\Category::tableName(),\n 'label' => 'category'\n ],\n self::ORDER => [\n 'tableName' => \\app\\models\\Order::tableName(),\n 'label' => 'order'\n ],\n self::PRODUCT => [\n 'tableName' => \\app\\models\\Product::tableName(),\n 'label' => 'product'\n ],\n self::TRANSACTION => [\n 'tableName' => \\app\\models\\Transaction::tableName(),\n 'label' => 'transaction'\n ],\n self::TRANSACTION_PACK => [\n 'tableName' => \\app\\models\\TransactionPack::tableName(),\n 'label' => 'transaction pack',\n 'viewRoute' => 'transaction-pack/view'\n ],\n self::CONTACT_RELATION => [\n 'tableName' => \\app\\models\\ContactRelation::tableName(),\n 'label' => 'contact relation',\n 'viewRoute' => 'contact-relation/view'\n ],\n self::TAG => [\n 'tableName' => \\app\\models\\Tag::tableName(),\n 'label' => 'tag',\n 'viewRoute' => 'tag/view'\n ],\n ];\n }", "function buildr_map_script()\n{\n require_code('buildr');\n\n $realm = get_param_integer('realm', null);\n download_map_wrap(get_member(), $realm);\n}", "public function hasMapping();", "public function getMappingTargets() {\n $targets = parent::getMappingTargets();\n $targets['fid'] = array(\n 'name' => t('File ID'),\n 'description' => t('The fid of the file. NOTE: use this feature with care, file ids are usually assigned by Drupal.'),\n 'optional_unique' => TRUE,\n );\n $targets['filename'] = array(\n 'name' => t('Filename'),\n 'description' => t('The filename of the file.'),\n 'optional_unique' => TRUE,\n );\n $targets['uri'] = array(\n 'name' => t('File URI'),\n 'description' => t('The URI of the file. NOTE: use this feature with care, file URIs are usually assigned by Drupal. If the media module is installed, it will attempt to parse the passed URI for remote files.'),\n 'optional_unique' => TRUE,\n );\n $targets['bundle'] = array(\n 'name' => t('File Type'),\n 'description' => t('The type/bundle of the file. NOTE: use this feature with care, file types are usually assigned by Drupal.'),\n );\n $targets['uid'] = array(\n 'name' => t('User ID'),\n 'description' => t('The Drupal user ID of the file author.'),\n );\n $targets['user_name'] = array(\n 'name' => t('Username'),\n 'description' => t('The Drupal username of the file author.'),\n );\n $targets['user_mail'] = array(\n 'name' => t('User email'),\n 'description' => t('The email address of the file author.'),\n );\n $targets['node_usage'] = array(\n 'name' => t('File usage (node) by Feeds GUID'),\n 'description' => t('The list of nodes that use a file.'),\n 'optional_unique' => TRUE,\n );\n $targets['term_usage'] = array(\n 'name' => t('File usage (term) by Feeds GUID'),\n 'description' => t('The list of terms that use a file.'),\n 'optional_unique' => TRUE,\n );\n\n // Let other modules expose mapping targets.\n self::loadMappers();\n $entity_type = $this->entityType();\n $bundle = $this->config['bundle'] ? $this->config['bundle'] : FILE_TYPE_NONE;\n drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle);\n\n return $targets;\n }", "public static function getMap()\n { \n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ID_FIELD'),\n ),\n 'DATE_CHANGE' => array(\n 'data_type' => 'datetime',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CHANGE_FIELD'),\n ),\n 'DATE_CREATE' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CREATE_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ACTIVE_FIELD'),\n ),\n 'SORT' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_SORT_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateName'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_NAME_FIELD'),\n ),\n 'DESCRIPTION' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DESCRIPTION_FIELD'),\n ),\n 'PARENT_CATEGORY_ID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_PARENT_CATEGORY_ID_FIELD'),\n ), \n );\n }", "public function getIndexMapping(): Mapping\n {\n return (new SupplierMapping());\n }", "protected function set_mappers() {\n\t\t//Simple product mapping\n\t\t$this->generator->addMapper(\n\t\t\tfunction (\n\t\t\t\tarray $sf_product, \\ShoppingFeed\\Feed\\Product\\Product $product\n\t\t\t) {\n\t\t\t\t$sf_product = reset( $sf_product );\n\t\t\t\t/** @var Product $sf_product */\n\t\t\t\t$product->setReference( $sf_product->get_sku() );\n\t\t\t\t$product->setName( $sf_product->get_name() );\n\t\t\t\t$product->setPrice( $sf_product->get_price() );\n\n\t\t\t\tif ( ! empty( $sf_product->get_ean() ) ) {\n\t\t\t\t\t$product->setGtin( $sf_product->get_ean() );\n\t\t\t\t}\n\n\t\t\t\t$product->setQuantity( $sf_product->get_quantity() );\n\n\t\t\t\tif ( ! empty( $sf_product->get_link() ) ) {\n\t\t\t\t\t$product->setLink( $sf_product->get_link() );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $sf_product->get_discount() ) ) {\n\t\t\t\t\t$product->addDiscount( $sf_product->get_discount() );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $sf_product->get_image_main() ) ) {\n\t\t\t\t\t$product->setMainImage( $sf_product->get_image_main() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_full_description() ) || ! empty( $sf_product->get_short_description() ) ) {\n\t\t\t\t\t$product->setDescription( $sf_product->get_full_description(), $sf_product->get_short_description() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_brand_name() ) ) {\n\t\t\t\t\t$product->setBrand( $sf_product->get_brand_name(), $sf_product->get_brand_link() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_weight() ) ) {\n\t\t\t\t\t$product->setWeight( $sf_product->get_weight() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_category_name() ) ) {\n\t\t\t\t\t$product->setCategory( $sf_product->get_category_name(), $sf_product->get_category_link() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_attributes() ) ) {\n\t\t\t\t\t$product->setAttributes( $sf_product->get_attributes() );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $sf_product->get_shipping_methods() ) ) {\n\t\t\t\t\tforeach ( $sf_product->get_shipping_methods() as $shipping_method ) {\n\t\t\t\t\t\t$product->addShipping( $shipping_method['cost'], $shipping_method['description'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$images = $sf_product->get_images();\n\t\t\t\tif ( ! empty( $images ) ) {\n\t\t\t\t\t$product->setAdditionalImages( $sf_product->get_images() );\n\t\t\t\t}\n\n\t\t\t\t$extra_fields = $sf_product->get_extra_fields();\n\t\t\t\tif ( ! empty( $extra_fields ) ) {\n\t\t\t\t\tforeach ( $extra_fields as $field ) {\n\t\t\t\t\t\tif ( empty( $field['name'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$product->setAttribute( $field['name'], $field['value'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t);\n\n\t\t//Product with variations mapping\n\t\t$this->generator->addMapper(\n\t\t\tfunction (\n\t\t\t\tarray $sf_product, \\ShoppingFeed\\Feed\\Product\\Product $product\n\t\t\t) {\n\t\t\t\t$sf_product = reset( $sf_product );\n\t\t\t\t/** @var Product $sf_product */\n\n\t\t\t\tif ( empty( $sf_product->get_variations() ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach ( $sf_product->get_variations() as $sf_product_variation ) {\n\t\t\t\t\t$variation = $product->createVariation();\n\n\t\t\t\t\t$variation\n\t\t\t\t\t\t->setReference( $sf_product_variation['sku'] )\n\t\t\t\t\t\t->setPrice( $sf_product_variation['price'] )\n\t\t\t\t\t\t->setQuantity( $sf_product_variation['quantity'] )\n\t\t\t\t\t\t->setGtin( $sf_product_variation['ean'] );\n\n\t\t\t\t\tif ( ! empty( $sf_product_variation['attributes'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->setAttributes( $sf_product_variation['attributes'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $sf_product_variation['discount'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->addDiscount( $sf_product_variation['discount'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $sf_product_variation['image_main'] ) ) {\n\t\t\t\t\t\t$variation\n\t\t\t\t\t\t\t->setMainImage( $sf_product_variation['image_main'] );\n\t\t\t\t\t}\n\t\t\t\t\t$variation_images = $sf_product->get_variation_images( $sf_product_variation['id'] );\n\t\t\t\t\tif ( ! empty( $variation_images ) ) {\n\t\t\t\t\t\t$variation->setAdditionalImages( $variation_images );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "protected function getDefaultMapping()\n\t{\n\t\treturn array(\n\t\t\t'subscription' => array(\n\t\t\t\t2 => 'subscription.interval',\n\t\t\t\t3 => 'subscription.datenext',\n\t\t\t\t4 => 'subscription.dateend',\n\t\t\t),\n\t\t\t'address' => array(\n\t\t\t\t2 => 'subscription.base.address.type',\n\t\t\t\t3 => 'subscription.base.address.salutation',\n\t\t\t\t4 => 'subscription.base.address.company',\n\t\t\t\t5 => 'subscription.base.address.vatid',\n\t\t\t\t6 => 'subscription.base.address.title',\n\t\t\t\t7 => 'subscription.base.address.firstname',\n\t\t\t\t8 => 'subscription.base.address.lastname',\n\t\t\t\t9 => 'subscription.base.address.address1',\n\t\t\t\t10 => 'subscription.base.address.address2',\n\t\t\t\t11 => 'subscription.base.address.address3',\n\t\t\t\t12 => 'subscription.base.address.postal',\n\t\t\t\t13 => 'subscription.base.address.city',\n\t\t\t\t14 => 'subscription.base.address.state',\n\t\t\t\t15 => 'subscription.base.address.countryid',\n\t\t\t\t16 => 'subscription.base.address.languageid',\n\t\t\t\t17 => 'subscription.base.address.telephone',\n\t\t\t\t18 => 'subscription.base.address.telefax',\n\t\t\t\t19 => 'subscription.base.address.email',\n\t\t\t\t20 => 'subscription.base.address.website',\n\t\t\t\t21 => 'subscription.base.address.longitude',\n\t\t\t\t22 => 'subscription.base.address.latitude',\n\t\t\t),\n\t\t\t'product' => array(\n\t\t\t\t2 => 'subscription.base.product.type',\n\t\t\t\t3 => 'subscription.base.product.stocktype',\n\t\t\t\t4 => 'subscription.base.product.suppliercode',\n\t\t\t\t5 => 'subscription.base.product.prodcode',\n\t\t\t\t6 => 'subscription.base.product.productid',\n\t\t\t\t7 => 'subscription.base.product.quantity',\n\t\t\t\t8 => 'subscription.base.product.name',\n\t\t\t\t9 => 'subscription.base.product.mediaurl',\n\t\t\t\t10 => 'subscription.base.product.price',\n\t\t\t\t11 => 'subscription.base.product.costs',\n\t\t\t\t12 => 'subscription.base.product.rebate',\n\t\t\t\t13 => 'subscription.base.product.taxrate',\n\t\t\t\t14 => 'subscription.base.product.status',\n\t\t\t\t15 => 'subscription.base.product.position',\n\t\t\t\t16 => 'subscription.base.product.attribute.type',\n\t\t\t\t17 => 'subscription.base.product.attribute.code',\n\t\t\t\t18 => 'subscription.base.product.attribute.name',\n\t\t\t\t19 => 'subscription.base.product.attribute.value',\n\t\t\t),\n\t\t);\n\t}", "final public static function classMap()\n {\n return array (\n 'KAMODeparture' => 'HslOnnelaStructKAMODeparture',\n 'KAMOLine' => 'HslOnnelaStructKAMOLine',\n 'KAMOStop' => 'HslOnnelaStructKAMOStop',\n);\n }", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ID_FIELD'),\n ),\n 'TIMESTAMP_X' => new Main\\Entity\\DatetimeField('TIMESTAMP_X', array(\n 'default_value' => new Main\\Type\\DateTime(),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_TIMESTAMP_X_FIELD'),\n )),\n 'LID' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateLid'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_LID_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_FIELD'),\n ),\n 'BONUS' => array(\n 'data_type' => 'float',\n 'required' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_BONUS_FIELD'),\n ),\n 'USERID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_USERID_FIELD'),\n ),\n 'ACTIVE_FROM' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_FROM_FIELD'),\n ),\n 'ACTIVE_TO' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_ACTIVE_TO_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_NAME_FIELD'),\n ),\n 'PROMOCODE' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validatePromocode'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_PROMOCODE_FIELD'),\n ),\n 'DOMAINE' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateDomaine'),\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_DOMAINE_FIELD'),\n ),\n 'URL' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_URL_FIELD'),\n ),\n 'COMMISIA' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_COMMISIA_FIELD'),\n ),\n 'COMMISIAPROMO' => array(\n 'data_type' => 'string',\n 'title' => Loc::getMessage('AFFILIATE_ENTITY_COMMISIAPROMO_FIELD'),\n ),\n );\n }", "private function map(): \\Generator\n {\n $path = realpath($this->path) . '/composer/autoload_psr4.php';\n\n if (file_exists($path) && is_array($map = require $path)) {\n yield from $map;\n }\n }", "public static function getMap()\n\t{\n\t\treturn [\n\n\t\t\t(new Fields\\IntegerField('ADDRESS_ID'))\n\t\t\t\t->configurePrimary(true),\n\n\t\t\t(new Fields\\StringField('ENTITY_ID'))\n\t\t\t\t->configurePrimary(true)\n\t\t\t\t->addValidator(new Main\\ORM\\Fields\\Validators\\LengthValidator(1, 100)),\n\n\t\t\t// todo: int\n\t\t\t(new Fields\\StringField('ENTITY_TYPE'))\n\t\t\t\t->configurePrimary(true)\n\t\t\t\t->addValidator(new Main\\ORM\\Fields\\Validators\\LengthValidator(1, 50)),\n\n\t\t\t// Ref\n\n\t\t\t(new Fields\\Relations\\Reference('ADDRESS', AddressTable::class,\n\t\t\t\tJoin::on('this.ADDRESS_ID', 'ref.ID')))\n\t\t\t\t->configureJoinType('inner')\n\t\t];\n\t}", "public static function updateMapping(){\r\n $db = self::getDb();\r\n $command = $db->createCommand();\r\n\t\tif(!$command->indexExists(self::index())){\r\n\t\t\t$command->createIndex(self::index());\r\n\t\t}\r\n $command->setMapping(self::index(), self::type(), self::mapping());\r\n }", "public function getMapper(){ \n $mapper = new Frota_Model_Veiculo_Mapper();\n return $mapper;\n }", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_ID_FIELD'),\n ),\n 'USER_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validateUser'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_USER_ID_FIELD'),\n ),\n 'ELEMENT_CODE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateElementCode'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_ELEMENT_CODE_FIELD'),\n ),\n 'TITLE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateTitle'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_TITLE_FIELD'),\n ),\n 'PASSWORD_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validatePassword'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_PASSWORD_ID_FIELD'),\n ),\n 'APP_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validateApp'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APP_ID_FIELD'),\n ),\n 'SCOPE' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_SCOPE_FIELD'),\n ),\n 'QUERY' => array(\n 'data_type' => 'text',\n 'serialized' => true,\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_QUERY_FIELD'),\n ),\n 'OUTGOING_EVENTS' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_EVENTS_FIELD'),\n ),\n 'OUTGOING_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateOutgoingQueryNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_NEEDED_FIELD'),\n ),\n 'OUTGOING_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateOutgoingHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_HANDLER_URL_FIELD'),\n ),\n 'WIDGET_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateWidgetNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_NEEDED_FIELD'),\n ),\n 'WIDGET_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateWidgetHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_HANDLER_URL_FIELD'),\n ),\n 'WIDGET_LIST' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_LIST_FIELD'),\n ),\n 'APPLICATION_TOKEN' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationToken'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_TOKEN_FIELD'),\n ),\n 'APPLICATION_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_NEEDED_FIELD'),\n ),\n 'APPLICATION_ONLY_API' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationOnlyApi'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_ONLY_API_FIELD'),\n ),\n 'BOT_ID' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_BOT_ID_FIELD'),\n ),\n 'BOT_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateBotHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_BOT_HANDLER_URL_FIELD'),\n ),\n 'USER' => new ReferenceField(\n 'USER',\n '\\Bitrix\\Main\\UserTable',\n array('=this.USER_ID' => 'ref.ID')\n ),\n );\n }", "public function getRegisteredMappingOperations(): array;", "public function getDataMapping() {\n return [\n 'firstName' => 'firstName',\n 'lastName' => 'lastName',\n 'email' => 'email',\n 'address' => [\n 'street1' => 'street1',\n 'street2' => 'street2',\n 'city' => 'city',\n 'state' => 'state',\n 'zip' => 'zip'\n ],\n 'phone' => 'phone',\n 'payment' => [\n 'ccNum' => 'cc_number',\n 'exp' => 'cc_expiration',\n ],\n 'quantity' => 'qty',\n 'total' => 'total'\n ];\n }", "protected function generateMisc()\n {\n //We need to generate both a forward and reverse bank, followed by proper wrappers.\n\n $php = \"<?php\\n\";\n $php .= \"namespace GCWorld\\\\Routing\\\\Generated\\\\{$this->name};\\n\";\n $php .= \"\\n\";\n $php .= \"class MasterRoute_MISC Implements \\\\GCWorld\\\\Routing\\\\Interfaces\\\\RoutesInterface\\n\";\n $php .= \"{\\n\";\n\n //Get File Time Function\n $php .= \" public function getFileTime()\\n\";\n $php .= \" {\\n\";\n $php .= \" return filemtime(__FILE__);\\n\";\n $php .= \" }\\n\\n\";\n\n //Get Forward Routes Function\n $php .= \" public function getForwardRoutes()\\n\";\n $php .= \" {\\n\";\n $php .= \" return [\\n\";\n foreach ($this->routes_straight as $k => $v) {\n $temp = explode('/', $k);\n if (in_array($temp[1], $this->routes_master)) {\n continue;\n }\n $cEncoder = new PHPEncoder();\n $encoded = $cEncoder->encode($v, [\n 'array.base' => 12,\n 'array.inline' => false,\n 'array.omit' => false,\n 'array.align' => true,\n 'array.indent' => 4,\n 'boolean.capitalize' => true,\n 'null.capitalize' => true,\n ]);\n $php .= \" '$k' => \".$encoded.\",\\n\";\n }\n $php .= \" ];\\n\";\n $php .= \" }\\n\\n\";\n\n\n //Get Reverse Routes Function\n $php .= \" public function getReverseRoutes()\\n\";\n $php .= \" {\\n\";\n $php .= \" return [\\n\";\n foreach ($this->routes_reverse as $k => $v) {\n $temp = explode('_', $k);\n if (in_array($temp[0], $this->routes_master)) {\n continue;\n }\n $cEncoder = new PHPEncoder();\n $encoded = $cEncoder->encode($v, [\n 'array.base' => 12,\n 'array.inline' => false,\n 'array.omit' => false,\n 'array.align' => true,\n 'array.indent' => 4,\n 'boolean.capitalize' => true,\n 'null.capitalize' => true,\n ]);\n $php .= \" '$k' => \".$encoded.\",\\n\";\n }\n $php .= \" ];\\n\";\n $php .= \" }\\n\\n\";\n\n //End of file\n $php .= \"}\\n\";\n\n file_put_contents($this->storage.'MasterRoute_MISC.php', $php);\n }", "public function getGeneratedInterface() {\n\t\t\treturn 'I'.ucfirst($this->name).'Adapter';\t\n\t\t}", "protected function getMap()\n {\n return config('codegenerator.eloquent_type_to_html_type');\n }", "public static function mappings()\n {\n $map = [\n 'category' => Category::get()->pluck('name', 'slug')->toArray(),\n 'style' => Style::get()->pluck('name')->toArray(),\n 'technic' => Technic::get()->pluck('name')->toArray(),\n ];\ndd($map);\n\n return $map;\n }", "public static function mapper(){\n return new Mapper;\n }", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "public function generate()\n {\n $interfacesData = json_decode($this->json, true);\n foreach ($interfacesData as $interface) {\n $filename = $interface['name'] . '.java';\n $interfaceObject = new JAVAInterfaceObject();\n $interfaceObject->setName($interface['name']);\n foreach ($interface['methods'] as $method) {\n $methodObject = new JAVAMethod();\n $methodObject->setName($method['name']);\n $methodObject->setReturnValue($method['returnType']);\n $methodObject->setScope($method['scope']);\n $methodObject->setComment($method['comment']);\n foreach ($method['parameters'] as $parameter) {\n $parameterObject = new Parameter();\n $parameterObject->setName($parameter['name']);\n $parameterObject->setType($parameter['type']);\n $methodObject->addParameter($parameterObject);\n }\n foreach ($method['annotations'] as $annotation) {\n $annotationObject = new Annotation();\n $annotationObject->setName($annotation['name']);\n $annotationObject->setValue($annotation['value']);\n $annotationObject->setInterpreter('@');\n $methodObject->addAnnotation($annotationObject);\n }\n $interfaceObject->addMethod($methodObject);\n \n }\n file_put_contents($this->folder . DIRECTORY_SEPARATOR . $filename, $interfaceObject->toString());\n }\n }", "function xh_templateMapping($name)\r\n\t{\r\n\t}", "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public function setMapping(Mapping $mapping);", "abstract public function generate();", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\IntegerField(\n\t\t\t\t'ID',\n\t\t\t\tarray(\n\t\t\t\t 'autocomplete' => true,\n\t\t\t\t 'primary' => true,\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\IntegerField('ORDER_ID'),\n\n\t\t\tnew Main\\Entity\\StringField(\n\t\t\t\t'ENTITY_TYPE',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 25,\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\IntegerField('ENTITY_ID'),\n\n\t\t\tnew Main\\Entity\\StringField(\n\t\t\t\t'TYPE',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 10,\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\StringField(\n\t\t\t\t'CODE',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 255,\n\t\t\t\t\t'validation' => array(__CLASS__, 'validateComment')\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\StringField(\n\t\t\t\t'MESSAGE',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 255,\n\t\t\t\t\t'validation' => array(__CLASS__, 'validateMessage')\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\StringField(\n\t\t\t\t'COMMENT',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 500,\n\t\t\t\t\t'validation' => array(__CLASS__, 'validateComment')\n\t\t\t\t)\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\IntegerField('USER_ID'),\n\n\t\t\tnew Main\\Entity\\DatetimeField(\n\t\t\t\t'DATE_CREATE'\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\DatetimeField(\n\t\t\t\t'DATE_UPDATE'\n\t\t\t),\n\n\t\t\tnew Main\\Entity\\BooleanField(\n\t\t\t\t'SUCCESS',\n\t\t\t\tarray(\n\t\t\t\t\t'size' => 1,\n\t\t\t\t\t'validation' => array(__CLASS__, 'validateSuccess')\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}", "public function getCidToGidMap() {}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public static function attributeMap();", "public static function getMap()\n {\n return [\n (new Fields\\StringField('HASH'))\n ->configurePrimary(true),\n\n new Fields\\IntegerField('RELIABILITY'),\n new Fields\\StringField('ADDRESS'),\n new Fields\\StringField('FULL_NAME'),\n new Fields\\StringField('PHONE'),\n new Fields\\DatetimeField('UPDATED_AT')\n ];\n }", "protected function property_map() { return array(); }", "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "public function getCidMap() {}", "protected function getMapping() : array\n {\n return [\n 'defaultValue' => [\n 'get' => 'config.hasDefaultValue() ? config.getDefaultValue() : null',\n 'set' => 'array[\"hasDefaultValue\"] ? config.setDefaultValue(array[\"defaultValue\"]) : \"\"',\n 'types' => []\n ],\n 'hasDefaultValue' => [\n 'get' => 'config.hasDefaultValue()',\n 'set' => 'null',\n 'types' => ['bool']\n ],\n 'description' => [\n 'get' => 'config.getDescription()',\n 'set' => 'config.setDescription(array[\"description\"])',\n 'types' => ['string', 'null']\n ],\n 'requiredState' => [\n 'get' => 'config.isRequired()',\n 'set' => 'array[\"requiredState\"] ? config.setRequired() : config.setUnRequired()',\n 'types' => ['bool']\n ]\n ];\n }", "public function getIndexMappings(): array\n {\n $mappings = [];\n\n foreach (Utilities::getIndexables() as $class) {\n\n $indexable = new $class;\n\n $typeName = $indexable->getDocumentType();\n\n foreach ($indexable->getDocumentMappings() as $attribute => $map) {\n\n if ($indexable->isIndexableRelation($attribute)) {\n $map['properties'] = $indexable\n ->getDocumentRelation($attribute)\n ->getDocumentMappings();\n }\n\n $mappings[$typeName]['properties'][$attribute] = $map;\n }\n }\n\n return array_merge(Utilities::config('mappings'), $mappings);\n }", "private function maper(){\n\n\t\t$map = [];\n\n\t\tforeach($this::$tables as $table ){\n\n\t\t\t$tmp = explode(\"_\",$table);\n\n\t\t\tfor($i=0;$i<count($tmp);$i++){\n\n\t\t\t\t$tmp2 = array_slice($tmp,0,$i+1);\n\n\t\t\t\teval ('if(@ $map[\"'.implode('\"][\"',$tmp2).'\"]) true; else $map[\"'.implode('\"][\"',$tmp2).'\"]=[];');\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $map;\n\n\t}", "public function map($mapper);", "public static function setMappings()\n {\n $command = static::getDb()->createCommand();\n foreach (static::$languages as $lang => $analyzer) {\n $index = static::index() . \"-$lang\";\n if (!$command->indexExists($index)) {\n $command->createIndex($index);\n $command->setMapping($index, static::type(), [\n static::type() => [\n 'properties' => [\n 'version' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'language' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'name' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'type' => ['type' => 'string', 'index' => 'not_analyzed'],\n\n 'title' => [\n 'type' => 'string',\n // sub-fields added for language\n 'fields' => [\n 'stemmed' => [\n 'type' => 'string',\n 'analyzer' => $analyzer,\n ],\n ],\n ],\n 'body' => [\n 'type' => 'string',\n // sub-fields added for language\n 'fields' => [\n 'stemmed' => [\n 'type' => 'string',\n 'analyzer' => $analyzer,\n ],\n ],\n ],\n ]\n ]\n ]);\n $command->flushIndex(static::index());\n }\n }\n }", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(ApInvoiceTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(ApInvoiceTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new ApInvoiceTableMap());\n }\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function mappings()\n {\n return [\n 'title' => 'title',\n ];\n }", "public function getMapper(){ \n $mapper = new Ca_Model_RegraContrato_Mapper();\n return $mapper;\n }", "public function withDefaultOperation(MappingOperationInterface $mappingOperation): MappingInterface;", "public function getMapping($reverse = false, $reload = false);" ]
[ "0.7793871", "0.7234115", "0.7234115", "0.71539325", "0.6569726", "0.65337193", "0.65337193", "0.6517583", "0.6456219", "0.6407931", "0.6259392", "0.6151972", "0.6140589", "0.6105953", "0.6102349", "0.60996383", "0.6097243", "0.59908086", "0.596343", "0.59066767", "0.5870676", "0.58666295", "0.58333385", "0.58237576", "0.5810703", "0.57519275", "0.57327574", "0.572232", "0.57148635", "0.56942856", "0.569278", "0.5691916", "0.569122", "0.5689416", "0.56860876", "0.56811863", "0.5677898", "0.56182724", "0.5606363", "0.56011456", "0.5598888", "0.5590789", "0.5588237", "0.55868566", "0.5584235", "0.5575115", "0.5563204", "0.55539364", "0.55455244", "0.55379456", "0.5514509", "0.55113006", "0.5509944", "0.55045813", "0.5486968", "0.5481302", "0.5480844", "0.54770035", "0.54743063", "0.5464385", "0.54630613", "0.5461277", "0.54539025", "0.5442586", "0.5441435", "0.5425774", "0.542253", "0.54178905", "0.5413142", "0.5412428", "0.53962934", "0.53882164", "0.53810525", "0.5380459", "0.53768444", "0.53662324", "0.53621525", "0.53552437", "0.5353894", "0.5353894", "0.53446376", "0.53375435", "0.53336126", "0.5328874", "0.5326446", "0.5322072", "0.53178656", "0.53123903", "0.53119075", "0.53083193", "0.5304067", "0.5299762", "0.52991337", "0.5299001", "0.5291982", "0.5283887", "0.52834463", "0.528341", "0.52815026", "0.5277974", "0.52777" ]
0.0
-1
Generate the adapter code
public function GenerateAdapter() { $this->writeLine( 'class '.$this->getClassName() ); $this->writeLine( 'extends '.$this->getExtends() ); $this->writeLine('implements '); $this->writeLine( implode(', ', $this->getImplements()) ); $this->writeLine('{'); $this->writeLine( 'public static $adapter = \''.$this->name.'\';' ); $this->writeLine('public function __construct() {'); $this->writeLine('parent::__construct(\''.$this->name.'\');'); $this->writeLine('}'); if (isset($this->select_one)) foreach($this->select_one as $rq) $rq->toPhp(true); if (isset($this->select)) foreach($this->select as $rq) $rq->toPhp(true); if (isset($this->insert)) foreach($this->insert as $rq) $rq->toPhp(true); if (isset($this->update)) foreach($this->update as $rq) $rq->toPhp(true); if (isset($this->delete)) foreach($this->delete as $rq) $rq->toPhp(true); $this->writeLine('}'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGeneratedInterface() {\n\t\t\treturn 'I'.ucfirst($this->name).'Adapter';\t\n\t\t}", "abstract protected function createAdapter();", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function generateInitCode();", "public function getAdapter();", "public function getAdapter();", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generateExtensionLoader()\n {\n $this->outFiles['extension_loader_interface'] = [\n 'file' => $this->classes['extension_loader_interface']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/ExtensionLoaderInterface', [\n 'namespace' => $this->classes['extension_loader_interface']['info']['namespace'],\n 'class' => $this->classes['extension_loader_interface']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n 'entity_var' => $this->entityVar,\n 'entity_name' => $this->entityName,\n ]),\n ];\n\n $extensionFactory = preg_replace('/Interface$/', 'ExtensionFactory', $this->classes['data_interface']['class']);\n\n $this->outFiles['extension_loader'] = [\n 'file' => $this->classes['extension_loader']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/ExtensionLoader', [\n 'namespace' => $this->classes['extension_loader']['info']['namespace'],\n 'class' => $this->classes['extension_loader']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n 'entity_var' => $this->entityVar,\n 'entity_name' => $this->entityName,\n 'extension_factory' => $extensionFactory,\n 'extension_loader_interface' => $this->classes['extension_loader_interface']['class'],\n ]),\n ];\n }", "public function getAdapterMethod();", "public function generate()\n {\n return parent::generate();\n }", "function _generate($instance) {\n $output = $this->CI->ciwy->datasource->_generate($this->CI->ciwy->component_config[$instance]['dataSourceInstance']); // Because datasource code is generated here we need to avoid dual code generation (see below)\n\n $output .= ' var ' . $instance . ' = new YAHOO.widget.AutoComplete(\"' . $this->CI->ciwy->component_config[$instance]['inputAttributes']['name'] . '\", \"';\n $output .= $this->CI->ciwy->component_config[$instance]['containerId'] . '\", ';\n $output .= $this->CI->ciwy->component_config[$instance]['dataSourceInstance'];\n $output .= ');' . $this->new_line;\n if (count($this->CI->ciwy->component_config[$instance]['Config']) > 0) {\n foreach ($this->CI->ciwy->component_config[$instance]['Config'] as $key => $val) {\n $output .= ' ' . $instance . '.' . $key . str_repeat(' ', 24 - strlen($key)) . ' = ' . $this->CI->ciwy->_property_wrapper($val, $this->component_property[$key]) . ';' . $this->new_line;\n }\n }\n unset ($this->CI->ciwy->component_instances[$this->CI->ciwy->component_config[$instance]['dataSourceInstance']]); // Avoid dual code generation for data source\n return $output;\n }", "public static function getCodeGenerator() {\n return new Q\\Codegen\\Generator\\Label(__CLASS__);\n }", "public function createAdapter() : AdapterInterface;", "abstract protected function doGetAdapter();", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function generateSampleCode() {\n\t\t$sampleCode = new SampleCode();\n\t\treturn array($sampleCode);\n\t}", "abstract public function generate();", "public function GenerateInterface($name = null) {\n\t\t\tif (!$name) $name = $this->getGeneratedInterface(); \n\t\t\t$this->writeLine('interface '.$name.' {'); \n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->writeSignature(true); \n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->writeSignature(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->writeSignature(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->writeSignature(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->writeSignature(true); \n $this->writeLine('}');\n }", "public function generate()\n\t{\n\t\t$entityName = mb_strtolower($this->getEntityName());\n\n\t\t$entityDir = Yii::getAlias(self::PATH_TO_MODULE . '/' . $entityName);\n\n\t\tif (!is_dir($entityDir) && !mkdir($entityDir) && !is_dir($entityDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$entityDir}\");\n\t\t}\n\n\t\t$entityTableFilePath = \"{$entityDir}/{$entityName}.php\";\n\n\t\t$files = [\n\t\t\tnew CodeFile($entityTableFilePath, $this->render('table.php')),\n\t\t];\n\n\t\t$helpersDir = __DIR__ . '/default/admininterface';\n\n\t\tif (!is_dir($helpersDir) && !mkdir($helpersDir) && !is_dir($helpersDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$helpersDir}\");\n\t\t}\n\n\t\tforeach ($dirs = scandir($helpersDir, null) as $file) {\n\t\t\tif ($file === '.' || $file === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$templateFilePath = $helpersDir . '/' . $file;\n\t\t\t$codeFilePath = $entityDir . '/admininterface/' . $entityName . $file;\n\t\t\tif (is_file($templateFilePath) && pathinfo($templateFilePath, PATHINFO_EXTENSION) === 'php') {\n\t\t\t\t$files[] = new CodeFile($codeFilePath, $this->render(\"admininterface/$file\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function generate()\n {\n $interfacesData = json_decode($this->json, true);\n foreach ($interfacesData as $interface) {\n $filename = $interface['name'] . '.java';\n $interfaceObject = new JAVAInterfaceObject();\n $interfaceObject->setName($interface['name']);\n foreach ($interface['methods'] as $method) {\n $methodObject = new JAVAMethod();\n $methodObject->setName($method['name']);\n $methodObject->setReturnValue($method['returnType']);\n $methodObject->setScope($method['scope']);\n $methodObject->setComment($method['comment']);\n foreach ($method['parameters'] as $parameter) {\n $parameterObject = new Parameter();\n $parameterObject->setName($parameter['name']);\n $parameterObject->setType($parameter['type']);\n $methodObject->addParameter($parameterObject);\n }\n foreach ($method['annotations'] as $annotation) {\n $annotationObject = new Annotation();\n $annotationObject->setName($annotation['name']);\n $annotationObject->setValue($annotation['value']);\n $annotationObject->setInterpreter('@');\n $methodObject->addAnnotation($annotationObject);\n }\n $interfaceObject->addMethod($methodObject);\n \n }\n file_put_contents($this->folder . DIRECTORY_SEPARATOR . $filename, $interfaceObject->toString());\n }\n }", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}", "private function initializeExtbuilder() {\n $this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n $this->classParser = t3lib_div::makeInstance('Tx_ExtensionBuilder_Utility_ClassParser');\n\t\t$this->roundTripService = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_RoundTrip');\n\t\t$this->classBuilder = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_ClassBuilder');\n\t\t$this->templateParser =t3lib_div::makeInstance('Tx_Fluid_Core_Parser_TemplateParser');\n\t\t$this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n\t\t$this->codeGenerator->setSettings(array(\n\t\t\t\t'codeTemplateRootPath' => PATH_typo3conf.'ext/extension_builder/Resources/Private/CodeTemplates/Extbase/',\n ));\n\n if (class_exists('Tx_Extbase_Object_ObjectManager')) {\n\t\t\t$this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');\n\t\t\t$this->codeGenerator->injectObjectManager($this->objectManager);\n\t\t\t$this->templateParser->injectObjectManager($this->objectManager);\n\t\t}\n\n\t\t$this->roundTripService->injectClassParser($this->classParser);\n\t\t$this->classBuilder->injectRoundtripService($this->roundTripService);\n\t\t$this->codeGenerator->injectTemplateParser($this->templateParser);\n\t\t$this->codeGenerator->injectClassBuilder($this->classBuilder);\n }", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function getGeneratedCode()\n {\n $adminClass = $this->getAdminClassName();\n if (class_exists($adminClass)) {\n throw new \\Exception('Impossible to generate. Class ' . $adminClass . ' already exists.');\n }\n $namespaceParts = explode('\\\\', $adminClass);\n if (isset($namespaceParts[0]) && $namespaceParts[0] == '') {\n array_shift($namespaceParts);\n }\n\n return $this->getTemplating()->render('MaxmodeGeneratorBundle:Sonata:Admin/class.php.twig', array(\n 'className' => array_pop($namespaceParts),\n 'namespace' => implode('\\\\', $namespaceParts),\n 'entityClass' => $this->getEntityItem()->getItemClassName(),\n 'editFields' => $this->prepareFieldList($this->_editFields),\n 'listFields' => $this->prepareFieldList($this->_listFields),\n 'maxLineLength' => self::MAX_LINE_LENGTH,\n ));\n }", "public function generate()\n {\n $soapClientOptions = $this->getSoapClientOptions();\n $config = $this->getGeneratorConfig($soapClientOptions);\n $generator = $this->getGenerator();\n $generator->generate($config);\n }", "public function getAdapter()\r\n {\r\n }", "public function generateCommands();", "public function getClassName() {\n if (isset($this->generate_as)) {\n return $this->generate_as;\n } else return ucfirst($this->name).'AdapterImpl';\n }", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "function getAdapterName();", "function iterateur_php_dist($b, $iteratorName) {\n\t$b->iterateur = $iteratorName; # designe la classe d'iterateur\n\t$b->show = array(\n\t\t'field' => array(\n\t\t\t'cle' => 'STRING',\n\t\t\t'valeur' => 'STRING',\n\t\t)\n\t);\n\tforeach (get_class_methods($iteratorName) as $method) {\n\t\t$b->show['field'][ strtolower($method) ] = 'METHOD';\n\t}\n\t/*\n\tforeach (get_class_vars($iteratorName) as $property) {\n\t\t$b->show['field'][ strtolower($property) ] = 'PROPERTY';\n\t}\n\t*/\n\treturn $b;\n}", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "private function _model_generation()\n\t{\n\t\t$prefix = ($this->bundle == DEFAULT_BUNDLE) ? '' : Str::classify($this->bundle).'_';\n\n\t\t// set up the markers for replacement within source\n\t\t$markers = array(\n\t\t\t'#CLASS#'\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t'#LOWER#'\t\t=> $this->lower,\n\t\t\t'#TIMESTAMPS#'\t=> $this->_timestamps\n\t\t);\n\n\t\t// loud our model template\n\t\t$template = Utils::load_template('model/model.tpl');\n\n\t\t// holder for relationships source\n\t\t$relationships_source = '';\n\n\t\t// loop through our relationships\n\t\tforeach ($this->arguments as $relation)\n\t\t{\t\n\n\t\t\t// if we have a valid relation\n\t\t\tif(strstr($relation, ':')) :\n\n\t\t\t\t// split\n\t\t\t\t$relation_parts = explode(':', Str::lower($relation));\n\n\t\t\t\t// we need two parts\n\t\t\t\tif(! count($relation_parts) == 2) continue;\n\n\t\t\t\t$method = $this->method($relation_parts[1]);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#CLASS#'\t\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t\t\t'#SINGULAR#'\t\t=> Str::lower(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#PLURAL#'\t\t\t=> Str::lower(Str::plural($relation_parts[1])),\n\t\t\t\t\t'#METHOD#'\t\t\t=> $method,\n\t\t\t\t\t'#WORD#'\t\t\t=> Str::classify(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#WORDS#'\t\t\t=> Str::classify(Str::plural($relation_parts[1]))\n\t\t\t\t);\n\n\t\t\t\t// start with blank\n\t\t\t\t$relationship_template = '';\n\n\t\t\t\t// use switch to decide which template\n\t\t\t\tswitch ($relation_parts[0])\n\t\t\t\t{\n\t\t\t\t\tcase \"has_many\":\n\t\t\t\t\tcase \"hm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"belongs_to\":\n\t\t\t\t\tcase \"bt\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_one\":\n\t\t\t\t\tcase \"ho\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_one.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_many_and_belongs_to\":\n\t\t\t\t\tcase \"hbm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many_and_belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\telse:\n\n\t\t\t\t$method = $this->method($relation);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#METHOD#'\t\t=> $method,\n\t\t\t\t);\n\n\t\t\t\t$relationship_template = Utils::load_template('model/method.tpl');\n\n\t\t\tendif;\t\n\n\t\t\t// add it to the source\n\t\t\t$relationships_source .= Utils::replace_markers($rel_markers, $relationship_template);\n\t\t}\n\n\t\t// add a marker to replace the relationships stub\n\t\t// in the model template\n\t\t$markers['#RELATIONS#'] = $relationships_source;\n\n\t\t// add the generated model to the writer\n\t\t$this->writer->create_file(\n\t\t\t'Model',\n\t\t\t$prefix.$this->class_prefix.$this->class,\n\t\t\t$this->bundle_path.'models/'.$this->class_path.$this->lower.EXT,\n\t\t\tUtils::replace_markers($markers, $template)\n\t\t);\n\t}", "protected function _generate()\n {\n $filters = $this->_params['storage']\n ->retrieve(Ingo_Storage::ACTION_FILTERS);\n\n $this->_addItem(Ingo::RULE_ALL, new Ingo_Script_Procmail_Comment(_(\"procmail script generated by Ingo\") . ' (' . date('F j, Y, g:i a') . ')'));\n\n if (isset($this->_params['forward_file']) &&\n isset($this->_params['forward_string'])) {\n $this->_addItem(\n Ingo::RULE_ALL,\n new Ingo_Script_String($this->_params['forward_string']),\n $this->_params['forward_file']\n );\n }\n\n /* Add variable information, if present. */\n if (!empty($this->_params['variables']) &&\n is_array($this->_params['variables'])) {\n foreach ($this->_params['variables'] as $key => $val) {\n $this->_addItem(Ingo::RULE_ALL, new Ingo_Script_Procmail_Variable(array('name' => $key, 'value' => $val)));\n }\n }\n\n foreach ($filters->getFilterList($this->_params['skip']) as $filter) {\n switch ($filter['action']) {\n case Ingo_Storage::ACTION_BLACKLIST:\n $this->generateBlacklist(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_WHITELIST:\n $this->generateWhitelist(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_VACATION:\n $this->generateVacation(!empty($filter['disable']));\n break;\n\n case Ingo_Storage::ACTION_FORWARD:\n $this->generateForward(!empty($filter['disable']));\n break;\n\n default:\n if (in_array($filter['action'], $this->_actions)) {\n /* Create filter if using AND. */\n if ($filter['combine'] == Ingo_Storage::COMBINE_ALL) {\n $recipe = new Ingo_Script_Procmail_Recipe($filter, $this->_params);\n if (!$filter['stop']) {\n $recipe->addFlag('c');\n }\n foreach ($filter['conditions'] as $condition) {\n $recipe->addCondition($condition);\n }\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Comment($filter['name'], !empty($filter['disable']), true));\n $this->_addItem(Ingo::RULE_FILTER, $recipe);\n } else {\n /* Create filter if using OR */\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Comment($filter['name'], !empty($filter['disable']), true));\n $loop = 0;\n foreach ($filter['conditions'] as $condition) {\n $recipe = new Ingo_Script_Procmail_Recipe($filter, $this->_params);\n if ($loop++) {\n $recipe->addFlag('E');\n }\n if (!$filter['stop']) {\n $recipe->addFlag('c');\n }\n $recipe->addCondition($condition);\n $this->_addItem(Ingo::RULE_FILTER, $recipe);\n }\n }\n }\n }\n }\n\n // If an external delivery program is used, add final rule\n // to deliver to $DEFAULT\n if (isset($this->_params['delivery_agent'])) {\n $this->_addItem(Ingo::RULE_FILTER, new Ingo_Script_Procmail_Default($this->_params));\n }\n }", "public function init() {\n $this->generate();\n }", "public function generateCode() {\n $content = \"\";\n foreach ($this->arrTemplates as $template) {\n if (!file_exists($template)) {\n //Template not found\n continue;\n }\n $content .= file_get_contents($template);\n }\n \n foreach ($this->attributes as $key => $val) {\n $content = str_replace($this->placeHolderStart.$key.$this->placeHolderEnd, $val, $content);\n }\n return $content;\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new BackendTemplate('be_wildcard');\n\t\t\t$objTemplate->wildcard = '### MEMBER DETAILS ###';\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\t\t\n\t\t// The following two lines is just to prevent the parent class from not continuing\n\t\t$this->ml_groups = 'a:2:{i:0;s:1:\" \";i:1;s:1:\" \";}';\n\t\t$this->ml_fields = 'a:2:{i:0;s:1:\" \";i:1;s:1:\" \";}';\n\t\t\n\t\treturn parent::generate();\n\t}", "public function generate()\n {\n AnnotationRegistry::registerFile(\n __DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'\n );\n\n $driver = new AnnotationDriver(\n new CachedReader(new AnnotationReader(), new ArrayCache()),\n array(\n __DIR__ . '/../library/Xi/Filelib/Backend/Adapter/DoctrineOrm/Entity',\n )\n );\n\n $config = new Configuration();\n $config->setMetadataDriverImpl($driver);\n $config->setProxyDir(ROOT_TESTS . '/data/temp');\n $config->setProxyNamespace('Proxies');\n\n $em = EntityManager::create($this->connectionOptions, $config);\n\n $st = new SchemaTool($em);\n $metadata = $st->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());\n\n return join(\";\\n\", $metadata) . \";\\n\";\n }", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "abstract public function adapter(): FeatureAdapter;", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "public function __construct($className, $methods = NULL, $adapterClassName = '') {\n if (empty($className)) {\n throw new Exception('Argument className was empty.');\n } else {\n $this->className = $className;\n }\n\n if (!class_exists($className)) {\n throw new Exception('Class not found '.$className);\n }\n\n $myExtReflectionClass = new ExtReflectionClass($this->className);\n\n $this->classFile = $myExtReflectionClass->getFileName();\n\n if ($methods == NULL) {\n $methods = $myExtReflectionClass->getMethods();\n }\n if (empty($adapterClassName)) {\n $this->adapterClassName = $this->generateAdapterClassName($this->className);\n } else {\n $this->adapterClassName = $adapterClassName;\n }\n $gen = '/**' . \"\\n\";\n $gen.= ' * auto-generated document-wrapped adapter class for class `' . $this->className . \"'\\n\";\n $gen.= ' *' . \"\\n\";\n $gen.= ' * The class will make the unwrapping arguments and the' . \"\\n\";\n $gen.= ' * wrapping of return values.' . \"\\n\";\n $gen.= ' *' . \"\\n\";\n $gen.= ' * generated by DocumentWrappedAdapterGenerator' . \"\\n\";\n $gen.= ' */' . \"\\n\";\n $gen.= 'class ' . $this->adapterClassName . ' {' . \"\\n\";\n $gen.= '' . \"\\n\";\n $gen.= ' /**' . \"\\n\";\n $gen.= ' * @var ' . $this->className . \"\\n\";\n $gen.= ' */' . \"\\n\";\n $gen.= ' private $target;' . \"\\n\";\n $gen.= '' . \"\\n\";\n $gen.= ' /**' . \"\\n\";\n $gen.= ' * @param ' . $this->className . ' $target' . \"\\n\";\n $gen.= ' */' . \"\\n\";\n $gen.= ' public function __construct($target = null) {' . \"\\n\";\n $gen.= ' if (empty($target)) {' . \"\\n\";\n \n $gen.= '\t\t\t//May be we have a singleton class, just check for some common names' . \"\\n\";\n $gen.= ' $class = new ReflectionClass(\\''.$this->className.'\\');' . \"\\n\";\n\t\t$gen.= ' if ($class->isInstantiable()) {' . \"\\n\";\n\t\t$gen.= ' $obj = $class->newInstance();' . \"\\n\";\n\t\t$gen.= ' }' . \"\\n\";\n $gen.= '\t\t\telseif (is_callable(array(\\''.$this->className.'\\', \\'getInstance\\'), false)) {' . \"\\n\";\n\t $gen.= '\t\t\t $obj = call_user_func(array(\\''.$this->className.'\\', \\'getInstance\\'));' . \"\\n\";\n $gen.= '\t\t }' . \"\\n\";\n $gen.= '\t\t elseif (is_callable(array(\\''.$this->className.'\\', \\'getSingleton\\'), false)) {' . \"\\n\";\n\t $gen.= '\t\t $obj = call_user_func(array(\\''.$this->className.'\\', \\'getSingleton\\'));' . \"\\n\";\n $gen.= '\t\t }' . \"\\n\";\n $gen.= '\t\t else {' . \"\\n\";\n $gen.= '\t\t \tthrow new Exception(\\'Could not create an object instance of class '. $this->className .'\\');' . \"\\n\";\n $gen.= '\t\t }' . \"\\n\";\n $gen.= ' $this->target = $obj;' . \"\\n\";\n $gen.= ' } else {' . \"\\n\";\n $gen.= ' $this->target = $target;' . \"\\n\";\n $gen.= ' }' . \"\\n\";\n $gen.= ' }' . \"\\n\";\n $gen.= '' . \"\\n\";\n foreach ($methods as $method) {\n if (!$method->isConstructor() and !$method->isDestructor() and !$method->isMagic()) {\n $methodName = $method->getName();\n $params = $method->getParameters();\n $returnType = $method->getReturnType();\n\n //echo $methodName . \"<br>\\n\";\n $gen.= ' /**' . \"\\n\";\n $gen.= ' * @param object $args' . \"\\n\";\n if (!empty($returnType)) {\n $gen.= ' * @return array<string,' . $returnType->toString() . '>' . \"\\n\";\n } else {\n $gen.= ' * @return array<string,mixed>' . \"\\n\";\n }\n $gen.= ' */' . \"\\n\";\n $gen.= ' public function ' . $methodName . '(';\n if (!empty($params)) {\n $gen.= '$args';\n }\n $gen.= ') {' . \"\\n\";\n\n // TODO: decide which naming convention to use (has to be compatible with WSDLGenerator)\n $returnElementName = $methodName . 'Result';\n //$returnElementName = 'return';\n\n $gen.= ' return array(\\'' . $returnElementName . '\\' => $this->target->' . $methodName . '(';\n if (!empty($params)) {\n foreach ($params as $param) {\n $gen.= '$args->' . $param->getName() . ', ';\n }\n $gen = substr($gen, 0, -2); //remove last ', '\n }\n $gen.= '));' . \"\\n\";\n $gen.= ' }' . \"\\n\";\n $gen.= '' . \"\\n\";\n }\n }\n $gen.= '}';\n $this->adapterClass = $gen;\n }", "public function generateV4();", "protected function generateJavascript()\n\t{\n\t}", "protected function getTemplate($className)\n {\n return sprintf('<?php\n\nnamespace %s;\n\nuse ZfSimpleMigrations\\Library\\AbstractMigration;\nuse Zend\\Db\\Metadata\\MetadataInterface;\n\nclass %s extends AbstractMigration\n{\n public static $description = \"Migration description\";\n\n public function up(MetadataInterface $schema)\n {\n //$this->addSql(/*Sql instruction*/);\n }\n\n public function down(MetadataInterface $schema)\n {\n //throw new \\RuntimeException(\\'No way to go down!\\');\n //$this->addSql(/*Sql instruction*/);\n }\n}\n', $this->migrationNamespace, $className);\n }", "public function __construct(){\n\t\t$this->setCompiler();\n\t}", "public function generujKod(){\n\t\t//\n\t}", "public abstract function getSchemaHelperListToGenerate();", "public function __construct(){\n $this->__classname = get_class($this); \n $this->_methods['default'] = $this->__classname.\"Init\";\n $this->registerMethodAlias(\"createUrl\", array(\"Vimerito\", \"createUrl\"));\n $this->registerMethodAlias(\"loadJsLibrary\", array(\"VLayout\", \"registerUserJavaScriptLibraries\"));\n }", "protected function generateMisc()\n {\n //We need to generate both a forward and reverse bank, followed by proper wrappers.\n\n $php = \"<?php\\n\";\n $php .= \"namespace GCWorld\\\\Routing\\\\Generated\\\\{$this->name};\\n\";\n $php .= \"\\n\";\n $php .= \"class MasterRoute_MISC Implements \\\\GCWorld\\\\Routing\\\\Interfaces\\\\RoutesInterface\\n\";\n $php .= \"{\\n\";\n\n //Get File Time Function\n $php .= \" public function getFileTime()\\n\";\n $php .= \" {\\n\";\n $php .= \" return filemtime(__FILE__);\\n\";\n $php .= \" }\\n\\n\";\n\n //Get Forward Routes Function\n $php .= \" public function getForwardRoutes()\\n\";\n $php .= \" {\\n\";\n $php .= \" return [\\n\";\n foreach ($this->routes_straight as $k => $v) {\n $temp = explode('/', $k);\n if (in_array($temp[1], $this->routes_master)) {\n continue;\n }\n $cEncoder = new PHPEncoder();\n $encoded = $cEncoder->encode($v, [\n 'array.base' => 12,\n 'array.inline' => false,\n 'array.omit' => false,\n 'array.align' => true,\n 'array.indent' => 4,\n 'boolean.capitalize' => true,\n 'null.capitalize' => true,\n ]);\n $php .= \" '$k' => \".$encoded.\",\\n\";\n }\n $php .= \" ];\\n\";\n $php .= \" }\\n\\n\";\n\n\n //Get Reverse Routes Function\n $php .= \" public function getReverseRoutes()\\n\";\n $php .= \" {\\n\";\n $php .= \" return [\\n\";\n foreach ($this->routes_reverse as $k => $v) {\n $temp = explode('_', $k);\n if (in_array($temp[0], $this->routes_master)) {\n continue;\n }\n $cEncoder = new PHPEncoder();\n $encoded = $cEncoder->encode($v, [\n 'array.base' => 12,\n 'array.inline' => false,\n 'array.omit' => false,\n 'array.align' => true,\n 'array.indent' => 4,\n 'boolean.capitalize' => true,\n 'null.capitalize' => true,\n ]);\n $php .= \" '$k' => \".$encoded.\",\\n\";\n }\n $php .= \" ];\\n\";\n $php .= \" }\\n\\n\";\n\n //End of file\n $php .= \"}\\n\";\n\n file_put_contents($this->storage.'MasterRoute_MISC.php', $php);\n }", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "public function getCode() {\n\n $licence = '/*\n * Auto Generated Code for HomeNet\n *\n * Copyright (c) 2011 HomeNet.\n *\n * This file is part of HomeNet.\n *\n * HomeNet is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * HomeNet is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with HomeNet. If not, see <http ://www.gnu.org/licenses/>.\n */';\n return $licence;\n }", "abstract protected function _generateDataCollection();", "public function generate() {\n\n // Loop through all defined API configurations and make Client APIs where applicable\n $configurations = APIConfiguration::getAPIConfigs();\n\n\n foreach ($configurations as $configuration) {\n\n if ($configuration->getGeneratedClients()) {\n $this->generateAPI($configuration);\n }\n\n }\n\n }", "abstract public function getAdapterSpecs();", "public function generate() {\n\n /** @var $code String generate code */\n\n $code = (new Users())->phoneNumber_GenerateCode();\n\n /** @var $user Array get the details of a current user */\n\n $user = (new Users())->current_user();\n\n /**\n * @var $phone_format String format mobile phone number\n * to non space and non special character format\n */\n\n $phone_format = preg_replace(\"/[\\W\\s]/m\",\"\",$user['CP']);\n\n /** @var $template String a message to send **/\n\n $template = \"From SCOA, use this code to verify your account '{$code}' \";\n\n /** @void send sms and notify the current user */\n\n sms::send($phone_format,$template);\n\n }", "public function generateDocblock();", "protected function _generate() {\n\t\t\n\t\t// recuperation de l'executable\n\t\t$cmd = $this->getExecutable();\n\t\t\n\t\t// gestion des paramètres\n\t\tforeach ($this->getParam() as $param => $value) {$cmd .= ' --' . (!is_numeric($param) ? $param . '=' : '') . $value;}\n\t\t\n\t\t// connexion\n\t\tforeach (array('u ' => 'username', 'p' => 'password', 'dbname') as $prefix => $key) {\n\t\t\tif ($value = array_find($key, $this->getConfig())) {$cmd .= ' ' . (!is_numeric($prefix) ? '-' . $prefix : '') . $value;}\n\t\t\telse { \n\t\t\t\trequire_once 'Zend/Exception.php';\n\t\t\t\tthrow new Zend_Exception('Erreur paramètre de connexion : ' . $key);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//construction de l'url du fichier\n\t\tif (!strlen($this->getFile())) { $this->setFile($this->getDirectory() . '/mysqldump_' . array_find('dbname', $this->getConfig()) . '_' . time() .'.sql' . ($this->getCompress() ? '.bz2' : '')); }\n\t\t\n\t\t// ajoute la fonction pour la compression\n\t\t$cmd .= $this->getCompress() ? ' | bzip2 --stdout --quiet --best ' : '';\n\t\t\n\t\t// inscirption de l'url\n\t\t$cmd .= ' > ' . $this->getFile();\n\n\t\treturn $cmd;\n\t}", "public function createMvcCode() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get input\n\t\t$componentName = KRequest::getKeyword('component_name');\n\t\t$nameSingular = KRequest::getKeyword('name_singular');\n\t\t$namePlural = KRequest::getKeyword('name_plural');\n\n\t\t// Validate input\n\t\tif (empty($componentName)) {\n\t\t\tKLog::log(\"Component name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Component name is not specified.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($nameSingular)) {\n\t\t\tKLog::log(\"Singular name is not specified.\", 'custom_code_creator');\n\t\t\techo \"name_singular is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\tif (empty($namePlural)) {\n\t\t\tKLog::log(\"Plural name is not specified.\", 'custom_code_creator');\n\t\t\techo \"Parameter name_plural is empty.\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Prepare the table name and\n\t\t$tableName = strtolower('configbox_external_' . $namePlural);\n\t\t$model = KenedoModel::getModel('ConfigboxModelAdminmvcmaker');\n\n\t\t// Make all files\n\t\t$model->createControllerFile($componentName, $nameSingular, $namePlural);\n\t\t$model->createModelFile($componentName, $namePlural, $tableName);\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'form');\n\t\t$model->createViewFiles($componentName, $nameSingular, $namePlural, 'list');\n\n\t\techo 'All done';\n\n\t}", "public function commonCodeDataProvider()\n {\n yield NoUnit::class => [NoUnit::class, [\n 'GROUP_NUMBER' => null,\n 'SECTOR' => null,\n 'GROUP_ID' => null,\n 'QUANTITY' => null,\n 'LEVEL' => '1',\n 'STATUS' => null,\n 'COMMON_CODE' => 'C62',\n 'NAME' => 'one',\n 'CONVERSION_FACTOR' => '1',\n 'SYMBOL' => '1',\n 'DESCRIPTION' => 'Synonym: unit'\n ]];\n\n yield Radian::class => [Radian::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 2,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1',\n 'STATUS' => null,\n 'COMMON_CODE' => 'C81',\n 'NAME' => 'radian',\n 'CONVERSION_FACTOR' => 'rad',\n 'SYMBOL' => 'rad',\n 'DESCRIPTION' => null\n ]];\n yield Milliradian::class => [Milliradian::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 3,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1S',\n 'STATUS' => null,\n 'COMMON_CODE' => 'C25',\n 'NAME' => 'milliradian',\n 'CONVERSION_FACTOR' => '10⁻³ rad',\n 'SYMBOL' => 'mrad',\n 'DESCRIPTION' => null\n ]];\n yield Microradian::class => [Microradian::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 4,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1S',\n 'STATUS' => null,\n 'COMMON_CODE' => 'B97',\n 'NAME' => 'microradian',\n 'CONVERSION_FACTOR' => '10⁻⁶ rad',\n 'SYMBOL' => 'µrad',\n 'DESCRIPTION' => null\n ]];\n yield AngleDegree::class => [AngleDegree::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 5,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1',\n 'STATUS' => null,\n 'COMMON_CODE' => 'DD',\n 'NAME' => 'degree [unit of angle]',\n 'CONVERSION_FACTOR' => '1,745 329 x 10⁻² rad',\n 'SYMBOL' => '°',\n 'DESCRIPTION' => null\n ]];\n yield AngleMinute::class => [AngleMinute::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 6,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1',\n 'STATUS' => null,\n 'COMMON_CODE' => 'D61',\n 'NAME' => 'minute [unit of angle]',\n 'CONVERSION_FACTOR' => '2,908 882 x 10⁻⁴ rad',\n 'SYMBOL' => '\\'',\n 'DESCRIPTION' => null\n ]];\n yield AngleSecond::class => [AngleSecond::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 7,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '1',\n 'STATUS' => null,\n 'COMMON_CODE' => 'D62',\n 'NAME' => 'second [unit of angle]',\n 'CONVERSION_FACTOR' => '4,848 137 x 10⁻⁶ rad',\n 'SYMBOL' => '\"',\n 'DESCRIPTION' => null\n ]];\n yield Grade::class => [Grade::class, [\n 'GROUP_NUMBER' => 1,\n 'SECTOR' => 'Space and Time',\n 'GROUP_ID' => 8,\n 'QUANTITY' => 'angle (plane)',\n 'LEVEL' => '2',\n 'STATUS' => 'D',\n 'COMMON_CODE' => 'A91',\n 'NAME' => 'grade',\n 'CONVERSION_FACTOR' => '= gon',\n 'SYMBOL' => null,\n 'DESCRIPTION' => null\n ]];\n }", "public function Generar( ){\r\n\t\t$this->Output();\r\n\t}", "public function generate(ProgramInterface $program);", "function generate() ;", "function Generate($noprint=false) {\n\t\t\n\t if ($noprint) {\n\t \t return $this->getOutputCode();\n\t } else {\n\t \t echo $this->getOutputCode();\n\t }\n\t \n\t}", "private function __construct() {\n\t\t\\sky\\Sky::$twigLoader->addPath(\\sky\\Sky::location(\"helpers\").\"entityBuilder/\");\n\n\t}", "private function generateFrontend()\n {\n #-- add needed css an js files\n $GLOBALS['TL_CSS'][] = 'bundles/homekitee/uikit-3.6.21/css/uikit.min.css';\n $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/homekitee/uikit-3.6.21/js/uikit.min.js';\n $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/homekitee/uikit-3.6.21/js/uikit-icons.min.js';\n }", "public function generate()\r\n\t{\r\n\t\tif (TL_MODE == 'BE')\r\n\t\t{\r\n\t\t\t$objTemplate = new BackendTemplate('be_wildcard');\r\n\t\t\t$objTemplate->wildcard = '### ISOTOPE ECOMMERCE: KIENER CUSTOM FILTER ###';\r\n\t\t\t$objTemplate->title = $this->headline;\r\n\t\t\t$objTemplate->id = $this->id;\r\n\t\t\t$objTemplate->link = $this->name;\r\n\t\t\t$objTemplate->href = $this->Environment->script.'?do=modules&amp;act=edit&amp;id=' . $this->id;\r\n\r\n\t\t\treturn $objTemplate->parse();\r\n\t\t}\r\n\t\t\r\n\t\treturn parent::generate();\r\n\t}", "protected function build()\n\t{\n\t}", "public function actionGenerateBarcode() \n {\n\t\t$inputCode = Yii::app()->request->getParam(\"code\", \"\");\n\t\t$bc = new BarcodeGenerator;\n\t\t$bc->init('png');\n\t\t$bc->build($inputCode);\n }", "public function generateDataContextCode($dataContextName, $throwExceptionsOnError = false)\n {\n $tables = $this->getTables();\n $throwExceptionsOnError = $throwExceptionsOnError ? 'true' : 'false';\n $code =\n\" require_once \\\"grandprix.data.php\\\";\n \n /**\n * Provides a single access point to perform CRUD operations against the database.\n *\n * @package Grandprix\n * @subpackage Data\n */\n class \" . $dataContextName . \" extends DataContext\n {\n /**\n * @var \" . $dataContextName . \"\n */\n protected static \\$instance;\n\n /**\n * Creates a new instance of this class. This is intended to be used\n * as a singleton. In order to get an instance of this class \n * use the getInstance method\n */\n protected function __construct()\n {\n parent::__construct(\n Settings::getSetting(Settings::KEY_DATA_USERNAME),\n Settings::getSetting(Settings::KEY_DATA_PASSWORD),\n Settings::getSetting(Settings::KEY_DATA_HOSTNAME),\n Settings::getSetting(Settings::KEY_DATA_SCHEMA),\n Settings::getSetting(Settings::KEY_DATA_PORT));\n \n \\$this->logLevel = Settings::getSetting(Settings::KEY_LOG_LEVEL);\n }\n \n /**\n * Retrieves the singleton instance for this class\n *\n * @return \" . $dataContextName . \"\n */\n public static function getInstance()\n {\n if (is_null(self::\\$instance))\n self::\\$instance = new \" . $dataContextName . \"();\n\n return self::\\$instance;\n }\n\";\n foreach ($tables as $table)\n {\n $priKeys = $this->getPrimaryKeys($table['tableName']);\n $params = array();\n $columns = $this->getColumns($table['tableName']);\n $cols = array();\n $selectWhere = array();\n $insertCols = array();\n foreach ($columns as $column)\n {\n $cols[] = $column['columnName'];\n if ($column['isAutoNumber'] == 'false')\n {\n $insertCols[] = $column;\n }\n }\n// Start of DataEntity_Retrieve\n $code .=\n\"\n /**\n * Retrieves a uniquely-identified \" . ucfirst($table['tableName']) . \" data entity.\";\n foreach ($priKeys as $priKey)\n {\n $params[] = $priKey['columnName'];\n $selectWhere[] = $priKey['columnName'] . ' = ? ';\n $code .=\n\"\n * @param \" . self::getPhpType($priKey['dataType']) . \" \\$\" . strtolower($priKey['columnName']) . \"\n\";\n }\n\n $code .=\n\" * @return \" . ucfirst($table['tableName']) . \"\n */\n public function \" . ucfirst($table['tableName']) . \"_Retrieve(\\$\" . implode(', $', $params) . \")\n {\n \\$query = new DataQuery('SELECT \" . implode(', ', $cols) . \" FROM \" . $table['tableName'] . \" WHERE \" . implode(',', $selectWhere) . \" LIMIT 1', array());\n \\$params = array();\";\n foreach ($priKeys as $param)\n {\n $code .=\n\"\n \\$params[] = new DataParameter('\" . $param['columnName'] . \"', \" . self::getDataParameterType($param['dataType']) . \", \\$\" . $param['columnName'] . \");\";\n }\n $code .=\n\"\n \\$result = \\$this->query(\\$query, \\$params);\n if (count(\\$result) == 0) return null;\n return \" . ucfirst($table['tableName']) . \"::fromData(\\$result[0]);\n }\n\"; // end of DataEntity_Retrieve Function\n\n// Start of DataEntity_Delete\n $code .=\n\"\n /**\n * Deletes a uniquely-identified \" . ucfirst($table['tableName']) . \" data entity.\";\n foreach ($priKeys as $priKey)\n {\n $code .=\n\"\n * @param \" . self::getPhpType($priKey['dataType']) . \" \\$\" . strtolower($priKey['columnName']) . \"\n\";\n }\n\n $code .=\n\" * @return int The number of affected rows.\n */\n public function \" . ucfirst($table['tableName']) . \"_Delete(\\$\" . implode(', $', $params) . \")\n {\n \\$query = new DataQuery('DELETE FROM \" . $table['tableName'] . \" WHERE \" . implode(',', $selectWhere) . \" LIMIT 1', array());\n \\$params = array();\";\n foreach ($priKeys as $param)\n {\n $code .=\n\"\n \\$params[] = new DataParameter('\" . $param['columnName'] . \"', \" . self::getDataParameterType($param['dataType']) . \", \\$\" . $param['columnName'] . \");\";\n }\n $code .=\n\"\n return \\$this->execute(\\$query, \\$params, $throwExceptionsOnError);\n }\n\"; // end of DataEntity_Delete Function\n\n// Start of DataEntity_Create\n $insertParams = array();\n $insertArgs = array();\n $updateParams = array();\n foreach ($insertCols as $col)\n {\n $updateParams[] = $col['columnName'] . ' = ?';\n $insertParams[] = $col['columnName'];\n $insertArgs[] = '?';\n }\n \n $code .=\n\"\n /**\n * Creates (or Inserts) a \" . ucfirst($table['tableName']) . \" data entity.\n * @param \" . ucfirst($table['tableName']) . \" \\$entity\n * @return \" . ucfirst($table['tableName']) . \" The newly-created entity.\n */\n public function \" . ucfirst($table['tableName']) . \"_Create(\\$entity)\n {\n \\$query = new DataQuery('INSERT INTO \" . $table['tableName'] . \" (\" . implode(', ', $insertParams) . \") VALUES (\" . implode(', ', $insertArgs) . \")', array());\n \\$params = array();\";\n foreach ($insertCols as $param)\n {\n $code .=\n\"\n \\$params[] = new DataParameter('\" . $param['columnName'] . \"', \" . self::getDataParameterType($param['dataType']) . \", \\$entity->\" . ucfirst($param['columnName']) . \");\";\n }\n $code .=\n\"\n \\$affectedRows = \\$this->execute(\\$query, \\$params);\n if (\\$affectedRows == 0) return null;\n \\$insertId = mysqli_insert_id(\\$this->connectionManager);\n return \\$this->\" . ucfirst($table['tableName']) . \"_Retrieve(\\$insertId);\n }\n\"; // end of DataEntity_Create Function\n\n// Start of DataEntity_Update\n $updateWhereParams = array();\n $retrieveParams = array();\n foreach($priKeys as $priKey)\n {\n $updateWhereParams[] = $priKey['columnName'] . ' = ?';\n $retrieveParams[] = '$entity->' . ucfirst($priKey['columnName']);\n }\n $code .=\n\"\n /**\n * Updates a \" . ucfirst($table['tableName']) . \" data entity.\n * @param \" . ucfirst($table['tableName']) . \" \\$entity\n * @return \" . ucfirst($table['tableName']) . \" The newly-updated entity.\n */\n public function \" . ucfirst($table['tableName']) . \"_Update(\\$entity)\n {\n \\$query = new DataQuery('UPDATE \" . $table['tableName'] . \" SET \" . implode(', ', $updateParams) . \" WHERE \" . implode(', ', $updateWhereParams) . \" LIMIT 1', array());\n \\$params = array();\";\n foreach ($insertCols as $param)\n {\n $code .=\n\"\n \\$params[] = new DataParameter('\" . $param['columnName'] . \"', \" . self::getDataParameterType($param['dataType']) . \", \\$entity->\" . ucfirst($param['columnName']) . \");\";\n }\n foreach ($priKeys as $param)\n {\n $code .=\n\"\n \\$params[] = new DataParameter('\" . $param['columnName'] . \"', \" . self::getDataParameterType($param['dataType']) . \", \\$entity->\" . ucfirst($param['columnName']) . \");\";\n }\n $code .=\n\"\n \\$affectedRows = \\$this->execute(\\$query, \\$params);\n if (\\$affectedRows == 0) return null;\n return \\$this->\" . ucfirst($table['tableName']) . \"_Retrieve(\" . implode(', ', $retrieveParams) . \");\n }\n\"; // end of DataEntity_Update Function\n\n } // end of foreach Table\n\n $code .=\n\"\n }\n\"; // end of data context code genration\n return $code;\n }", "public static function _register()\n {\n self::assignElements([\n 'Action' => ['type' => 'BidActionCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'Currency' => ['type' => 'CurrencyCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'ItemID' => ['type' => 'ItemIDType', 'xmlns' => self::XMLNS],\n 'MaxBid' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'Discounts' => ['type' => 'OfferDiscountsType', 'xmlns' => self::XMLNS],\n 'Quantity' => ['type' => 'int'],\n 'SecondChanceEnabled' => ['type' => 'bool'],\n 'SiteCurrency' => ['type' => 'CurrencyCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'TimeBid' => [],\n 'HighestBid' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'ConvertedPrice' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'TransactionID' => [],\n 'User' => ['type' => 'UserType', 'xmlns' => self::XMLNS],\n 'UserConsent' => ['type' => 'bool'],\n 'BidCount' => ['type' => 'int'],\n 'Message' => [],\n 'BestOfferID' => ['type' => 'BestOfferIDType', 'xmlns' => self::XMLNS],\n 'MyMaxBid' => ['type' => 'AmountType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "public function generateStandalone();", "public function getName()\n {\n return 'HiQDev General Use Yii 2 Extension Generator';\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new BackendTemplate('be_wildcard');\n\t\t\t$objTemplate->wildcard = '### Tag List by Category ###';\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\t\tif (strlen($this->tag_sourcetables)) $this->sourcetables = deserialize($this->tag_sourcetables, TRUE);\n\t\tarray_push($this->arrPages, $this->pagesource);\n\t\t$this->getRelevantPages($this->pagesource);\n\t\treturn parent::generate();\n\t}", "public function generate()\n\t{\n\t\t$this->import('Database');\n\n\t\t$arrButtons = array('copy', 'up', 'down', 'delete');\n\t\t$strCommand = 'cmd_' . $this->strField;\n\n\t\t// Change the order\n\t\tif ($this->Input->get($strCommand) && is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t{\n\t\t\tswitch ($this->Input->get($strCommand))\n\t\t\t{\n\t\t\t\tcase 'copy':\n\t\t\t\t\t$this->varValue = array_duplicate($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'up':\n\t\t\t\t\t$this->varValue = array_move_up($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'down':\n\t\t\t\t\t$this->varValue = array_move_down($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$this->varValue = array_delete($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get all modules from DB\n\t\t$objModules = $this->Database->execute(\"SELECT id, name FROM tl_module ORDER BY name\");\n\t\t$modules = array();\n\n\t\tif ($objModules->numRows)\n\t\t{\n\t\t\t$modules = array_merge($modules, $objModules->fetchAllAssoc());\n\t\t}\n\n\t\t$objRow = $this->Database->prepare(\"SELECT * FROM \" . $this->strTable . \" WHERE id=?\")\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->execute($this->currentRecord);\n\n\t\t// Columns\n\t\tif ($objRow->numRows)\n\t\t{\n\t\t\t$cols = array();\n\t\t\t$count = count(explode('x',$objRow->sc_type));\n\n\t\t\tswitch ($count)\n\t\t\t{\n\t\t\t\tcase '2':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase '5':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\t$cols[] = 'fifth';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\t// Get new value\n\t\tif ($this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->varValue = $this->Input->post($this->strId);\n\t\t}\n\n\t\t// Make sure there is at least an empty array\n\t\tif (!is_array($this->varValue) || !$this->varValue[0])\n\t\t{\n\t\t\t$this->varValue = array('');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t// Initialize sorting order\n\t\t\tforeach ($cols as $col)\n\t\t\t{\n\t\t\t\t$arrCols[$col] = array();\n\t\t\t}\n\n\t\t\tforeach ($this->varValue as $v)\n\t\t\t{\n\t\t\t\t// Add only modules of an active section\n\t\t\t\tif (in_array($v['col'], $cols))\n\t\t\t\t{\n\t\t\t\t\t$arrCols[$v['col']][] = $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->varValue = array();\n\n\t\t\tforeach ($arrCols as $arrCol)\n\t\t\t{\n\t\t\t\t$this->varValue = array_merge($this->varValue, $arrCol);\n\t\t\t}\n\t\t}\n\n\t\t// Save the value\n\t\tif ($this->Input->get($strCommand) || $this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->Database->prepare(\"UPDATE \" . $this->strTable . \" SET \" . $this->strField . \"=? WHERE id=?\")\n\t\t\t\t\t\t ->execute(serialize($this->varValue), $this->currentRecord);\n\n\t\t\t// Reload the page\n\t\t\tif (is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t\t{\n\t\t\t\t$this->redirect(preg_replace('/&(amp;)?cid=[^&]*/i', '', preg_replace('/&(amp;)?' . preg_quote($strCommand, '/') . '=[^&]*/i', '', $this->Environment->request)));\n\t\t\t}\n\t\t}\n\n\t\t// Add label and return wizard\n\t\t$return .= '<table cellspacing=\"0\" cellpadding=\"0\" id=\"ctrl_'.$this->strId.'\" class=\"tl_modulewizard\" summary=\"Module wizard\">\n <thead>\n <tr>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['module'].'</td>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['column'].'</td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>';\n\n\t\t// Load tl_article language file\n\t\t$this->loadLanguageFile('tl_article');\n\n\t\t// Add input fields\n\t\tfor ($i=0; $i<count($this->varValue); $i++)\n\t\t{\n\t\t\t$options = '';\n\n\t\t\t// Add modules\n\t\t\tforeach ($modules as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v['id']).'\"'.$this->optionSelected($v['id'], $this->varValue[$i]['mod']).'>'.$v['name'].'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <tr>\n <td><select name=\"'.$this->strId.'['.$i.'][mod]\" class=\"tl_select\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>';\n\n\t\t\t$options = '';\n\n\t\t\t// Add column\n\t\t\tforeach ($cols as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v).'\"'.$this->optionSelected($v, $this->varValue[$i]).'>'. ((isset($GLOBALS['TL_LANG']['CTE'][$v]) && !is_array($GLOBALS['TL_LANG']['CTE'][$v])) ? $GLOBALS['TL_LANG']['CTE'][$v] : $v) .'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <td><select name=\"'.$this->strId.'['.$i.'][col]\" class=\"tl_select_column\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>\n <td>';\n\n\t\t\tforeach ($arrButtons as $button)\n\t\t\t{\n\t\t\t\t$return .= '<a href=\"'.$this->addToUrl('&amp;'.$strCommand.'='.$button.'&amp;cid='.$i.'&amp;id='.$this->currentRecord).'\" title=\"'.specialchars($GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button]).'\" onclick=\"Backend.moduleWizard(this, \\''.$button.'\\', \\'ctrl_'.$this->strId.'\\'); return false;\">'.$this->generateImage($button.'.gif', $GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button], 'class=\"tl_listwizard_img\"').'</a> ';\n\t\t\t}\n\n\t\t\t$return .= '</td>\n </tr>';\n\t\t}\n\n\t\treturn $return.'\n </tbody>\n </table>';\n\t}", "public function generate($minify = false);", "function Generate()\n \t{\n \t\t\n \t}", "protected function _generateRules()\n {\n }", "private function generateFrontend()\n {\n if ($this->galleryOrder) {\n $this->Template->multiImages = DataHelper::getMultiImgObjs($this->galleryOrder, deserialize($this->size));\n }\n\n #-- add classes\n if (is_array($this->objModel->classes)) {\n $this->objModel->classes = array_unique(array_merge($this->objModel->classes, HomeKiteeHelper::getLayoutClasses(array(\n 'design' => $this->hm_design\n ))));\n } else {\n $this->objModel->classes = array_unique(HomeKiteeHelper::getLayoutClasses(array(\n 'design' => $this->hm_design\n )));\n\n }\n }", "abstract public function build();", "abstract public function build();", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function generate_code() {\n\t\t$secret = $this->code_generator->createSecret();\n\t\t$code = $this->code_generator->getCode($secret);\n\t\treturn array('secret'=>$secret, 'code'=>$code);\n\t}", "public function display()\n\t{\n\t\t// Build the Adapter class path.\n\t\t$className = '\\\\component\\\\adapter\\\\view\\\\' . ucfirst(strtolower($this->adapterType));\n\t\tif ( ! class_exists($className))\n\t\t{\n\t\t\tthrow new \\Exception(\n\t\t\t\t\"Unsupported display type '{$this->adapterType}'.\" \n\t\t\t\t. \" Create a custom adapter in '/component/adapter/view/' to enable support.\"\n\t\t\t\t);\n\t\t}\n\t\t\n // Build adapter intput.\n\t\t$input = array(\n\t\t\t'template' => $this->template,\n\t\t\t'templateDirectory' => $this->templateDirectory,\n\t\t\t'globals' => self::$globals,\n\t\t\t'data' => $this->_data\n\t\t\t);\n\t\t\n // Build adapter and generate output.\n\t\t$adapter = new $className($input);\n\t\t$adapter->getOutput();\n\t\t\n\t\treturn TRUE;\n\t}" ]
[ "0.662946", "0.6511017", "0.60634387", "0.60634387", "0.6019794", "0.58341897", "0.58341897", "0.58334684", "0.58334684", "0.583344", "0.583344", "0.583344", "0.583344", "0.583344", "0.58287543", "0.580936", "0.5801711", "0.57794714", "0.5778451", "0.5763455", "0.5762898", "0.5743411", "0.57207924", "0.5717369", "0.5692571", "0.5686366", "0.5673723", "0.5663429", "0.5631773", "0.56172377", "0.56159014", "0.56144756", "0.55674285", "0.55674285", "0.55674285", "0.55674285", "0.55674285", "0.5517361", "0.5514818", "0.5513268", "0.5494179", "0.5437489", "0.5417044", "0.5373534", "0.53520256", "0.5350026", "0.5339975", "0.52989846", "0.52930045", "0.5287271", "0.52840084", "0.52811676", "0.52809227", "0.52620566", "0.52435344", "0.5237308", "0.52206844", "0.5210167", "0.52051866", "0.51997876", "0.5173366", "0.5169583", "0.51660186", "0.5163191", "0.5148532", "0.51274186", "0.5125079", "0.51080984", "0.50950456", "0.509177", "0.5091622", "0.50837815", "0.50722665", "0.50567496", "0.50541574", "0.5046037", "0.50411236", "0.50372964", "0.5036274", "0.5031167", "0.5017365", "0.50165766", "0.5014863", "0.5013942", "0.50123006", "0.5007481", "0.500465", "0.50040364", "0.4996682", "0.4996198", "0.49901855", "0.49897826", "0.49777833", "0.49760872", "0.496448", "0.49626213", "0.49626213", "0.49609286", "0.49601778", "0.4959316" ]
0.820904
0
Get the class name
public function getAdapterClassName() { if ($this->class) { return $this->class; } elseif (!$this->getInterface()) { return $this->getClassName(); } else return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName();", "public function getClassName();", "protected function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->_sClass;\n }", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName() ;", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassName() { return __CLASS__; }", "public function getName()\n {\n return __CLASS__;\n }", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public static function className() : string {\n return get_called_class();\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }", "public function name($class) {\n return $this->classRegistry->getMap($class)->getCurrentName();\n }", "public function getClassName(): ?string {\n return $this->className;\n }", "public function getClassName()\n {\n return get_class($this->element);\n }", "function getName()\n {\n return get_class($this);\n }", "protected function getBaseClassName() {\r\n\t\tif(method_exists(static::$className, 'getBaseClassName')) {\r\n\t\t\treturn call_user_func(array(static::$className, 'getBaseClassName'));\r\n\t\t} else {\r\n\t\t\treturn mb_substr(static::$className, 0, -6);\r\n\t\t}\r\n\t}", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getClassName()\n {\n return $this->feedbackClass;\n }", "public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "public function getNamespacedName()\n {\n return get_class();\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}" ]
[ "0.89232844", "0.88946396", "0.8771138", "0.8691598", "0.8688977", "0.8677661", "0.8677661", "0.8651231", "0.8651231", "0.8651231", "0.8651231", "0.86344886", "0.86344886", "0.86283", "0.8604795", "0.86018217", "0.85902196", "0.85688955", "0.85653675", "0.85653675", "0.8560218", "0.85482496", "0.8528573", "0.85132176", "0.8490164", "0.84791553", "0.8457563", "0.8446206", "0.84457433", "0.84428674", "0.84425765", "0.84425765", "0.84425765", "0.84425765", "0.84425765", "0.84425765", "0.84425765", "0.84425765", "0.8431152", "0.84277934", "0.8415979", "0.8410136", "0.8407139", "0.8389804", "0.8389281", "0.83891624", "0.8388986", "0.8388986", "0.8371423", "0.8358898", "0.8348799", "0.8327624", "0.8318396", "0.83168834", "0.83110297", "0.8290709", "0.8262094", "0.8262094", "0.8252851", "0.8232871", "0.8220005", "0.82010704", "0.81974745", "0.81704575", "0.81644225", "0.8159572", "0.8117175", "0.80677146", "0.80554885", "0.80450726", "0.7949221", "0.7923095", "0.79061997", "0.7881708", "0.78729653", "0.7852448", "0.7849984", "0.78364056", "0.78149027", "0.7809429", "0.77956253", "0.77932143", "0.77625024", "0.77262855", "0.77008075", "0.76799643", "0.7664376", "0.7664376", "0.7638935", "0.7636957", "0.7627965", "0.75989956", "0.75963235", "0.75806236", "0.7563211", "0.75603366", "0.75592095", "0.75417775", "0.7525653", "0.75240433", "0.7519728" ]
0.0
-1
Generate the entity code
public function GenerateEntity() { return $this->entity->Generate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function generate()\n\t{\n\t\t$entityName = mb_strtolower($this->getEntityName());\n\n\t\t$entityDir = Yii::getAlias(self::PATH_TO_MODULE . '/' . $entityName);\n\n\t\tif (!is_dir($entityDir) && !mkdir($entityDir) && !is_dir($entityDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$entityDir}\");\n\t\t}\n\n\t\t$entityTableFilePath = \"{$entityDir}/{$entityName}.php\";\n\n\t\t$files = [\n\t\t\tnew CodeFile($entityTableFilePath, $this->render('table.php')),\n\t\t];\n\n\t\t$helpersDir = __DIR__ . '/default/admininterface';\n\n\t\tif (!is_dir($helpersDir) && !mkdir($helpersDir) && !is_dir($helpersDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$helpersDir}\");\n\t\t}\n\n\t\tforeach ($dirs = scandir($helpersDir, null) as $file) {\n\t\t\tif ($file === '.' || $file === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$templateFilePath = $helpersDir . '/' . $file;\n\t\t\t$codeFilePath = $entityDir . '/admininterface/' . $entityName . $file;\n\t\t\tif (is_file($templateFilePath) && pathinfo($templateFilePath, PATHINFO_EXTENSION) === 'php') {\n\t\t\t\t$files[] = new CodeFile($codeFilePath, $this->render(\"admininterface/$file\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function getGeneratedCode()\n {\n $adminClass = $this->getAdminClassName();\n if (class_exists($adminClass)) {\n throw new \\Exception('Impossible to generate. Class ' . $adminClass . ' already exists.');\n }\n $namespaceParts = explode('\\\\', $adminClass);\n if (isset($namespaceParts[0]) && $namespaceParts[0] == '') {\n array_shift($namespaceParts);\n }\n\n return $this->getTemplating()->render('MaxmodeGeneratorBundle:Sonata:Admin/class.php.twig', array(\n 'className' => array_pop($namespaceParts),\n 'namespace' => implode('\\\\', $namespaceParts),\n 'entityClass' => $this->getEntityItem()->getItemClassName(),\n 'editFields' => $this->prepareFieldList($this->_editFields),\n 'listFields' => $this->prepareFieldList($this->_listFields),\n 'maxLineLength' => self::MAX_LINE_LENGTH,\n ));\n }", "public function generate()\n {\n AnnotationRegistry::registerFile(\n __DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'\n );\n\n $driver = new AnnotationDriver(\n new CachedReader(new AnnotationReader(), new ArrayCache()),\n array(\n __DIR__ . '/../library/Xi/Filelib/Backend/Adapter/DoctrineOrm/Entity',\n )\n );\n\n $config = new Configuration();\n $config->setMetadataDriverImpl($driver);\n $config->setProxyDir(ROOT_TESTS . '/data/temp');\n $config->setProxyNamespace('Proxies');\n\n $em = EntityManager::create($this->connectionOptions, $config);\n\n $st = new SchemaTool($em);\n $metadata = $st->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());\n\n return join(\";\\n\", $metadata) . \";\\n\";\n }", "public function entityFor(): string;", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "function fromexp(){return \"`{$this->entity->name}`\"; }", "public function generate(ContentEntityInterface $entity);", "private function _model_generation()\n\t{\n\t\t$prefix = ($this->bundle == DEFAULT_BUNDLE) ? '' : Str::classify($this->bundle).'_';\n\n\t\t// set up the markers for replacement within source\n\t\t$markers = array(\n\t\t\t'#CLASS#'\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t'#LOWER#'\t\t=> $this->lower,\n\t\t\t'#TIMESTAMPS#'\t=> $this->_timestamps\n\t\t);\n\n\t\t// loud our model template\n\t\t$template = Utils::load_template('model/model.tpl');\n\n\t\t// holder for relationships source\n\t\t$relationships_source = '';\n\n\t\t// loop through our relationships\n\t\tforeach ($this->arguments as $relation)\n\t\t{\t\n\n\t\t\t// if we have a valid relation\n\t\t\tif(strstr($relation, ':')) :\n\n\t\t\t\t// split\n\t\t\t\t$relation_parts = explode(':', Str::lower($relation));\n\n\t\t\t\t// we need two parts\n\t\t\t\tif(! count($relation_parts) == 2) continue;\n\n\t\t\t\t$method = $this->method($relation_parts[1]);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#CLASS#'\t\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t\t\t'#SINGULAR#'\t\t=> Str::lower(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#PLURAL#'\t\t\t=> Str::lower(Str::plural($relation_parts[1])),\n\t\t\t\t\t'#METHOD#'\t\t\t=> $method,\n\t\t\t\t\t'#WORD#'\t\t\t=> Str::classify(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#WORDS#'\t\t\t=> Str::classify(Str::plural($relation_parts[1]))\n\t\t\t\t);\n\n\t\t\t\t// start with blank\n\t\t\t\t$relationship_template = '';\n\n\t\t\t\t// use switch to decide which template\n\t\t\t\tswitch ($relation_parts[0])\n\t\t\t\t{\n\t\t\t\t\tcase \"has_many\":\n\t\t\t\t\tcase \"hm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"belongs_to\":\n\t\t\t\t\tcase \"bt\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_one\":\n\t\t\t\t\tcase \"ho\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_one.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_many_and_belongs_to\":\n\t\t\t\t\tcase \"hbm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many_and_belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\telse:\n\n\t\t\t\t$method = $this->method($relation);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#METHOD#'\t\t=> $method,\n\t\t\t\t);\n\n\t\t\t\t$relationship_template = Utils::load_template('model/method.tpl');\n\n\t\t\tendif;\t\n\n\t\t\t// add it to the source\n\t\t\t$relationships_source .= Utils::replace_markers($rel_markers, $relationship_template);\n\t\t}\n\n\t\t// add a marker to replace the relationships stub\n\t\t// in the model template\n\t\t$markers['#RELATIONS#'] = $relationships_source;\n\n\t\t// add the generated model to the writer\n\t\t$this->writer->create_file(\n\t\t\t'Model',\n\t\t\t$prefix.$this->class_prefix.$this->class,\n\t\t\t$this->bundle_path.'models/'.$this->class_path.$this->lower.EXT,\n\t\t\tUtils::replace_markers($markers, $template)\n\t\t);\n\t}", "public function generate()\n {\n $this->createUsersEntity();\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function getCode()\n {\n return OrderModel::ENTITY;\n }", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "abstract public function getEntityTypeCode();", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}", "abstract public function generate();", "abstract protected function createEntities();", "public function run()\n {\n EntityType::create([\n 'en' => ['name' => 'offers'],\n 'ar' => ['name' => 'العروض'],\n ]);\n }", "public function generateCode() {\n $content = \"\";\n foreach ($this->arrTemplates as $template) {\n if (!file_exists($template)) {\n //Template not found\n continue;\n }\n $content .= file_get_contents($template);\n }\n \n foreach ($this->attributes as $key => $val) {\n $content = str_replace($this->placeHolderStart.$key.$this->placeHolderEnd, $val, $content);\n }\n return $content;\n }", "protected function body(Entity $entity, $prefix){\n $this->string .= \"EntitySql::getInstanceFromString('{$entity->getName()}', '{$prefix}')->_fields() . ',\n' . \";\n\n }", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function generate()\n {\n return parent::generate();\n }", "public function generateEntityClass(EntityInfo $entityInfo) {\n\t\t$placeHolders = array(\n\t\t\t'<namespace>',\n\t\t\t'<useStatements>',\n\t\t\t'<entityAnnotation>',\n\t\t\t'<entityClassName>',\n\t\t\t'<entityBody>'\n\t\t);\n\n\t\t$replacements = array(\n\t\t\t$this->generateEntityNamespace($entityInfo),\n\t\t\t$this->generateUseStatements($entityInfo),\n\t\t\t$this->generateEntityDocBlock($entityInfo),\n\t\t\t$this->generateEntityClassName($entityInfo),\n\t\t\t$this->generateEntityBody($entityInfo)\n\t\t);\n\t\t$code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\t\treturn str_replace('<spaces>', $this->spaces, $code);\n\t}", "public function generateInitCode();", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function run()\n {\n //\n\n $adv = new Entity;\n $adv->id_entity = 1;\n $adv->name = \"PIM\";\n $adv->path = \"pim3uyLRGnw6cxutO3p\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 10;\n $adv->name = \"DGX\";\n $adv->path = \"dgxS9qLNIUHql0jMHSE\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 11;\n $adv->name = \"WD\";\n $adv->path = \"wdmRVzLWPgEU1Xrydfu\";\n $adv->save();\n\n $adv = new Entity;\n $adv->id_entity = 12;\n $adv->name = \"EDB\";\n $adv->path = \"edbWspBfn1D27nGrgZm\";\n $adv->save();\n\n }", "protected function generateUseStatements(EntityInfo $entityInfo) {\n\t\t$lines = array();\n\t\t$useStatements = $entityInfo->getUseStatements();\n\t\tif($this->_entityNeedsCollectionTypes($entityInfo)) {\n\t\t\t//reflection gathered use statement array is indexed by lowercase aliases so by adding the use statements\n\t\t\t//below by using lowercase array keys we do not have to check for duplicates\n\t\t\t$useStatements[\"collection\"] = 'Doctrine\\Common\\Collections\\Collection';\n\t\t\t$useStatements[\"arraycollection\"] = 'Doctrine\\Common\\Collections\\ArrayCollection';\n\t\t}\n\t\tforeach($useStatements as $alias => $useClass) {\n\t\t\t$alias = strtoupper($alias);\n\t\t\t$CNA = explode(\"\\\\\", $useClass);\n\t\t\t$shortClassName = strtoupper(array_pop($CNA));\n\t\t\t$lines[] = 'use ' . $useClass\n\t\t\t\t. ($alias!=$shortClassName ? ' as ' . strtoupper($alias) : '') . ';';\n\t\t}\n\t\treturn (implode(\"\\n\", $lines));\n\t}", "abstract function getEntity();", "public function Build() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement it's \" .\n \"creation in the RDBMS.\"\n , debug_backtrace()\n );\n }", "function Generate()\n \t{\n \t\t\n \t}", "public function generate(Uigenentity $uigenEntity)\n {\n\t\t$this->uigenEntity = $uigenEntity;\n $this->routePrefix = $this->uigenEntity->getOption('prefix');\n $this->routeNamePrefix = str_replace('/', '_', $this->uigenEntity->getOption('prefix'));\n $this->actions = array('index', 'create', 'read', 'update', 'destroy');\n\n\t\tif($uigenEntity->getOption('dnd')){\n\t\t\t$this->actions[] = 'draganddrop';\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$uigenEntity->addRenderParams(array('actions' => $this->actions));\n\t\t\n $this->uigenEntity->renderFile('controller.php', $this->uigenEntity->getControllerPath().'/'.$this->uigenEntity->getEntityClassName().'Controller.php');\n\n $dir = $this->uigenEntity->getPublicPath().str_replace('\\\\', '/', $this->entity);\n\n if (!file_exists($dir)) {\n $this->filesystem->mkdir($dir, 0777);\n }\n\n $this->uigenEntity->renderFile('views/index.html.twig', $this->uigenEntity->getViewsPath().'/index.html');\n\n $this->uigenEntity->renderFile( 'js/grid.js', $this->uigenEntity->getPublicPath().'js/grid.js');\n\t\t$this->uigenEntity->renderFile('views/layout.html.twig', $this->uigenEntity->getViewsPath().'layout.html.twig');\n $this->uigenEntity->renderFile('tests/test.php', $this->uigenEntity->getTestPath().'/'.$this->uigenEntity->getEntityClassName().'ControllerTest.php');\n }", "abstract public function createTemplateEntity();", "private function __construct() {\n\t\t\\sky\\Sky::$twigLoader->addPath(\\sky\\Sky::location(\"helpers\").\"entityBuilder/\");\n\n\t}", "public function __toString() {\n\t\t$str = \"\";\n\t\t$str .= \"EntityMapperClassName: \" . $this->_entityMapperClassName . \"<br />\";\n\t\t$str .= \"EntityRelatedMapperClassName: \" . $this->_entityRelatedMapperClassName . \"<br />\";\n\t\t$str .= \"EntityRelatedPk: \" . $this->_entityRelatedPk. \"<br />\";\t\t\t\n\t\treturn $str;\t\t\t\n\t}", "public function generateSourceEntityClass(): bool\n {\n $folder = $this->getGeneratedEntitiesFolder();\n $repositoryFolder = $this->getGeneratedRepositoriesFolder();\n $file = $this->getSourceClassPath();\n $repositoryFile = $this->getRepositoryClassPath();\n $fileSystem = new Filesystem();\n\n if (!$fileSystem->exists($folder)) {\n $fileSystem->mkdir($folder, 0775);\n }\n if (!$fileSystem->exists($repositoryFolder)) {\n $fileSystem->mkdir($repositoryFolder, 0775);\n }\n\n if (!$fileSystem->exists($file)) {\n $classGenerator = $this->entityGeneratorFactory->createWithCustomRepository($this->nodeType);\n $repositoryGenerator = $this->entityGeneratorFactory->createCustomRepository($this->nodeType);\n $content = $classGenerator->getClassContent();\n $repositoryContent = $repositoryGenerator->getClassContent();\n\n if (false === @file_put_contents($file, $content)) {\n throw new IOException(\"Impossible to write entity class file (\" . $file . \").\", 1);\n }\n if (false === @file_put_contents($repositoryFile, $repositoryContent)) {\n throw new IOException(\"Impossible to write entity class file (\" . $repositoryFile . \").\", 1);\n }\n /*\n * Force Zend OPcache to reset file\n */\n if (function_exists('opcache_invalidate')) {\n opcache_invalidate($file, true);\n opcache_invalidate($repositoryFile, true);\n }\n if (function_exists('apcu_clear_cache')) {\n apcu_clear_cache();\n }\n\n \\clearstatcache(true, $file);\n \\clearstatcache(true, $repositoryFile);\n\n return true;\n }\n return false;\n }", "protected function entityName()\n {\n return static::ENTITY_CLASSNAME;\n }", "public function generate()\n {\n $placeHolders = [\n '<nameSpace>',\n '<useSpace>',\n '<annotation>',\n '<className>',\n '<body>',\n ];\n\n $replacements = [\n $this->generateNameSpace(),\n $this->generateUseStatements(),\n $this->generateAnnotation(),\n $this->generateClassName(),\n $this->generateBody(),\n ];\n\n $code = str_replace($placeHolders, $replacements, self::$classTemplate);\n\n return str_replace('<spaces>', $this->baseClass->getSpaces(), $code);\n }", "public function actionGenerate()\n {\n \\bariew\\yii2Tools\\tests\\FixtureManager::init();\n }", "abstract protected function getEntity();", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "function to_str(){\n //\n //Get the entity name using the magic function get parent since the \n //parent entity is protected \n $e = $this->column->get_parent();\n //\n //Include the alias\n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //compile the complete string version of the \n return \"`{$e->name}`.`{$this->column->name}` $alias\";\n }", "public function createEntity();", "private function generateTestClass()\n {\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $dir = $this->bundle->getPath() .'/Tests/Controller';\n $target = $dir .'/'. str_replace('\\\\', '/', $entityNamespace).'/'. $entityClass .'ControllerTest.php';\n\n $this->renderFile($this->skeletonDir, 'tests/test.php', $target, array(\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'actions' => $this->actions,\n 'dir' => $this->skeletonDir,\n ));\n }", "public function getCode() {\n\n $licence = '/*\n * Auto Generated Code for HomeNet\n *\n * Copyright (c) 2011 HomeNet.\n *\n * This file is part of HomeNet.\n *\n * HomeNet is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * HomeNet is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with HomeNet. If not, see <http ://www.gnu.org/licenses/>.\n */';\n return $licence;\n }", "abstract protected function createEntityInstance();", "protected abstract function getEntity(): string;", "protected function entityRenderKey() {\n return '';\n }", "public function getEntity();", "public function getEntity();", "public function getEntity();", "protected function generate()\n {\n $this->resultString = Stringy::create('');\n\n /*\n * @var Field\n */\n foreach ($this->values as $valueClass) {\n $this->resultString = $this->resultString->append($valueClass->getValue());\n }\n\n return (string) $this->resultString;\n }", "public function code()\n {\n $inventaire = $this->em->getRepository(\"AppBundle:Inventaire\")->findOneBy(['statut'=>true], ['id'=>'DESC']);\n //dump($inventaire->getReference());die();\n if ($inventaire){\n $id = $inventaire->getId() + 1;\n if ($id < 10) $reference = 'A00'.$id;\n elseif ($id<100) $reference = 'A0'.$id;\n else $reference = 'A'.$id;\n return $reference;\n }else{\n $reference = 'A001';\n return $reference;\n }\n }", "public function getContent(){\n\t\t$this->modelname = sprintf($this->format, $this->classname);\n\t\t$this->date = date('Y-m-d H:i:s');\n\t\t\n\t\t$templateFile = LUMINE_INCLUDE_PATH . '/lib/Templates/Model.tpl';\n\t\t$tpl = file_get_contents($templateFile);\n\t\t\n\t\t$start = \"### START AUTOCODE\";\n\t\t$end = \"### END AUTOCODE\";\n\t\t\n\t\t$originalFile = $this->getFullFileName();\n\t\t\n\t\t$class = '';\n\t\t$tpl = preg_replace('@\\{(\\w+)\\}@e','$this->$1',$tpl);\n\t\t\n\t\tif(file_exists($originalFile)){\n\t\t\t\n\t\t\t$content = file_get_contents($originalFile);\n\t\t\t$autoCodeOriginal = substr($content, strpos($content,$start)+strlen($start), strpos($content,$end)+strlen($end) - (strpos($content,$start)+strlen($start)));\n\t\t\t\n\t\t\t$autoCodeGenerated = substr($tpl, strpos($tpl,$start)+strlen($start), strpos($tpl,$end)+strlen($end) - (strpos($tpl,$start)+strlen($start)));\n\t\t\t\n\t\t\t$class = str_replace($autoCodeOriginal, $autoCodeGenerated, $content);\n\t\t\t\n\t\t} else {\n\t\t\t$class = $tpl;\n\t\t}\n\t\t\n\t\t\n\t\treturn $class;\n\t}", "protected function generateTestClass()\n {\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $dir = $this->bundle->getPath() .'/Tests/Controller';\n $target = $dir .'/'. str_replace('\\\\', '/', $entityNamespace).'/'. $entityClass .'RESTControllerTest.php';\n\n $this->renderFile('rest/tests/test.php.twig', $target, array(\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'entity' => $this->entity,\n 'bundle' => $this->bundle->getName(),\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'actions' => $this->actions,\n 'form_type_name' => strtolower(str_replace('\\\\', '_', $this->bundle->getNamespace()).($parts ? '_' : '').implode('_', $parts).'_'.$entityClass.'Type'),\n ));\n }", "function __toString(){\n\t\t$strings = array();\n\t\tforeach ($this->entities as $entity){\n\t\t\t$strings[] = sprintf(\"%s\", $entity);\n\t\t}\n\t\treturn implode($strings);\n\t}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function run()\n {\n $alphabet = ['а', 'б', 'в', 'г', 'д'];\n\n for($i = 0; $i <= 11; $i++) {\n for($j = 0; $j < 4; $j++) {\n $class = new ClassEntity();\n $class->letter = $alphabet[$j];\n $class->grade = $i + 1;\n $class->save();\n }\n }\n }", "public function generateSampleCode() {\n\t\t$sampleCode = new SampleCode();\n\t\treturn array($sampleCode);\n\t}", "protected function generateArticleCode() {\r\n\t\ttx_pttools_assert::isInRange($this->rowUid, 1, 99999);\r\n\t\t\r\n\t\tlist($usec, $sec) = explode(' ', microtime());\r\n \t\t$seed = (float) $sec + ((float) $usec * 100000);\r\n \t\tsrand($seed);\r\n\t\t$rand = rand(1, 9999);\r\n\t\t\r\n\t\tif($rand < 1000) $rand += 1000;\r\n\t\t\r\n\t\treturn sprintf(\"%s%05s\", $rand, $this->rowUid);\r\n\t}", "public function run() {\n\t\tif (empty($this->entId)) {\n\t\t\t$this->entId = config('gmf.ent.id');\n\t\t}\n\t\tif (empty($this->entId)) {\n\t\t\treturn;\n\t\t}\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ORG\")->name(\"组织\")\n\t\t\t\t->local('api/cbo/orgs/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_CURRENCY\")->name(\"币种\")\n\t\t\t\t->local('api/cbo/currencies/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_UOM\")->name(\"计量单位\")\n\t\t\t\t->local('api/cbo/units/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_DEPT\")->name(\"部门\")\n\t\t\t\t->local('api/cbo/depts/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_WORK\")->name(\"工作中心\")\n\t\t\t\t->local('api/cbo/works/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_WH\")->name(\"存储地点\")\n\t\t\t\t->local('api/cbo/whs/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PERSON\")->name(\"人员\")\n\t\t\t\t->local('api/cbo/persons/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PROJECT_CATEGORY\")->name(\"项目分类\")\n\t\t\t\t->local('api/cbo/project-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_PROJECT\")->name(\"项目\")\n\t\t\t\t->local('api/cbo/projects/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ITEM_CATEGORY\")->name(\"物料分类\")\n\t\t\t\t->local('api/cbo/item-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_ITEM\")->name(\"物料\")\n\t\t\t\t->local('api/cbo/items/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_TRADER_CATEGORY\")->name(\"客商分类\")\n\t\t\t\t->local('api/cbo/trader-categories/batch');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_TRADER\")->name(\"客商\")\n\t\t\t\t->local('api/cbo/traders/batch');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_CBO_DOC_TYPE\")->name(\"单据类型\")\n\t\t\t\t->local('api/cbo/doc-types/batch');\n\t\t});\n\n\t\t//业务数据\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MISCRCV\")->name(\"业务-杂收\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MISCSHIP\")->name(\"业务-杂发\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_TRANSIN\")->name(\"业务-库存调入\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_TRANSOUT\")->name(\"业务-库存调出\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MOCOMPLETE\")->name(\"业务-生产完工\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_MOISSUE\")->name(\"业务-生产领料\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_RCV\")->name(\"业务-采购收货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_RCVRTN\")->name(\"业务-采购退货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_SHIP\")->name(\"业务-销售出货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_SHIPRTN\")->name(\"业务-销售退货\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_AP_APBILL\")->name(\"业务-应付\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_ER_EXPENSEPLAN\")->name(\"业务-费用预算\")\n\t\t\t\t->local('api/amiba/doc-bizs/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\n\t\t//财务数据\n\t\tModels\\Dti::build(function (Builder $b) {\n\t\t\t$b->ent_id($this->entId)->category('u9')->code(\"P_ISV_TRANSDATA_TRADE_GL_VOUCHER\")->name(\"财务-凭证\")\n\t\t\t\t->local('api/amiba/doc-fis/batch'); $b->body('{\"FromDate\":\"#{fm_date}#\",\"toDate\":\"#{to_date}#\"}');\n\t\t});\n\t}", "function hook_uuid_entities_features_export_entity_alter(&$entity, $entity_type) {\n\n}", "public function generujKod(){\n\t\t//\n\t}", "public function generateObjectClass(array $variables): string\n {\n\n\n $template = __DIR__ . \"/../assets/classModel/Ling/template/UserObject2.phtml\";\n $content = file_get_contents($template);\n $namespace = $variables['namespace'];\n\n\n $objectClassName = $variables['objectClassName'];\n $baseClassName = 'Custom' . $variables['baseClassName'];\n $table = $variables['table'];\n $database = $variables['db'];\n $hasCustomClass = $variables['hasCustomClass'];\n $foreignKeysInfo = $variables['foreignKeysInfo'];\n $types = $variables['types'];\n $ric = $variables['ric'];\n $objectInterfaceName = $objectClassName . $variables['interfaceSuffix'];\n\n $namespaceClass = $this->getClassNamespace($namespace, 'Generated\\\\Classes');\n $namespaceBaseApi = $this->getClassNamespace($namespace, 'Custom\\\\Classes');\n $namespaceInterface = $this->getClassNamespace($namespace, 'Generated\\\\Interfaces');\n\n\n $fullTable = \"`$database`.`$table`\";\n $defaultValues = $this->container->get(\"sql_wizard\")->getMysqlWizard()->getColumnDefaultApiValues($fullTable);\n $sDefaultValues = trim(ArrayToStringTool::toPhpArray($defaultValues, true), '[]');\n $sDefaultValues = StringTool::indent($sDefaultValues, 8);\n\n\n $content = str_replace('// getDefaultValues.array.here', $sDefaultValues, $content);\n\n //--------------------------------------------\n //\n //--------------------------------------------\n if (true === $hasCustomClass) {\n $content = str_replace('class UserObject', 'abstract class UserObject', $content);\n }\n\n\n /**\n * replacing multiple insert first\n */\n $content = str_replace('// multipleInsertXXX', $this->getInsertMultipleMethod($variables), $content);\n\n\n $content = str_replace('UserObjectInterface', $objectInterfaceName, $content);\n $content = str_replace('The\\ObjectNamespace', $namespaceClass, $content);\n $content = str_replace('UserObject', $objectClassName, $content);\n $content = str_replace('BaseParent', $baseClassName, $content);\n $content = str_replace('theTableName', $table, $content);\n $content = str_replace('// insertXXX', $this->getInsertMethod($variables), $content);\n\n\n //--------------------------------------------\n // HEADER METHODS\n //--------------------------------------------\n $content = str_replace('// fetchFetchAllXXX', $this->getFetchFetchAllYYYMethod($variables), $content);\n $content = str_replace('// getXXX', $this->getGetUserByIdMethod($variables), $content);\n $content = str_replace('// getTheItems', $this->getItemsMethod($variables), $content);\n $content = str_replace('// getThe_ItemsColumn', $this->getItemsMethod($variables, 'getUserItemsColumn'), $content);\n $content = str_replace('// getThe_Items_Columns', $this->getItemsMethod($variables, 'getUserItemsColumns'), $content);\n $content = str_replace('// getThe_Items_Key2Value', $this->getItemsMethod($variables, 'getUserItemsKey2Value'), $content);\n $content = str_replace('// getTheItem', $this->getItemMethod($variables), $content);\n $content = str_replace('// getIdByXXX', $this->getIdByUniqueIndexMethods($variables), $content);\n\n $content = str_replace('// getItemsByForeignKeys', $this->getItemsByForeignKeysMethod($variables), $content);\n $content = str_replace('// getItemsByHas', $this->getItemsByHasMethod($variables), $content);\n $content = str_replace('// getItemXXXByHas', $this->getItemsXXXByHasMethod($variables), $content);\n\n $content = str_replace('// getAllXXX', $this->getAllMethod($variables), $content);\n $content = str_replace('// updateXXX', $this->getUpdateUserByIdMethod($variables), $content);\n $content = str_replace('// updateRawXXX', $this->getUpdateUserMethod($variables), $content);\n $content = str_replace('// deleteXXX', $this->getDeleteUserByIdMethod($variables), $content);\n $content = str_replace('// deleteYYY', $this->getDeleteMethod(), $content);\n\n\n $content = str_replace('// deleteByFkXXX', $this->getDeleteByFkMethod($variables), $content);\n\n\n if (1 === count($ric)) {\n $content = str_replace('// deletesXXX', $this->getDeleteUserByIdsMethod($variables), $content);\n }\n\n\n $uniqueIndexesVariables = $variables['uniqueIndexesVariables'];\n if ($uniqueIndexesVariables) {\n $uniqueVariables = $variables;\n foreach ($uniqueIndexesVariables as $set) {\n $uniqueVariables['ricVariables'] = $set;\n $content = str_replace('// getXXX', $this->getGetUserByIdMethod($uniqueVariables), $content);\n $content = str_replace('// updateXXX', $this->getUpdateUserByIdMethod($uniqueVariables), $content);\n// $content = str_replace('// updateRawXXX', $this->getRicMethod(\"updateUser\", $uniqueVariables), $content);\n $content = str_replace('// deleteXXX', $this->getDeleteUserByIdMethod($uniqueVariables), $content);\n $content = str_replace('// deletesXXX', $this->getDeleteUserByIdsMethod($uniqueVariables), $content);\n }\n }\n\n\n //--------------------------------------------\n // HAS TABLES\n //--------------------------------------------\n /**\n * For has tables (which ric is only composed of foreign keys, we often want to delete the entries based on only one of the\n * foreign keys (i.e. not both at the same time)\n *\n */\n $isHasTable = true;\n if ($foreignKeysInfo) {\n foreach ($ric as $column) {\n if (false === array_key_exists($column, $foreignKeysInfo)) {\n $isHasTable = false;\n }\n }\n } else {\n $isHasTable = false;\n }\n if (true === $isHasTable) {\n foreach ($ric as $column) {\n $fkRicVariables = $variables;\n $fkRicVariables['ricVariables'] = $this->getRicVariables([$column], $types); // hacking myself (faster)\n $content = str_replace('// deleteXXX', $this->getDeleteUserByIdMethod($fkRicVariables), $content);\n $content = str_replace('// deletesXXX', $this->getDeleteUserByIdsMethod($fkRicVariables), $content);\n }\n }\n\n\n // cleaning\n $content = str_replace('// getXXX', '', $content);\n $content = str_replace('// updateXXX', '', $content);\n $content = str_replace('// updateRawXXX', '', $content);\n $content = str_replace('// deleteXXX', '', $content);\n $content = str_replace('// deletesXXX', '', $content);\n\n\n // uses\n $uses = [];\n $uses[] = \"use \" . $namespaceBaseApi . \"\\\\$baseClassName;\";\n $uses[] = \"use \" . $namespaceInterface . \"\\\\$objectInterfaceName;\";\n\n $content = str_replace('// the uses', implode(PHP_EOL, $uses) . PHP_EOL, $content);\n return $content;\n\n }", "public function getEntityClassName() {}", "function __renderEntity($entity,$action,$data){\r\n\tTemplate::getInstance()->renderEntity($entity,$action,$data);\r\n}", "public static function IncludeEntity()\r\n\t{\t\r\n\t\t$entites = array(\"EeAppCategory\", \"EeAppApp\", \"EeAppUser\");\r\n\t\t\r\n\t\tforeach($entites as $entite)\r\n\t\t{\r\n include(\"Entity/\".$entite.\".php\");\r\n\t\t}\r\n\t}", "protected function generateEntityConstructor(EntityInfo $entityInfo) {\n\t\t$answer = '';\n\t\tif (!$this->hasMethod('__construct', $entityInfo)) {\n\t\t\t$collections = array();\n\t\t\t/** @var EntityAssociationInfo $associationInfo */\n\t\t\tforeach ($entityInfo->getAssociations() as $associationInfo) {\n\t\t\t\tif ($associationInfo->getType() & ClassMetadataInfo::TO_MANY) {\n\t\t\t\t\t$collections[] = '$this->'.$associationInfo->getFieldName().' = new ArrayCollection();';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($collections) {\n\t\t\t\t$answer = $this->prefixCodeWithSpaces(str_replace(\"<collections>\", implode(\"\\n\".$this->spaces, $collections), self::$constructorMethodTemplate));\n\t\t\t\t$this->staticReflection[\"methods\"][] = '__construct';\n\t\t\t}\n\t\t}\n\t\treturn $answer;\n\t}", "function custom_entity_generate_form($form, $form_state, $name) {\n $form['entity_label'] = array(\n '#type' => 'value',\n '#value' => $name,\n );\n $form['kill_entities'] = array(\n '#type' => 'checkbox',\n '#title' => t('<strong>Delete all @name</strong> before generating new @name.', ['@name' => $name]),\n '#default_value' => FALSE,\n );\n\n $form['num_entities'] = array(\n '#type' => 'textfield',\n '#title' => t('How many @name would you like to generate?', ['@name' => $name]),\n '#default_value' => 50,\n '#size' => 10,\n );\n\n $form['title_length'] = array(\n '#type' => 'textfield',\n '#title' => t('Max word length of titles'),\n '#default_value' => 4,\n '#size' => 10,\n );\n\n unset($options);\n $options[LANGUAGE_NONE] = t('Language neutral');\n if (module_exists('locale')) {\n $options += locale_language_list();\n }\n $form['add_language'] = array(\n '#type' => 'select',\n '#title' => t('Set language on @name', ['@name' => $name]),\n '#multiple' => TRUE,\n '#disabled' => !module_exists('locale'),\n '#description' => t('Requires locale.module'),\n '#options' => $options,\n '#default_value' => array(LANGUAGE_NONE => LANGUAGE_NONE),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Generate'),\n );\n $form['#redirect'] = FALSE;\n\n return $form;\n}", "function custom_entity_generate_entities_pre_entity(&$results) {\n module_load_include('inc', 'devel_generate');\n // Get user id.\n $users = devel_get_users();\n $users = array_merge($users, array('0'));\n $results['users'] = $users;\n}", "public function generate()\n\t{\n\t\tif ($this->init == false)\n\t\t\tthrow new Exception('Generator Error: Data must be initialized.');\n\t\t\n\t\t// table view\n\t\t$table = new Table($this->model->get_name(), $this->model->get_columns());\n\t\t$template = $this->files->read($this->tableTemplate->get_template());\n\t\t$table->set_body($template);\n\t\t$tbl = $table->generate();\n\t\t$table_view = $this->compiler->compile($tbl, $this->data);\n\t\t$table_view_path = $this->tableTemplate->get_path();\n\t\tif ($this->files->write($table_view_path, $table_view))\n\t\t\t$this->filenames[] = $table_view_path;\n\n\t\t// controller\n\t\t$template = $this->files->read($this->controllerTemplate->get_template());\n\t\t$controller = $this->compiler->compile($template, $this->data);\n\t\t$controller_path = $this->controllerTemplate->get_path();\n\t\tif ($this->files->write($controller_path, $controller))\n\t\t\t$this->filenames[] = $controller_path;\n\n\t\t// main view\n\t\t$template = $this->files->read($this->viewTemplate->get_template());\n\t\t$view = $this->compiler->compile($template, $this->data);\n\t\t$view_path = $this->viewTemplate->get_path();\n\t\tif ($this->files->write($view_path, $view))\n\t\t\t$this->filenames[] = $view_path;\n\n\t\t// model\n\t\t$template = $this->files->read($this->modelTemplate->get_template());\n\t\t$model = $this->compiler->compile($template, $this->data);\n\t\t$model_path = $this->modelTemplate->get_path();\n\t\tif ($this->files->write($model_path, $model))\n\t\t\t$this->filenames[] = $model_path;\n\t}", "public static function getCodeGenerator() {\n return new Q\\Codegen\\Generator\\Label(__CLASS__);\n }", "public function run()\n {\n $types = [\n ['name' => 'Controle de Animais', 'description' => 'Irregularidades que envolvem animais abandonados, selvagens e etc.'],\n ['name' => 'Iluminação', 'description' => 'Irregularidades que influenciam na qualidade da iluminação publica.'],\n ['name' => 'Acessibilidade', 'description' => 'Qualquer irregualridade que impeça o livre fluxo de estudantes / acesso de pessoas com necessidades especiais.'],\n ['name' => 'Poda', 'description' => 'Irregularidades que envolvem necessidade de podas de arvores e plantas em geral.'],\n ['name' => 'Colisão de veículo', 'description' => ''],\n ['name' => 'Problema de via', 'description' => ''],\n ['name' => 'Outros', 'description' => 'Qualquer outra irregularidade que não se encaixe nas outras opções'],\n ];\n\n foreach ($types as $type) {\n \\App\\Entities\\IrregularityType::create($type);\n }\n\n }", "function entity($entity) {\n if(array_key_exists($entity, $this->entities)) {\n $this->doc .= $this->entities[$entity];\n } else {\n $this->doc .= $this->_xmlEntities($entity);\n }\n }", "function generate() ;", "abstract protected function getEntityClass();", "public function generatecontrollerAction()\n\t{\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false');\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t$noincludes = array('file');\n\t\t\t$images = array();\n\t\t\t$functions = array();\n\t\t\t$widgets = array();\n\t\t\t$tables = array();\n\t\t\n\t\t\t$table = $post['table'];\t\t\t\n\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$table, Phalcon\\Db::FETCH_ASSOC);\n\n\t\t\t$postkeys = array_keys($post);\n\t\t\tforeach($postkeys as $var)\n\t\t\t{\n\t\t\t\t$v = explode('_',$var);\n\t\t\t\tif(isset($v[1]))\n\t\t\t\t{\n\t\t\t\t\tswitch($v[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\tarray_push($images,$v[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'functions':\n\t\t\t\t\t\t\tif(is_array($post[$var]))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($post[$var] as $function)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t$entity = $v[1];\n\t\t\t\t\t\t\t\t\t$value = explode('_',$function);\n\t\t\t\t\t\t\t\t\t$widgetentity = $value[0];\n\t\t\t\t\t\t\t\t\t$widgetentityid = $value[1];\n\t\t\t\t\t\t\t\t\t$table = array($entity,array('widgetentity' => $widgetentity,'widgetentityid' => $widgetentityid));\n\t\t\t\t\t\t\t\t\tarray_push($functions,$table);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'widget':\n\t\t\t\t\t\t\tarray_push($widgets,$v[1]);\n\t\t\t\t\t\tbreak;\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\tif($post[$var] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($tables,$var);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//get all tables\n\t\t\t$tablesq = $this->db->fetchAll(\"SHOW TABLES\", Phalcon\\Db::FETCH_ASSOC);\n\n\t\t\t//generate view relations for detail view\n\t\t\t$linkentityrelations = array();\n\t\t\t$entityrelations = array();\n\t\t\tforeach($tablesq as $tablex)\n\t\t\t{\t\t\n\t\t\t\t$table3 = explode('_',$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\tif(!isset($table3[1]))\n\t\t\t\t{\n\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE `\".$tablex['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($table.'id' == $column['Field'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($tablex['Tables_in_'.DATABASENAME] != 'acl')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($entityrelations,$tablex['Tables_in_'.DATABASENAME]);\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($table3[0] == $table || $table3[1] == $table)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($linkentityrelations,$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\t$controller = new Controller();\n\t\t\t$controller->entity = $post['table'];\n\t\t\t$controller->columns = $columns;\n\t\t\t$controller->relations = $entityrelations;\n\t\t\t$controller->linkrelations = $linkentityrelations;\n\t\t\t$controller->tables = $tables;\t\t\n\t\t\t$controller->images = in_array($table,$images);\t\t\n\t\t\techo $controller->totext();\n\t\t}\n\t\techo json_encode($status);\n\t}", "protected function getElementEntityProcessor() {}", "protected function getElementEntityProcessor() {}", "protected function generateTable(){\n\t\t$columns = $this->getConfig()->getColumns();\n\t\t$columns['magento_entity_id'] = array('type' => 'int');\n\n\t\t$sql = 'CREATE TABLE ' . $this->_table . '(';\n\n\t\tforeach ($columns as $name => $params) {\n\t\t\t$type = $this->getConfig()->getTypeForDatabase($params['type'], $name);\n\t\t\t$value = isset($params['default']) ? $params['default'] : 'NULL';\n\t\t\tif ($value != 'NULL') {\n\t\t\t\t$value = 'DEFAULT ' . $value;\n\t\t\t}\n\t\t\t$primary = isset($params['primary']) && $params['primary'] ? ' PRIMARY KEY' : '';\n\n\t\t\t$sql .= \"\\n\" . $name . \" \" . $type . \" \" . $value . $primary . \",\";\n\t\t}\n\t\t$sql = substr($sql, 0, -1) . ') ENGINE=InnoDB DEFAULT CHARSET=utf8;' . \"\\n\";\n\n\t\treturn $sql;\n\t}", "abstract protected function getEntityType(): string;", "public function getCode()\n {\n }", "function onGenerate()\n {\n try\n {\n TTransaction::open('permission');\n \n $object = $this->form->getData();\n \n $repository = new TRepository('Hardware');\n\n $criteria = new TCriteria;\n if ($object->secao)\n {\n $criteria->add(new TFilter('secao', 'like', \"%{$object->secao}%\"));\n }\n if ($object->descricao)\n {\n $criteria->add(new TFilter('descricao', 'like', \"%{$object->descricao}%\"));\n }\n\n if ($object->om)\n {\n $criteria->add(new TFilter('om', '=', \"{$object->om}\"));\n }\n \n \n $order = isset($param['order']) ? $param['order'] : 'id'; \n $criteria ->setProperty('order', $order); \n \n $hard = $repository->load($criteria);\n \n $format = $object->output_type;\n // print_r($militar);\n if ($hard)\n { \n $widths = array(25,30,30,40,40,40,30,60,60,60,70,80,150,50);\n \n switch ($format)\n {\n case 'html':\n $tr = new TTableWriterHTML($widths);\n break;\n case 'pdf':\n //alterei o parametro da classe para L paisagem\n $tr = new TTableWriterPDF($widths,'L');\n break;\n case 'rtf':\n if (!class_exists('PHPRtfLite_Autoloader'))\n {\n PHPRtfLite::registerAutoloader();\n }\n $tr = new TTableWriterRTF($widths);\n break;\n }\n \n if (!empty($tr))\n {\n // create the document styles\n $tr->addStyle('title', 'Arial', '6', '', '#d3d3d3', '#407B49');\n $tr->addStyle('datap', 'Arial', '6', '', '#000000', '#869FBB');\n $tr->addStyle('datai', 'Arial', '6', '', '#000000', '#ffffff');\n $tr->addStyle('header', 'Times', '12', '', '#000000', '#B5FFB4');\n $tr->addStyle('footer', 'Times', '6', '', '#2B2B2B', '#B5FFB4');\n \n // add a header row\n $tr->addRow();\n $tr->addCell('Relatório Materiais DTI 2017', 'center', 'header', 40);\n \n // add titles row\n $tr->addRow();\n $tr->addCell('OR', 'center', 'title');\n $tr->addCell('ID', 'center', 'title');\n $tr->addCell('DTI', 'center', 'title');\n $tr->addCell('PATR.', 'center', 'title');\n $tr->addCell('FICHA', 'center', 'title');\n $tr->addCell('Nr.Série.', 'center', 'title');\n $tr->addCell('DIEx', 'center', 'title');\n $tr->addCell('TREM', 'center', 'title');\n $tr->addCell('BOL', 'center', 'title');\n $tr->addCell('OM', 'center', 'title');\n $tr->addCell('SEÇÃO', 'center', 'title');\n $tr->addCell('MARCA', 'center', 'title');\n //$tr->addCell('MODELO', 'center', 'title');\n $tr->addCell('DESCRIÇÃO', 'center', 'title');\n $tr->addCell('DATA', 'center', 'title');\n\n $colour= FALSE;\n $i=0;\n foreach ($hard as $fer)\n {\n $i++;\n // $style = $colour ? 'datap' : 'datai';\n $style = 'datai';\n $tr->addRow();\n $tr->addCell($i, 'center', $style);\n $tr->addCell($fer->id, 'center', $style);\n $tr->addCell($fer->dti, 'center', $style);\n $tr->addCell($fer->patrimonio, 'center', $style);\n $tr->addCell($fer->ficha, 'center', $style);\n $tr->addCell($fer->nrSerie, 'center', $style);\n $tr->addCell($fer->diex, 'center', $style);\n $tr->addCell($fer->trem, 'center', $style);\n $tr->addCell($fer->boletim, 'center', $style);\n $tr->addCell($fer->om, 'center', $style);\n $tr->addCell($fer->secao, 'center', $style);\n $tr->addCell($fer->marca, 'center', $style);\n // $tr->addCell($fer->modelo, 'center', $style);\n $tr->addCell($fer->descricao, 'center', $style);\n $tr->addCell($fer->dataHard, 'center', $style);\n\n $colour = !$colour;\n }\n \n $tr->addRow();\n $tr->addCell(date('Y-m-d h:i:s'), 'center', 'footer', 15);\n if (!file_exists(\"app/output/dispositivo.{$format}\") OR is_writable(\"app/output/dispositivo.{$format}\"))\n {\n $tr->save(\"app/output/dispositivo.{$format}\");\n }\n else\n {\n throw new Exception(_t('Permission denied') . ': ' . \"app/output/dispositivo.{$format}\");\n }\n \n parent::openFile(\"app/output/dispositivo.{$format}\");\n \n new TMessage('info', 'Relatório gerado. Habilite o popup no seu navegador.');\n }\n }\n else\n {\n new TMessage('error', 'Dispositivo não encontrado');\n }\n \n $this->form->setData($object);\n \n TTransaction::close();\n }\n catch (Exception $e) \n {\n new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n \n TTransaction::rollback();\n }\n }", "static function appCreateEntity($entityName, $prefijo = '') {\n\n self::getConection();\n\n $entityBuilder = new EntityBuilder(self::$conectionDB, $entityName, $prefijo);\n\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n\n $model = $entityBuilder->GetModel();\n $fileModel = \"../../entities/models/{$entityFile}Entity.class.php\";\n\n $method = $entityBuilder->GetMethod();\n $fileMethod = \"../../entities/methods/{$entityFile}.class.php\";\n\n $okModel = self::createArchive($fileModel, $model);\n $okMethod = self::createArchive($fileMethod, $method);\n\n $result = array();\n ($okModel) ? array_push($result, \"Ok, {$fileModel} created\") : array_push($result, \"ERROR creating {$fileModel}\");\n ($okMethod) ? array_push($result, \"Ok, {$fileMethod} created\") : array_push($result, \"ERROR creating {$fileMethod}\");\n\n return $result;\n }", "public function buildViewEntity($configName, $entity);", "public function getEntity() {\n\t\treturn 'Custom Cloud Co.';\n\t}", "public function getContent()\n {\n $source_code = '';\n $_components = array_reverse($this->components);\n $_last = end($_components);\n\n foreach ($_components as $_component) {\n if ($_component != $_last) {\n $source_code .= \"{$this->tpl_obj->left_delimiter}private_inheritancetpl_obj file='$_component->filepath' child--{$this->tpl_obj->right_delimiter}\\n\";\n } else {\n $source_code .= \"{$this->tpl_obj->left_delimiter}private_inheritancetpl_obj file='$_component->filepath'--{$this->tpl_obj->right_delimiter}\\n\";\n }\n }\n\n return $source_code;\n }", "public function build()\n\t{\n\t\t$script = \"\";\n\t\t$this->addTable($script);\n\t\t$this->addIndices($script);\n\t\t$this->addForeignKeys($script);\n\t\treturn $script;\n\t}", "public static function generateDatabase()\n\t{\n\t\t$entities\t=\tself::getEntities();\n\t\t$query\t\t=\tself::$current_db->query('SHOW TABLES');\n\t\t$tables\t\t=\tarray();\n\n\t\twhile($table = $query->fetch(\\PDO::FETCH_NUM))\n\t\t\t$tables[]\t=\tstrtolower($table[0]);\n\n\t\tforeach($entities as $entity)\n\t\t{\n\t\t\tif( ! in_array(strtolower($entity::getTableName()), $tables))\n\t\t\t\t$entity::createTable();\n\t\t\telse\n\t\t\t\t$entity::updateTable();\n\t\t}\n\t}", "public function writeEntityClass(EntityInfo $entityInfo) {\n\t\t$path = $entityInfo->getEntityPath();\n\t\t$dir = dirname($path);\n\n\t\tif (!is_dir($dir)) {\n\t\t\tmkdir($dir, 0777, true);\n\t\t}\n\n\t\t$this->staticReflection = ['properties' => [], 'methods' => []];\n\t\t$classCode = $this->generateEntityClass($entityInfo);\n\n\t\t//echo \"SP: \" . json_encode($this->staticReflection);\n\t\t//echo '<hr /><b>METADATA(FINAL)</b>:<pre>'.print_r($entityInfo, true).'</pre>';\n\t\t//echo('<pre>' . htmlentities($classCode) . '</pre>');die();//@todo: KILLER LINE!!!\n\n\t\tfile_put_contents($path, $classCode);\n\t}" ]
[ "0.85135317", "0.6651294", "0.6615616", "0.6508623", "0.63875175", "0.6356612", "0.6240284", "0.6197398", "0.6104176", "0.61031663", "0.60996467", "0.60996467", "0.6099628", "0.6099628", "0.6099628", "0.6099628", "0.6099628", "0.6053485", "0.60358304", "0.6029271", "0.59321535", "0.593065", "0.5907243", "0.586685", "0.5858167", "0.58272517", "0.5801855", "0.57975435", "0.57975435", "0.57975435", "0.57975435", "0.57975435", "0.5772065", "0.57613164", "0.5759542", "0.57578325", "0.5740238", "0.57276", "0.5717913", "0.5712991", "0.5686666", "0.56836784", "0.5676721", "0.5665435", "0.5655569", "0.56523544", "0.5645824", "0.56214243", "0.5615321", "0.5599112", "0.5596094", "0.5576146", "0.5573505", "0.55659556", "0.55597925", "0.5534275", "0.55274564", "0.5521246", "0.5500562", "0.5500562", "0.5500562", "0.54996353", "0.5499153", "0.5490023", "0.5470694", "0.5457802", "0.544335", "0.5433784", "0.54320157", "0.543005", "0.54284126", "0.5425913", "0.5421287", "0.5419728", "0.54150033", "0.53906274", "0.5389719", "0.5386575", "0.53835785", "0.53665227", "0.53661716", "0.5366102", "0.5365229", "0.5337036", "0.53321034", "0.53318787", "0.5322241", "0.5320591", "0.5319054", "0.5312374", "0.53078246", "0.5299088", "0.52962345", "0.5289035", "0.5285603", "0.5281597", "0.5276944", "0.5274975", "0.5272913", "0.5266642" ]
0.7133943
1
Generate the structure array
public function GenerateStructure() { // WRITE CONSTRUCTOR $this->writeLine( sprintf( '$return = new pdoMap_Dao_Metadata_Table( \'%1$s\',\'%2$s\',\'%3$s\', \'%4$s\',\'%5$s\',\'%6$s\');', $this->name, // adapter name $this->getTableName(), // table name $this->entity->getClassName(), // entity class name $this->getInterface(), // interface service name $this->getAdapterClassName(), // adapter class name (if set) $this->getUse() // database connection ) ); // WRITE PROPERTIES $this->entity->GenerateProperties(); $this->writeLine('return $return;'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}", "public function generate() {\n\t\treturn [];\n\t}", "public function maker(): array;", "public function structure(): array\n {\n $structure = [];\n\n $structure['shipmentNumber'] = $this->shipmentNumber;\n\n $structure['packageNumber'] = $this->packageNumber;\n\n $structure['productType'] = $this->productType;\n\n $structure['weightReal'] = $this->weightReal;\n\n $structure['weightVoulmetric'] = $this->weightVoulmetric;\n\n $structure['width'] = $this->width;\n\n $structure['length'] = $this->length;\n\n $structure['height'] = $this->height;\n\n return $structure;\n }", "public function generateArray()\n {\n return $this->getProperties();\n }", "public function generate(): array;", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "public function getStructure() {}", "public function getStructure() {}", "public function build(): array;", "public function build(): array;", "public function getStructure();", "private function initialize_another_structure() {\n return array(\n array('#', '#', '#', '#', '#', '#', '#', '#'),\n array('#', '.', '.', '.', '.', '.', '.', '#'),\n array('#', '.', '#', '#', '#', '.', '.', '#'),\n array('#', '.', '.', '.', '#', '.', '#', '#'),\n array('#', '.', '#', '.', '.', '.', '.', '#'),\n array('#', '.', '.', '.', '.', '.', '.', '#'),\n array('#', '.', '#', '.', '#', '#', '.', '#'),\n array('#', 'X', '#', '.', '.', '.', '.', '#'),\n array('#', '#', '#', '#', '#', '#', '#', '#'),\n );\n }", "public function arrayStructure()\n\t{\n\t\treturn array();\n\t}", "private function createStructData()\n\t{\n\t\tforeach ($this->data as $item)\n\t\t{\n\t\t\t$row = array();\n\t\t\t\n\t\t\tforeach ($item as $key => $val)\n\t\t\t\tif( in_array($key, $this->col_show) && $key != $this->col_aggr_sum)\n\t\t\t\t\t$row[$key] = $val;\n\t\t\t\n\t\t\tif( count($row) )\n\t\t\t{\n\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t$row[$this->col_aggr_sum] = 0;\n\t\t\t\t\n\t\t\t\t$row['details'] = array();\n\t\t\t\t$this->data_show[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->data_show = array_unique($this->data_show, SORT_REGULAR);\n\t}", "public function DataGenerateArray() {\n $data = $this->GenerateArray();\n return $data['data']; \n }", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "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 create_calculation_array_matrix(){\n\t\t/*\n\t\t* Public and private sets of date for more complex frontend managament\n\t\t*/\n\t\t$calculation_array_matrix = array(\n\t\t\t\"public\" => array(\n\t\t\t\t'calc' => array()\n\t\t\t),\n\t\t\t\"auth\" => array(\n\t\t\t\t'calc_details' => array()\n\t\t\t)\n\t\t);\n\t\treturn $calculation_array_matrix;\n\t}", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "abstract public function generateData(array $data);", "public static function __structure()\n\t{\n\t\treturn array(\n\t\t\t'firstname'\t=>\t'VARCHAR(255)',\n\t\t\t'lastname'\t=>\t'VARCHAR(255)',\n\t\t);\n\t}", "public function definition()\n {\n $this->auto_increment += 1;\n return [\n \"name\" => $this->extracurricular[$this->auto_increment]['name'],\n \"slug\" => $this->extracurricular[$this->auto_increment]['slug'],\n \"year\" => $this->extracurricular[$this->auto_increment]['year']\n ];\n }", "public function get_structure_definition()\n {\n return array(\n array(\n 'name' => 'id',\n 'external_name' => 'ID',\n 'display_name' => self::s2p_t( 'Customer ID' ),\n 'type' => S2P_SDK_VTYPE_INT,\n 'default' => 0,\n 'regexp' => '^\\d{1,12}$',\n ),\n array(\n 'name' => 'merchantcustomerid',\n 'external_name' => 'MerchantCustomerID',\n 'display_name' => self::s2p_t( 'Merchant assigned customer ID' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'email',\n 'external_name' => 'Email',\n 'display_name' => self::s2p_t( 'Customer email' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n 'regexp' => '^[a-zA-Z0-9._%+-]{1,100}@[a-zA-Z0-9.-]{1,40}\\.[a-zA-Z]{1,8}$',\n ),\n array(\n 'name' => 'firstname',\n 'external_name' => 'FirstName',\n 'display_name' => self::s2p_t( 'Customer first name' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'lastname',\n 'external_name' => 'LastName',\n 'display_name' => self::s2p_t( 'Customer last name' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'gender',\n 'external_name' => 'Gender',\n 'display_name' => self::s2p_t( 'Customer gender' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'socialsecuritynumber',\n 'external_name' => 'SocialSecurityNumber',\n 'display_name' => self::s2p_t( 'Customer social security number' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'phone',\n 'external_name' => 'Phone',\n 'display_name' => self::s2p_t( 'Customer phone' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'company',\n 'external_name' => 'Company',\n 'display_name' => self::s2p_t( 'Customer company' ),\n 'type' => S2P_SDK_VTYPE_STRING,\n 'default' => '',\n ),\n array(\n 'name' => 'inputdatetime',\n 'external_name' => 'InputDateTime',\n 'display_name' => self::s2p_t( 'Customer creation date' ),\n 'type' => S2P_SDK_VTYPE_DATETIME,\n 'default' => '',\n ),\n );\n }", "public function definition(): array\n {\n $villageIds = Village::pluck('id')->toArray();\n $userIds = User::pluck('id')->toArray();\n\n return [\n 'alamat' => $this->faker->address,\n 'kode_pos' => $this->faker->numberBetween(10000, 99999),\n 'catatan' => $this->faker->realText,\n 'village_id' => $this->faker->randomElement($villageIds),\n 'user_id' => $this->faker->randomelement($userIds),\n ];\n }", "public function gen_dd_array()\n {\n $vec = array();\n if($result = $this->get($this->_table) )\n {\n foreach($result as $reg)\n { \n $vec[$reg->id] = $reg->name;\n }\n }\n return $vec;\n }", "public function createSchema(){\n //meta Data\n $this->rowNames = array_merge($this->rowNames,array(\n array(\"name\" => \"timestamp\" , \"type\" => \"timestamp\" ),\n array(\"name\" => \"user_id\" , \"type\" => \"number\" ),\n array(\"name\" => \"status\" , \"type\" => \"number\" ),\n array(\"name\" => \"checked_by_user\" , \"type\" => \"number\" )\n \n ));\n\n \t//geo Data\n $this->rowNames = array_merge($this->rowNames,array(\n array(\"name\" => \"_div\" , \"type\" => \"number\" ),\n array(\"name\" => \"_dist\" , \"type\" => \"number\" ),\n array(\"name\" => \"_upz\" , \"type\" => \"number\" ),\n array(\"name\" => \"_union\" , \"type\" => \"number\" ),\n array(\"name\" => \"_geoProxy\" , \"type\" => \"text\" )\n ));\n \n \n //form Data\n foreach ($this->keys as $key => $value) {\n //if not array simple\n if($value[\"type\"]!=\"textarray\"){\n $row = [];\n $row[\"name\"] = $key;\n $row[\"type\"] = $value[\"type\"];\n $this->rowNames[]=$row;\n }\n else{\n $types = explode(\"~\",$value[\"subtype\"]);\n for ($i=0; $i<$value[\"size\"]; $i++){\n $row=[];\n $row[\"name\"] = $key . \"_\" . $i;\n $row[\"type\"] = (isset($types[$i])? $types[$i] : $types[0]);\n $this->rowNames[]=$row;\n }\n }\n }\n \n \n// var_dump($this->rowNames);\n }", "protected function getStructure(): array\n {\n if (isset($this->structure)) {\n return $this->structure;\n }\n\n return [\n 'foo' => 'foo',\n 'money' => 'money substr:1|float:2',\n 'key' => 'nested.key int',\n 'new_key' => 'no_key default:bar',\n 'package.name' => 'name initials',\n 'baz' => 'Illuminate\\Support\\Str::after:hello',\n 'QUX' => 'qux Illuminate\\Support\\Str::upper',\n 'mid_char' => 'chars sampleCustom',\n ];\n }", "private function toArray()\n {\n \treturn array(\n \t\t'Locus'\t\t\t\t=> $this->getLoucs(),\n \t\t'Length'\t\t\t=> $this->getLength(),\n \t\t'Strandedness'\t\t=> $this->getStrandedness(),\n \t\t'mulType'\t\t\t=> $this->getMulType(),\n \t\t'Topology'\t\t\t=> $this->getTopology(),\n \t\t'PriAccession'\t\t=> $this->getPriAccession(),\n \t\t'AccessionVersion'\t=> $this->getAccessionVersion(),\n \t\t'OtherSeqIds'\t\t=> $this->getOtherSeqIds(),\n \t\t'Organism'\t\t\t=> $this->getOrganism(),\n \t\t'Taxonomy'\t\t\t=> $this->getTaxonomy(),\n \t\t'Source'\t\t\t=> $this->getSource(),\n \t\t'Refferences'\t\t=> $this->getRefs(),\n \t\t'Comment'\t\t\t=> $this->getComment(),\n \t\t'Features'\t\t\t=> $this->getFeatures(),\n \t\t'Sequence'\t\t\t=> $this->getSequence()\n \t);\n }", "private function _createData2()\n {\n return [\n 'fullCardContainerDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardTitleDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardTitleDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardDateDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardOldPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardOldPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardBinButtonDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardBinButtonDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardViewType' => 1,\n 'fullCardImagesPosition' => 1,\n 'fullCardDatePosition' => 1\n ];\n }", "private static function StructureList ()\n {\n return array (\n \"a\" => \"<a ###>$$$</a>\",\n \"button\" => \"<button ###>$$$</button>\"\n );\n }", "public function getStructuresData() : array {\n return $this->getMap()->getStructuresData([$this->systemId]);\n }", "public function toArray(): array\n {\n return $this->getStructure();\n }", "public function getStructure(): array\n {\n $structure = [];\n $objectVars = get_object_vars($this);\n\n foreach (get_class_vars(static::class) as $key => $value) {\n if (array_key_exists($key, $objectVars) && ($value === null || $value !== $objectVars[$key])) {\n $value = $objectVars[$key];\n }\n\n $structure[$key] = $value;\n }\n\n return $structure;\n }", "public function getDataStructure()\n\t{\n\t\t$sections = [];\n\t\tforeach($this->sections as $section) {\n\t\t\t$sections[] = [\n\t\t\t\t'name' => $section['name'],\n\t\t\t\t'blocks' => []\n\t\t\t];\n\t\t}\n\t\treturn $sections;\n\t}", "public function createData()\n {\n $data['locations'] = ['top', 'left', 'bottom'];\n\n $data['positions'] = [\n 'top' => $this->positionCount('top'), \n 'left' => $this->positionCount('left'),\n 'bottom' => $this->positionCount('bottom'),\n ];\n\n return (object) $data;\n }", "private function dataBaseRepresentation() {\n\t\t$array['website'] = $this->website;\n\t\t$array['name'] = $this->name;\n\t\t$array['country'] = $this->country;\n\t\treturn $array;\n\t}", "public function definition()\n {\n return [\n 'weight' => rand(1, 5),\n 'age' => rand(1, 5),\n 'number_of_eggs' => rand(10, 100),\n 'breed_id' => rand(1, 30),\n 'cell_id' =>rand(1, 30)\n ];\n }", "public function toArray()\n\t{\n\t\treturn $this->_structures;\n\t}", "public function getStructure()\n {\n // TODO: Implement getStructure() method.\n }", "public function generate()\n {\n return [\n 'tony stark', \n 'hulk', \n 'thor', \n 'mark zuckerberg', \n 'bill gates', \n 'larry page', \n 'loki',\n 'wonder woman', \n 'thanos', \n 'bilbo baggin', \n 'gal gadot', \n 'superman',\n ];\n }", "abstract protected function _generateDataCollection();", "public function run()\n {\n $list = [];\n $types = [\n ['6.20','6.56','6.92','7.28','7.64','8.00'],\n ['5.75','6.11','6.47','6.83','7.19','7.55'],\n ['4.4' ,'4.74','5.08','5.42','5.76','6.1' ,'6.44','6.78'],\n ['4' ,'4.34','4.68','5.02','5.36','5.7' ,'6.04','6.38'],\n ['2.34','2.67','3' ,'3.33','3.66','3.99','4.32','4.65','4.98'],\n ['2.1' ,'2.41','2.72','3.03','3.34','3.65','3.96','4.27','4.58','4.89'],\n ['1.86','2.06','2.26','2.46','2.66','2.86','3.06','3.26','3.46','3.66','3.86','4.06'],\n ['1.65','1.83','2.01','2.19','2.37','2.55','2.73','2.91','3.09','3.27','3.45','3.63'],\n ['1.5' ,'1.68','1.86','2.04','2.22','2.4' ,'2.58','2.76','2.94','3.12','3.3' ,'3.48'],\n ['1.35','1.53','1.71','1.89','2.07','2.25','2.43','2.61','2.79','2.97','3.15','3.33']\n ];\n $k=1;\n for($i=0; $i<count($types); $i++){\n for($j=0; $j<count($types[$i]); $j++){\n array_push($list,[\n 'nb_ma' => $k++,\n 'nb_heSoLuong' => $types[$i][$j],\n 'ng_ma' => $i+1,\n 'b_ma' => $j+1\n ]);\n }\n }\n DB::table('ngach_bac')->insert($list);\n }", "private function generateOutputData()\n {\n $output = [];\n $products = Cart::content();\n // Loop over the products to add the unit price and total in the right format.\n foreach ($products as $product) {\n $unit_price = $product->price / 100;\n $product->unit_price = number_format($unit_price, 2);\n // TODO Fix this hack\n $product->quantity = $product->qty;\n $product->total_price = number_format($unit_price * $product->qty, 2);\n\n $product->available = $product->model->isQuantityAvailable((int) $product->quantity);\n }\n\n $output['products'] = $products;\n $output['disable_creation'] = $products->isEmpty() && $this->getCustomerId() === null;\n $output['company'] = Company::find(1);\n $output['customer'] = Customer::find($this->getCustomerId());\n\n $elements = ['subtotal', 'tax', 'total'];\n // Use PHP magic to dynamically get the elements from the array\n // calling their respective functions from Cart.\n foreach ($elements as $element) {\n $output[$element] = (float) Cart::$element(2, '.', '') / 100;\n $output[$element] = number_format($output[$element], 2);\n }\n\n return $output;\n }", "public function constructData()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tarray('lineend' => \"\\12\"),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t\t'language' => 'en-gb',\n\t\t\t\t\t'direction' => 'ltr',\n\t\t\t\t\t'tab' => \"\\11\",\n\t\t\t\t\t'link' => '',\n\t\t\t\t\t'base' => ''\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('charset' => \"euc-jp\", 'mediaversion' => '1a2b3c4d'),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'euc-jp',\n\t\t\t\t\t'language' => 'en-gb',\n\t\t\t\t\t'direction' => 'ltr',\n\t\t\t\t\t'tab' => \"\\11\",\n\t\t\t\t\t'link' => '',\n\t\t\t\t\t'base' => '',\n\t\t\t\t 'mediaversion' => '1a2b3c4d'\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('language' => \"de-de\", 'direction' => 'rtl',\n\t\t\t\t\t'tab' => 'Crazy Tab', 'link' => 'http://joomla.org',\n\t\t\t\t\t'base' => 'http://base.joomla.org/dir'),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t\t'language' => 'de-de',\n\t\t\t\t\t'direction' => 'rtl',\n\t\t\t\t\t'tab' => \"Crazy Tab\",\n\t\t\t\t\t'link' => 'http://joomla.org',\n\t\t\t\t\t'base' => 'http://base.joomla.org/dir'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }", "private function dataBaseRepresentation() {\n\t\t$array['recipe'] \t\t= $this->recipeId;\n\t\t$array['name'] \t\t\t= $this->name;\n\t\t$array['description'] \t= $this->description;\n\t\t$array['url'] \t\t\t= $this->url;\n\t\treturn $array;\n\t}", "function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"ordinal\"=>$this->ordinal,\n\t\t\t\"visible\"=>$this->visible,\n\t\t\t\"iconoov\"=>$this->iconoov,\n\t\t\t\"name\"=>$this->name,\n\t\t\t\"idov_refered\"=>$this->idov_refered,\n\t\t\t\"idresource_refered\"=>$this->idresource_refered,\n\t\t\t\"type\"=>$this->type\n\t\t);\n\t\treturn $arr;\n\t}", "public static function generate()\n {\n $data = array();\n foreach (College::all() as $college) {\n # $current = The current year\n # $should = How many actieve assessors there is needed at the end of the year\n # $count = Count of all the active assessors\n $data[$college->id] = array(\n 'current' => date('Y'),\n 'should' => 1 + round(Assessors::where('fk_college', $college->id)->where('status', 1)->count() / 100 * 110),\n 'count' => Assessors::where('fk_college', $college->id)->where('status', 1)->count()\n );\n }\n return $data;\n }", "public function definition()\n {\n $sizes=['ml','g', 'Kg','kg', 'L','M','Cm','Moles'];\n return [\n 'product_id'=>mt_rand(1,9999),\n 'reorder_level'=>mt_rand(20,200),\n 'name' => mt_rand(100,1000).' '.$sizes[mt_rand(0,7)],\n 'sku' => mt_rand(1000000,9999999),\n 'status' => mt_rand(0,1),\n ];\n }", "public function definition()\n {\n return [\n\t\t\t'code' => 'AB' . Str::random(14),\n\t\t\t'discount_value' => $this->faker->randomNumber(2),\n\t\t\t'is_amount' => Arr::random([true, false]),\n\t\t\t'batch_id' => Batch::factory()\n ];\n }", "public function getArrayRapporteurStructure()\r\n {\r\n \t$arrStructs=array();\r\n \tforeach($this->rapporteurStructure as $structure){\r\n \t\t$arrStructs[] = array('id'=>$structure->getId(), 'libelle'=>$structure->getLibelle());\r\n \t}\r\n \treturn $arrStructs;\r\n }", "public function definition(): array\n {\n return [\n 'type' => Arr::random(array_keys(EntryFactoryClass::$entries)),\n ];\n }", "private function _createArraySt()\n {\n $this->arraySt = array(\n 0 => array(\"status\" => \"iniciado_ps\", \"label\" => \"Iniciado\"),\n 1 => array(\"status\" => \"aguardando_pagamento_ps\", \"label\" => \"Aguardando Pagamento\"),\n 2 => array(\"status\" => \"em_analise_ps\", \"label\" => \"Em análise\"),\n 3 => array(\"status\" => \"paga_ps\", \"label\" => \"Paga\"),\n 4 => array(\"status\" => \"disponivel_ps\", \"label\" => \"Disponível\"),\n 5 => array(\"status\" => \"em_disputa_ps\", \"label\" => \"Em Disputa\"),\n 6 => array(\"status\" => \"devolvida_ps\", \"label\" => \"Devolvida\"),\n 7 => array(\"status\" => \"cancelada_ps\", \"label\" => \"Cancelada\")\n );\n }", "public function definition()\n {\n $classOptions = ['Freshman', 'Sophomore', 'Junior', 'Senior'];\n $randomClassOption = $classOptions[array_rand($classOptions)];\n $genders = ['Male', 'Female'];\n $randomGender = $genders[array_rand($genders)];\n static $increment = 1;\n\n return [\n 'first_name' => $this->faker->firstName(),\n 'last_name' => $this->faker->lastName(),\n 'school_id' => $this->faker->randomDigit(),\n 'position' => $increment,\n 'class' => $randomClassOption,\n 'gender' => $randomGender,\n 'boys_one_singles_rank' => 99999,\n 'boys_two_singles_rank' => $increment,\n 'girls_one_singles_rank' => 99999,\n 'girls_two_singles_rank' => $increment,\n ];\n }", "protected function _getSampleReflectionData()\n {\n return [\n 'documentation' => 'Basic random string generator. This line is short description ' .\n 'This line is long description. This is still the long description.',\n 'interface' => [\n 'in' => [\n 'parameters' => [\n 'length' => [\n 'type' => 'int',\n 'required' => true,\n 'documentation' => 'length of the random string',\n ],\n ],\n ],\n 'out' => [\n 'parameters' => [\n 'result' => ['type' => 'string', 'documentation' => 'random string', 'required' => true],\n ],\n ],\n ]\n ];\n }", "public function definition()\n {\n $image = collect($this->image)->random();\n return [\n 'product_id' => Product::factory(),\n 'image' => [\n '125' => $image,\n '420' => $image,\n ],\n ];\n }", "public function definition()\n {\n $climate=['жаркий', 'умеренный', 'холодный'];\n $language=['русский', 'английский', 'немецкий', 'испанский', 'готов изучать местный'];\n $living=['высокий', 'средний', 'ниже среднего' , 'низкий'];\n $location_type=['мегаполис','небольшой город', 'у моря', 'у озера/реки', 'в горах'];\n return [\n 'climate'=>$climate[rand(0,2)],\n 'language'=>$language[rand(0,count($language)-1)],\n 'living'=>$living[rand(0,count($living)-1)],\n 'location_type'=>$location_type[rand(0,count($location_type)-1)],\n 'way_home'=>$this->faker->boolean,\n ];\n }", "private function _createData1()\n {\n return [\n 'shortCardContainerDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardInstanceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardTitleDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardTitleDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardDateDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardOldPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardOldPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardDescriptionDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardDescriptionDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardPaginationDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPaginationItemDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPaginationItemDesignTextModel' => [\n 'size' => 10\n ],\n ];\n }", "public function generateSampleCode() {\n\t\t$sampleCode = new SampleCode();\n\t\treturn array($sampleCode);\n\t}", "public function residue () :array\n {\n return [\n\n ];\n }", "protected function buildJSAbbreviationArray() {}", "function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }", "public function definition()\n {\n return [\n 'id_cms_statistics' => $this->faker->randomDigitNotNull,\n 'componentID' => $this->faker->word,\n 'component_name' => $this->faker->word,\n 'area_name' => $this->faker->word,\n 'sorting' => $this->faker->randomDigitNotNull,\n 'name' => $this->faker->word,\n 'config' => $this->faker->text,\n 'created_at' => $this->faker->date('Y-m-d H:i:s'),\n 'updated_at' => $this->faker->date('Y-m-d H:i:s')\n ];\n }", "public function __toString(){\n\t\t$str = \"{ \";\n\t\tforeach ( $this->attributes as $name=>$val) {\n\t\t\tif( is_array( $val))\n\t\t\t\t$val = new xo_array($val);\n\t\t\t$str .= \"'$name' = '$val',\";\n\t\t}\n\t\t//print_r( $this->attributes);\n\t\treturn \"$str } \". count( $this->attributes) . \" magic members.\";\t\n\t}", "public function definition()\n {\n return [\n 'patient_id' => Patient::factory()->create()->id,\n 'systolic_pressure' => rand(100, 200),\n 'diastolic_pressure' => rand(10, 100),\n ];\n }", "public function build() {\n return array();\n }", "protected function _generateAll()\r\n {\r\n $this->_data['generatedObjects'] = [];\r\n\r\n $this->_beforeGenerateBegin();\r\n $this->_generate($this->getInitialObject());\r\n $this->_afterGenerateEnd();\r\n\r\n return $this->_data['generatedObjects'];\r\n }", "function createLibClassArray(){\n return array(\n \"MA2090\",\n \"ED3700\",\n \"ML4220\",\n \"EL1000\",\n \"VA2010\",\n \"PY2010\",\n \"HI2681\",\n \"BS2400\",\n \"BS2401\",\n \"MA2310\",\n \"ED3820\",\n \"ML1100\",\n \"EL2206\",\n \"VA2020\",\n \"PY3410\",\n \"AS2112\",\n \"CP2220\",\n \"CP2221\",\n \"CS2511\",\n \"ED3950\",\n \"ML1101\",\n \"EL4312\",\n \"VA2030\",\n \"PY3420\",\n \"HI3091\",\n \"BS2410\",\n \"BS2411\",\n \"CS2511\",\n \"EL3865\",\n \"VA3100\",\n \"HI2810\",\n \"HI3002\",\n \"HI3011\",\n \"HI3021\"\n );\n }", "private function prepareObjectArray(){\n\t//scorro l' array $this->objarr settando su ciascun oggetto gli attributi children\n\tforeach($this->objarr as $key=>$object){\n\t\t//echo \"-\".$object->getAppendToIndex().\"<br />\";\n\t\t\n\t\tif(($appind=$object->getAppendToIndex()) != \"\"){\n\t\t\n\t\t$object->setIntegrated(true); //indico che l' oggetto è stato incluso come figlio di un altro.\t\n\t\t\n\t\t $objparent=$this->objarr[$appind];\n\t\t\t$objparent->appendChild($object);\t\n\t\t\t//echo $objparent->getIndex();\n\t\t}\n\t}\n}", "public function definition()\n {\n \t$userId = User::inRandomOrder()->first()->id;\n return [\n \"label_id\" => Label::where(\"label_type\",\"prefix\")->inRandomOrder()->first()->id,\n \"first_name\" => $this->faker->firstName,\n \"last_name\" => $this->faker->lastName,\n \"photo\" => [\n \t\t\"large\" => $this->faker->image(public_path('storage/contacts'),600,600,null, false),\n \t\t\"medium\" => $this->faker->image(public_path('storage/contacts'),300,300,null, false),\n \t\t\"small\" => $this->faker->image(public_path('storage/contacts'),150,150,null, false),\n ],\n \"company\" => $this->faker->company,\n \"job_title_id\" => JobTitle::inRandomOrder()->first()->id,\n \"note\" => $this->faker->country,\n \"added_by\" => $userId\n ];\n }", "public function definition(): array\n {\n return [\n 'type' => fake()->randomElement(['chopper', 'chopsoc', 'matchplay']),\n 'scorer' => fake()->randomElement(['stableford', 'vpar', 'gross', 'nett']),\n 'name' => fake()->word,\n 'date' => fake()->date(),\n 'course_id' => Course::factory(),\n ];\n }", "public function definition(): array\n {\n $organizer_id = Organizer::inRandomOrder()->first()->id ?? Organizer::factory()->create()->id;\n $event = Event::inRandomOrder()->whereOrganizerId($organizer_id)->first() ??\n Event::factory()->create(['organizer_id' => $organizer_id]);\n return [\n\n 'organizer_id' => $organizer_id,\n 'event_id' => $event->id,\n 'confirmed' => $this->faker->randomElement([0, 1]),\n 'status' => $this->faker->randomElement(ProposalPaymentTransferAdminStatus::all()),\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n\n 'sponsor_id' => function () {\n return Sponsor::inRandomOrder()->first()->id ?? Sponsor::factory()->create()->id;\n },\n 'package_id' => function () use ($event) {\n return SponsorshipPackage::inRandomOrder()->whereEventId($event->id)->first()->id ??\n SponsorshipPackage::factory()->create(['event_id' => $event->id])->id;\n },\n\n ];\n }", "public function printData() {\n $parent = new Helper($this->parent, $this->collection);\n $return = array(\n \"pages\" => $this->pages,\n \"title\" => $parent->retrieveTitle(),\n \"images\" => array()\n );\n\n // Run through each pointer.\n for ($i = 0; $i < count($this->compound); $i++) {\n $item = $this->compound[$i];\n\n // If we're on the same item, do not create a new class.\n if ($item[\"pointer\"] === $this->pointer) {\n $return[\"images\"][$i] = array(\n \"width\" => $this->getImageWidth(),\n \"height\" => $this->getImageHeight()\n );\n\n continue;\n }\n\n // Otherwise, create a temp class.\n $helper = new Helper($item[\"pointer\"], $this->collection);\n\n $return[\"images\"][$i] = array(\n \"width\" => $helper->getImageWidth(),\n \"height\" => $helper->getImageHeight()\n );\n }\n\n return $return;\n }", "public function create(): array\n {\n return array_map(fn() => self::newModel($this->model, $this->definition()), range(1, $this->count));\n }", "public static function getStructureDefinition() {\n $objectClass = get_called_class();\n $objectDef =& self::$_defaults[$objectClass];\n $definition = array();\n\n /** @var DataValue $d */\n foreach ($objectDef as $k => &$d) {\n $type = 'int';\n if ($d->dataType == DATATYPE_DATETIME || $d->dataType == DATATYPE_DATE) {\n $type = 'date';\n } else if ($d->dataType == DATATYPE_BOOL) {\n $type = 'bool';\n } else if ($d->dataType <= DATATYPE_INT) {\n $type = 'int';\n } else if ($d->dataType <= DATATYPE_DOUBLE) {\n $type = 'double';\n } else if ($d->dataType == DATATYPE_JSON) {\n $type = 'string';\n } else {\n $type = 'string';\n }\n $required = $d->flags & DATAFLAG_NOTNULL;\n $definition[$k] = array(\n 'type' => $type,\n 'required' => $required\n );\n }\n return $definition;\n }", "public function definition(): array\n {\n\n return [\n 'creationDatetime' => now(),\n 'leadId' => $this->faker->randomElement($this->getLeadIds()),\n 'partnerId' => $this->faker->randomElement($this->getPartnerIds()),\n 'campaignId' => $this->faker->randomElement($this->getCampaignIds()),\n 'oldBid' => random_int(10, 20),\n 'newBid' => random_int(20, 30),\n 'overBid' => random_int(1, 2),\n 'status' => $this->faker->randomElement([0, 1, 2]),\n 'auctionId' => $this->faker->randomElement($this->getPartnerIds()),\n ];\n }", "function make()\n{\n return [];\n}", "public function definition()\n {\n return [\n 'code' => sprintf('%05d',$this->faker->numberBetween($min = 10000, $max = 90000)),\n 'type' => sprintf('%05d',$this->faker->numberBetween($min = 10000, $max = 90000)),\n 'name' => $this->faker->numerify('자재 ###'), // '자재 609'\n 'model_code' => sprintf('%05d',$this->faker->numberBetween($min = 10000, $max = 90000)),\n 'color' => $this->faker->colorName,\n 'unit_code' =>sprintf('%05d',$this->faker->numberBetween($min = 10000, $max = 90000)),\n 'unit_qty' => $this->faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 1000)\n ];\n }", "public function packingCreate(array $array);", "public function definition(): array\n {\n $basePrice = $this->faker->randomFloat(2);\n\n $quantity = $this->faker->randomNumber();\n\n if (! isset($attributes['order_item_id'])) {\n $attributes['order_item_id'] = OrderItem::factory();\n }\n\n $orderItem = OrderItem::query()->find($attributes['order_item_id']);\n\n return [\n 'name' => $this->faker->word,\n 'sku' => $this->faker->unique()->ean13,\n 'qty' => $quantity,\n 'price' => $basePrice,\n 'base_price' => $basePrice,\n 'total' => $quantity * $basePrice,\n 'base_total' => $quantity * $basePrice,\n 'tax_amount' => 0,\n 'base_tax_amount' => 0,\n 'product_id' => $orderItem->product_id,\n 'product_type' => $orderItem->product_type,\n 'order_item_id' => $attributes['order_item_id'],\n 'invoice_id' => Invoice::factory(),\n ];\n }", "public function definition()\n {\n //Fields: [id, affair_id, name, description, step]\n $affairs_id = Affair::pluck('id')->toArray();\n\n $bureau_ids = Bureau::pluck('id')->toArray();\n return [\n 'affair_id' => $this->faker->randomElement($affairs_id),\n 'name' => implode($this->faker->unique()->words(rand(4, 7))),\n 'description' => $this->faker->paragraph(rand(4, 10)),\n 'responsible_bureau_id' => $this->faker->randomElement($bureau_ids),\n 'step' => $this->faker->randomElement([1,2,3,4,5,6,7,8,9,10])\n ];\n }", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function getArray() {\n \treturn array(\n \t\t\t'id' => $this->id,\n \t\t\t'name' => $this->name,\n \t\t\t'path' => $this->path,\n \t\t\t'description' => $this->description,\n \t\t\t'version' => $this->version,\n \t\t\t'groups' => $this->groups,\n \t\t\t'enabled' => $this->enabled\n \t);\n }", "public function definition()\n {\n $arrival = Carbon::now()->addWeeks($this->faker->randomElement([3, 5, 7, 8, 9, 10, 14, 21]));\n $return = Carbon::parse($arrival)->addDays($this->faker->randomElement([3, 5, 7, 8, 9, 10, 14, 21]));\n\n return [\n 'agent_id' => Agent::factory()->create(),\n 'product_id' => Product::factory()->create(),\n 'booking_ref' => Str::random(6),\n 'arrival_date' => $arrival,\n 'return_date' => $return,\n 'customer' => $this->customer(),\n 'vehicle' => $this->vehicle(),\n 'price' => $this->price(),\n 'flight' => $this->flight()\n ];\n }", "abstract public function generate();", "public function definition(): array\n {\n $firstName = $this->faker->name;\n $lastName = $this->faker->lastName;\n $name = implode(' ', [$firstName, $lastName]);\n $phone = $this->faker->numerify('3##########');\n\n return [\n 'first_name' =>$firstName,\n 'last_name' => $lastName,\n 'name' => $name,\n 'phone' => $phone,\n 'email' => $this->faker->unique()->safeEmail,\n 'password' => Hash::make($phone),\n 'remember_token' => Str::random(10),\n ];\n }", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function definition()\n {\n // $semesters = Semester::pluck('id')->toArray(); // Together\n\n return [\n 'number' => $this->faker->numberBetween($min = 1, $max = 16), // Watch out! the same number can repeat \n 'start_date' => $this->faker->date($format = 'Y-m-d', $max = 'now'),\n 'is_holiday_week' => $this->faker->boolean,\n 'semester_id' => Semester::factory(), // Used for the NestedForeach\n // 'semester_id' => $this->faker->randomElement($semesters), // Together\n ];\n }", "public static function toArray() {\n return [\n 'name' => static::getName(),\n 'identifier' => static::getIdentifier()\n ];\n }", "function as_struct()\n {\n $return = array();\n $entries = $this->entries();\n foreach ($entries as $entry) {\n $attrs = array();\n $entry_attributes = $entry->attributes();\n foreach ($entry_attributes as $attr_name) {\n $attr_values = $entry->getValue($attr_name, 'all');\n if (!is_array($attr_values)) {\n $attr_values = array($attr_values);\n }\n $attrs[$attr_name] = $attr_values;\n }\n $return[$entry->dn()] = $attrs;\n }\n return $return;\n }", "public function definition()\n {\n return [\n 'title' => 'Pengabdian Masyarakat Berupa Pengembangan Kegiatan Kewirausahaan Budidaya Lele Dan Hidroponik Pada Masyarakat Desa Sampora',\n 'institution_name' => 'RT 005 Desa Sampora, Cisauk, Tangerang Selatan ',\n 'benefit' => 'Banyak kegiatan Pengabdian kepada Masyarakat yang bertujuan memberdayakan masyarakat desa Sampora ',\n 'proof' => 'Perjanjian Kerja Sama No: 1652 /III/D-KJS.10.02/12/2019 ',\n 'is_international' => mt_rand(0, 5) % 2 == 0,\n 'is_national' => mt_rand(0, 5) % 2 == 0,\n 'is_local' => mt_rand(0, 5) % 2 == 0,\n 'start_at' => mt_rand(2015, 2030),\n 'finish_at' => mt_rand(2015, 2030),\n ];\n }", "public function definition()\n {\n return [\n // 'id_pesanan' => Pesanan::all()->random()->id,\n 'biaya_jahit' => $this->faker->randomFloat(null, 20000, 1000000),\n 'biaya_material' => $this->faker->randomFloat(null, 20000, 1000000),\n 'biaya_kirim' => $this->faker->randomFloat(null, 0, 50000),\n 'biaya_jemput' => $this->faker->randomFloat(null, 0, 50000),\n 'status_pembayaran' => $this->faker->randomElement(['2', '3', '4']),\n 'metode_pembayaran' => $this->faker->randomElement(['BANK', 'COD'])\n ];\n }", "public function getData() {\n\t\treturn [\n\t\t\t16 => [\"type\" => 0, \"value\" => $this->size]\n\t\t];\n\t}", "public function definition()\n {\n return [\n 'name' => $this->faker->randomElement($array = array ('Grupo 1','Grupo 2','Grupo 3','Grupo 4', 'Grupo 5','Grupo 6','Grupo 7','Grupo 8','Grupo 9')),\n 'id_course' => Course::all()->random()->id\n ];\n }", "public function generate() {\n\t\t$logo_schema_id = $this->context->site_url . Schema_IDs::ORGANIZATION_LOGO_HASH;\n\n\t\treturn [\n\t\t\t'@type' => 'Organization',\n\t\t\t'@id' => $this->context->site_url . Schema_IDs::ORGANIZATION_HASH,\n\t\t\t'name' => $this->helpers->schema->html->smart_strip_tags( $this->context->company_name ),\n\t\t\t'url' => $this->context->site_url,\n\t\t\t'sameAs' => $this->fetch_social_profiles(),\n\t\t\t'logo' => $this->helpers->schema->image->generate_from_attachment_meta( $logo_schema_id, $this->context->company_logo_meta, $this->context->company_name ),\n\t\t\t'image' => [ '@id' => $logo_schema_id ],\n\t\t];\n\t}" ]
[ "0.6884768", "0.6833363", "0.67278177", "0.66833436", "0.6651912", "0.6595621", "0.6515777", "0.6515664", "0.651423", "0.64832205", "0.64832205", "0.6461082", "0.64381063", "0.64225173", "0.6337857", "0.630125", "0.6258858", "0.61475164", "0.61192566", "0.61082524", "0.60594666", "0.6014897", "0.59891003", "0.59815174", "0.5966572", "0.5959321", "0.5875767", "0.58645356", "0.58522916", "0.58446395", "0.58351856", "0.58317685", "0.58280927", "0.5814917", "0.5800806", "0.5794601", "0.57903177", "0.5773989", "0.57680887", "0.5767691", "0.5751451", "0.5748063", "0.57184464", "0.5710441", "0.57054925", "0.5703703", "0.5700439", "0.56889755", "0.5680049", "0.5679509", "0.5670666", "0.5650533", "0.5646271", "0.5636809", "0.56284034", "0.5624815", "0.5618596", "0.56003267", "0.55945396", "0.5590363", "0.55867547", "0.557963", "0.5575355", "0.55692726", "0.55658764", "0.55630785", "0.55513895", "0.5546171", "0.55367786", "0.553593", "0.5534638", "0.5532808", "0.55322456", "0.5531618", "0.55305684", "0.55296165", "0.55293983", "0.55288213", "0.5525337", "0.5523563", "0.5523027", "0.55220556", "0.55209297", "0.55209297", "0.55209297", "0.55209297", "0.55209297", "0.5518193", "0.5506894", "0.55035686", "0.5503079", "0.5500444", "0.54962087", "0.5493284", "0.5487974", "0.5486981", "0.54826844", "0.5482556", "0.54819995", "0.5481473" ]
0.5979651
24
Make a new Factory instace
public function __construct(IlluminateRequest $request) { $this->request = $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function newFactory()\n {\n //\n }", "public function getFactory() {}", "public function make($factory);", "public function getFactory(): Factory;", "public function getFactory()\n {\n return new Factory();\n }", "protected static function newFactory()\n {\n return ExampleFactory::new();\n }", "protected static function newFactory(): Factory\n {\n return OrderPaymentFactory::new();\n }", "public static function factory()\r\n {\r\n return parent::factory(__CLASS__);\r\n }", "public static function create() {\n $factory = new static();\n return $factory->createFlo();\n }", "protected static function newFactory()\n {\n return LoanFactory::new();\n }", "protected static function newFactory()\n {\n return TypeFactory::new();\n }", "protected static function newFactory(): Factory\n {\n return HotelFactory::new();\n }", "protected static function newFactory(): Factory\n {\n return ProductInventoryFactory::new();\n }", "protected static function newFactory()\n {\n return PostFactory::new();\n }", "static public function factory($config) {}", "protected static function newFactory()\n {\n return UserFactory::new();\n }", "protected static function newFactory()\n {\n return UserFactory::new();\n }", "public static function newFactory()\n {\n return OrderFactory::new();\n }", "public static function newFactory()\n {\n return PriceFactory::new();\n }", "public static function newFactory()\n {\n return AdFactory::new();\n }", "public static function newFactory()\n {\n return PhoneFactory::new();\n }", "function factoryDefault();", "protected static function newFactory()\n {\n return StateFactory::new();\n }", "public static function newFactory()\n {\n return ReceiptFactory::new();\n }", "public function testFactoryCreation(): void\n {\n $factory = new Factory([\n 'base_path' => 'https://test.com',\n ]);\n $this->assertInstanceOf(Factory::class, $factory);\n }", "protected function createFactory()\n {\n $factory = Str::studly(class_basename($this->argument('name')));\n\n $this->call('make:factory', [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }", "public static function factory()\n {\n return new self;\n }", "protected static function newFactory(): Factory\n {\n return BookingProductEventTicketFactory::new();\n }", "protected function createFactory()\n {\n $factory = Str::studly($this->argument('name'));\n\n $this->call(FactoryMakeCommand::class, [\n 'name' => \"{$factory}Factory\",\n '--model' => $this->qualifyClass($this->getNameInput()),\n ]);\n }", "protected static function newFactory(): CustomerFactory\n {\n return CustomerFactory::new();\n }", "public function loadFactory()\n {\n $this->di = new Di\\FactoryDefault;\n\n return $this;\n }", "protected function createFactory()\n {\n\n $this->call('wizard:factory', [\n 'name' => $this->argument('name'),\n ]);\n }", "public function make() {}", "public static function factory() {\n\t\tstatic $instance;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "protected static function newFactory(): Factory\n {\n return ProductDownloadableLinkTranslationFactory::new();\n }", "static public function factory($config)\n {\n }", "public static function getFactory()\r\n\t{\r\n\t\treturn self::$factory;\r\n\t}", "public function make();", "public static function newFactory()\n {\n return ReturnOrderLineFactory::new();\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public abstract function make();", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function testFactory()\n {\n $processRequest = factory(\\App\\ProcessRequest::class)->create();\n $this->assertCount(1, ProcessRequest::all());\n }", "protected static function newFactory(): Factory\n {\n return MessageFactory::new();\n }", "public static function init() {\n\t\treturn Factory::get_instance( self::class );\n\t}", "public function getFactory()\n {\n return $this->_factory;\n }", "public function testFactory() {\n\t\t$this->assertInstanceOf( 'Wikibase\\Api\\WikibaseFactory', $this->factory );\n\t}", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "public function newInstance();", "public function newInstance();", "abstract protected function modelFactory();", "static function factory()\n {\n if (self::$_instance == NULL) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static abstract function createInstance();", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function getFactory(array $params = array())\n\t{\n\t\t$factory = clone $this;\n\t\t$factory->params = $params;\n\t\treturn $factory;\n\t}", "public function factoryMethod(): Product\n {\n return new ConcreteProduct1;\n }", "abstract function create();", "protected static function newFactory()\n {\n return MessageFactory::new();\n }", "static public function createFactory(array $inputs)\n\t{\n\t\t$registries = [];\n\t\tforeach($inputs as $input)\n\t\t{\n\t\t\t$registries[static::factoryType($input['identifier'], $input['type'])] = $input['class'];\n\t\t}\n\t\t\n\t\treturn new Factory($registries);\t\n\t}", "public static function factory($config = array())\n\t{\n\t\t$config = Kohana::config('furi');\n\n\t\t// Check for 'auto' driver and adjust configuration\n\t\tif ( strtolower($config->driver == 'auto') )\n\t\t{\n\t\t\tif ( function_exists('curl_init') )\n\t\t\t{\n\t\t\t\t$config->driver = 'cURL';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$config->driver = 'Stream';\n\t\t\t}\n\t\t}\n\t\t$driver = 'Furi_Driver_' . $config->driver;\n\n\t\t$fury = new $driver($config->as_array());\n\t\t\n\t\treturn $fury;\n\t}", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function newInstance(): object;", "function create(string $uri, $base_uri = null)\n{\n static $factory;\n\n $factory = $factory ?? new Factory();\n\n return $factory->create($uri, $base_uri);\n}", "public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }", "public function run()\n {\n //factory(App\\Contractor::class, 50)->create(); \n }", "protected static function newFactory()\n {\n return RoleFactory::new();\n }", "protected static function newFactory()\n {\n return RoleFactory::new();\n }", "public static function factory($flags = null, $class_name = null) {}", "public static function factory($flags = null, $class_name = null) {}", "public static function createFromFactory($tmp_name,$name){\n\t\treturn new static($tmp_name,$name);\n\t}", "protected static function newFactory(): \\Illuminate\\Database\\Eloquent\\Factories\\Factory\n {\n return CategoryFactory::new();\n }", "static function create(): self;", "public function getObjectFactory(): ObjectFactoryInterface;", "public static function newFactory()\n {\n return \\Database\\Factories\\DeployAccessTokenFactory::new();\n }", "public static function newFactory()\n {\n return InventorySupplyFactory::new();\n }", "public function testCreate()\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $factory = new components\\Factory();\n //Success\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"gitlab\"), new components\\platforms\\Gitlab([]));\n $this->assertEquals($factory->create(\"bitbucket\"), new components\\platforms\\Bitbucket([]));\n //Exception Case\n $this->expectException(\\LogicException::class);\n $platform = $factory->create(\"Fake\");\n\n }", "public function run()\n {\n factory(Clase::Class,15)->create();\n }", "public function testFactory()\n {\n $entity = $this->account->getServiceManager()->get(\"EntityFactory\")->create(\"notification\");\n $this->assertInstanceOf(\"\\\\Netric\\\\Entity\\\\ObjType\\\\NotificationEntity\", $entity);\n }", "public function testCreatesGivesValidFactory()\n {\n $factory = OpenExchangeRatesFactory::create(['key' => '']);\n $this->assertInstanceOf('Amelia\\Money\\FactoryInterface', $factory);\n }", "protected static function newFactory()\n {\n return new LocationFactory();\n }", "public function getQomFactory() {}", "public static function i(): ServicesFactory\n {\n return parent::getInstance();\n }", "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();" ]
[ "0.8439911", "0.83880466", "0.83268446", "0.8133495", "0.80076325", "0.78992486", "0.7656256", "0.75848705", "0.7529816", "0.74936485", "0.74830234", "0.747954", "0.74587446", "0.739582", "0.73857987", "0.7382707", "0.7382707", "0.7379845", "0.73763", "0.7375955", "0.7327311", "0.7301917", "0.7301697", "0.7250132", "0.7240396", "0.72400695", "0.72295094", "0.72157043", "0.7198838", "0.7161026", "0.7112461", "0.70895356", "0.7077941", "0.70404166", "0.7031658", "0.7025798", "0.7015999", "0.7009701", "0.7005083", "0.6977187", "0.6977187", "0.6977187", "0.6974429", "0.6964343", "0.6964343", "0.6964343", "0.6964343", "0.6964343", "0.6964343", "0.6964343", "0.6964343", "0.6957603", "0.6950679", "0.6940786", "0.6907426", "0.69041455", "0.6903215", "0.68741566", "0.68741566", "0.68562895", "0.68232185", "0.68231314", "0.6790841", "0.67531496", "0.67273635", "0.6726856", "0.6722133", "0.6717539", "0.6715924", "0.67131895", "0.67032987", "0.66887707", "0.6678022", "0.66574425", "0.6655738", "0.6655738", "0.66515523", "0.66515523", "0.6617378", "0.6605098", "0.65990615", "0.6593729", "0.6582267", "0.65796363", "0.657095", "0.65577227", "0.6539137", "0.652576", "0.6522368", "0.65184677", "0.65012753", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544", "0.6498544" ]
0.0
-1
Factory a new DataTable builder instance
public function builder() { $builder = new Builder($this->request); return $builder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function init_datatable(): stdClass\n {\n $columns[\"com_cliente_id\"][\"titulo\"] = \"Id\";\n $columns[\"com_cliente_codigo\"][\"titulo\"] = \"Código\";\n $columns[\"com_cliente_razon_social\"][\"titulo\"] = \"Razón Social\";\n $columns[\"com_cliente_rfc\"][\"titulo\"] = \"RFC\";\n $columns[\"cat_sat_regimen_fiscal_descripcion\"][\"titulo\"] = \"Régimen Fiscal\";\n $columns[\"com_cliente_n_sucursales\"][\"titulo\"] = \"Sucursales\";\n\n $filtro = array(\"com_cliente.id\", \"com_cliente.codigo\", \"com_cliente.razon_social\", \"com_cliente.rfc\",\n \"cat_sat_regimen_fiscal.descripcion\");\n\n $datatables = new stdClass();\n $datatables->columns = $columns;\n $datatables->filtro = $filtro;\n\n return $datatables;\n }", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "public function getDatatable() {\n $es = Family::select('id', 'family_name', 'description', 'created_at', 'updated_at');\n return Datatables::of($es)->make();\n }", "public static function makePatientDataTable()\n {\n $dt = DataTable::make(\n \"SELECT provider_id, provider, lname, fname, DOB, pid\n FROM (\n SELECT U.id AS provider_id, CONCAT(U.lname, ', ', U.fname) AS provider, PD.lname, PD.fname, PD.DOB, PD.pid\n FROM patient_data PD\n LEFT JOIN mi2_users_patients MUP ON PD.pid = MUP.pid\n LEFT JOIN users U on U.id = MUP.user_id\n GROUP BY PD.pid\n UNION ALL\n SELECT S.id AS provider_id, CONCAT(S.lname, ', ', S.fname) AS provider, PD.lname, PD.fname, PD.DOB, PD.pid\n FROM patient_data PD\n LEFT JOIN mi2_users_patients MUP ON PD.pid = MUP.pid\n LEFT JOIN mi2_users_supervisors MUS ON MUP.user_id = MUS.user_id\n LEFT JOIN users S ON S.id = MUS.super_user_id\n GROUP BY PD.pid\n ) T\",\n \"patient-data-table\",\n \"/interface/modules/custom_modules/oe-patient-privacy/index.php?action=admin!patient_data\",\n new PatientRowAttributeFilter())\n ->addColumn([\"title\" => \"Provider ID\", \"field\" => \"provider_id\", \"visible\" => false])\n ->addColumn([\"title\" => \"Provider\", \"field\" => \"provider\", \"visible\" => false])\n ->addColumn([\"title\" => \"Last Name\", \"field\" => \"lname\"])\n ->addColumn([\"title\" => \"First Name\", \"field\" => \"fname\"])\n ->addColumn([\"title\" => \"DOB\", \"field\" => \"DOB\"])\n ->addColumn([\"title\" => \"PID\", \"field\" => \"pid\"])\n ->groupBy(\"pid\");\n return $dt;\n }", "public function getDatagridViewBuilder();", "public function getDatatable() {\n \treturn datatables()->of(\\App\\Models\\Class_::all())->make(true);\n }", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public function anyData()\n {\n $datatables = $this->datatables();\n #custome datatable yajra in here \n return $datatables->make(true);\n }", "public function build()\n {\n if (empty($this->tables)) {\n throw new \\InvalidArgumentException('Please define your tables first using the tables() method');\n }\n\n if (empty($this->fields)) {\n throw new \\InvalidArgumentException('Please define your fields first using the fields() method');\n }\n\n $tables = $this->getTableCollection();\n $usedTables = new TableCollection();\n\n $fields = $this->getFieldCollection();\n $columns = $this->columns ? $this->columns : array('*');\n\n $this->criteria->build(\n $this->builder,\n $tables,\n $usedTables,\n $fields,\n $columns\n );\n\n return $this->builder;\n }", "protected function createDbTable(Zend_Db_Table_Abstract $table, $where=null, $order=null, $count=null, $offset=null)\n {\n return new Zend_Test_PHPUnit_Db_DataSet_DbTable($table, $where, $order, $count, $offset);\n }", "function datatable()\n {\n return $this->table($this->table);\n }", "public function createBuilder();", "private function createQueryBuilder(): QueryBuilder\n {\n $queryBuilder = new QueryBuilder();\n $queryBuilder->table(($this->model)::TABLE);\n $this->applyCriteria($queryBuilder);\n $this->applyQueryBuilderUses($queryBuilder);\n return $queryBuilder;\n }", "public function getEmptyClone()\n {\n $clone = new Piwik_DataTable;\n $clone->queuedFilters = $this->queuedFilters;\n $clone->metadata = $this->metadata;\n return $clone;\n }", "private function createTableHelper()\n {\n $tableHelper = new TableHelper();\n $tableHelper->setLayout(TableHelper::LAYOUT_COMPACT);\n $tableHelper->setPadType(STR_PAD_LEFT);\n\n return $tableHelper;\n }", "private function createBuilder()\n {\n $class = get_class($this->data->getModel());\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 }", "public function html(): Builder\n {\n /** @var Builder $table */\n $table = app('datatables.html');\n\n return $table\n ->columns($this->getColumns())\n ->ajax($this->getAjaxOptions())\n ->parameters($this->getParameters());\n }", "protected function createDbTable(\\Zend\\Db\\Table\\AbstractTable $table, $where=null, $order=null, $count=null, $offset=null)\n {\n return new Db\\DataSet\\DbTable($table, $where, $order, $count, $offset);\n }", "abstract public function datatables();", "protected function getDataSchema(): MySqlBuilder\n {\n /* @noinspection PhpUndefinedMethodInspection */\n return \\Schema::connection('data_connection');\n }", "private static function emptyDataTable($timezone)\n {\n $datatable = '\\Khill\\Lavacharts\\DataTablePlus\\DataTablePlus';\n\n if (class_exists($datatable) === false) {\n $datatable = '\\Khill\\Lavacharts\\DataTables\\DataTable';\n }\n\n return new $datatable($timezone);\n }", "public static function create($data)\n {\n $name = $data['name'];\n $language = $data['language'];\n $columnOption = $data['columnOption'];\n $specificColumns = $data['specificColumns'];\n return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns);\n }", "public function dataTable();", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public static function build_html_datatable($columns=null,$table_id=\"datatable1\")\n{\n$html=null;\n$html_columns=null;\n\n//lets extract the columns names from the string\nif ( !empty($columns) ) \n $columns=explode(\",\",$columns);\nelse \n die(\" $columns columns array must be defined, such as col1,col2,col3\");\n \n//build the header loop through the array and of columns \n$count_cols=count($columns);\nforeach($columns as $key=>$val)\n $html_columns.=\"<td>\".trim($val).\"</td>\\n\";\n \n$html = <<< EOT\n<!-- Start of Generated HTML Datatables structure -->\n<table cellpadding='1' cellspacing='1' border='0' class='display' id='$table_id'>\n\n<thead>\n<tr>\n$html_columns\n</tr>\n</thead>\n<tbody>\n<tr><td colspan='$count_cols' class='dataTables_empty'>Loading data from server\n\n</td></tr>\n</tbody>\n</table>\n\n\n\nEOT;\n\nreturn $html;\n}", "public function createBuilder(array $data = array(), array $options = array());", "public function createDataRow()\n\t{\n\t\t$row = array() ;\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$row[$field] = $this->$field ;\n\t\t}\n\t\treturn $row ;\n\t}", "public function build(){\r\n\r\n $columns = '';\r\n\r\n if(!is_null($this->table)){\r\n\r\n //run the drop table query before creating the new one\r\n if($this->_dropifexists){\r\n $this->database->rawQuery('DROP TABLE IF EXISTS '.$this->table.';');\r\n }\r\n \r\n $this->_sqlquery .= 'CREATE TABLE '.$this->table.' ';\r\n\r\n //process columns\r\n foreach($this->_sqlcols as $column => $attributes){\r\n $columns .= $column.' '.join(' ', $attributes).',';\r\n }\r\n\r\n //process primary column\r\n if(!is_null($this->_primary)){\r\n $columns .= 'primary key ('.$this->_primary.')';\r\n }\r\n\r\n //process unique columns\r\n if(count($this->_unique) !== 0){\r\n $columns .= 'UNIQUE ('.join(',', $this->_unique).')';\r\n }\r\n\r\n //foreign key\r\n if(count($this->_fk) !== 0){\r\n $columns .= $this->_parseFKConstraints($this->_fk);\r\n }\r\n\r\n //trim commas\r\n $columns = rtrim($columns, ',');\r\n\r\n $this->_sqlquery .= '('.$columns.')';\r\n }\r\n\r\n return $this->database->rawQuery($this->_sqlquery);\r\n }", "protected function setUpTable()\n {\n return new Table('foo', array($this->oldColumn));\n }", "public static function builder();", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->parameters([\n 'dom' => \"Brt<'datatables__info_wrap'plfi<'clearfix'>>\",\n 'buttons' => $this->getBuilderParameters(),\n 'initComplete' => 'function () {$(\\'.checkboxes\\').uniform(); $(\\'.dataTables_wrapper\\').css({\\'width\\': $(\\'.dataTable\\').width()});\n var index = 0;\n var totalLength = this.api().columns().count();\n var self = this;\n this.api().columns().every(function () {\n var column = this;\n \n index++;\n if (index == totalLength) {\n var searchBtn = document.createElement(\"a\");\n $(searchBtn).addClass(\"btn btn-info btn-sm btn-search-table tip\").attr(\"data-original-title\", \"Search\").appendTo($(column.footer())).html(\"<i class=\\'fa fa-search\\'></i>\");\n var clearBtn = document.createElement(\"a\");\n $(clearBtn).addClass(\"btn btn-warning btn-sm btn-reset-table tip\").attr(\"data-original-title\", \"Clear search\").appendTo($(column.footer())).html(\"<i class=\\'fa fa-times\\'></i>\");\n } else {\n if ($(column.footer()).hasClass(\"searchable\")) {\n var input = document.createElement(\"input\");\n $(input).addClass(\"form-control input-sm\");\n //if ($(column.footer()).hasClass(\"datepicker\")) {\n // $(column.footer()).removeClass(\"datepicker\");\n // $(input).addClass(\"datepicker\");\n //}\n \n var placeholder = \"Search...\";\n if ($(column.footer()).hasClass(\"searchable_id\")) {\n placeholder = \"...\";\n }\n $(input).prop(\"type\", \"text\").css(\"width\", \"100%\").prop(\"placeholder\", placeholder).appendTo($(column.footer()).empty())\n .on(\"change\", function () {\n column.search($(this).val()).draw();\n });\n }\n }\n });\n }',\n 'drawCallback' => 'function () {\n $(\".checkboxes\").uniform();\n \n //$(\"#dataTableBuilder tfoot tr\").prependTo($(\"#dataTableBuilder tbody\"));\n //$(\"#dataTableBuilder tfoot\").remove();\n \n $(document).on(\"click\", \".btn-search-table\", function () {\n $(\"#dataTableBuilder tfoot tr input\").trigger(\"change\");\n });\n \n $(\".tip\").tooltip({placement: \"top\"});\n }',\n 'paging' => true,\n 'searching' => true,\n 'info' => true,\n 'searchDelay' => 350,\n 'bStateSave' => true,\n 'lengthMenu' => [\n [10, 30, 50, -1],\n [10, 30, 50, trans('bases::tables.all')]\n ],\n 'pageLength' => 10,\n 'processing' => true,\n 'serverSide' => true,\n 'bServerSide' => true,\n 'bDeferRender' => true,\n 'bProcessing' => true,\n 'language' => [\n 'aria' => [\n 'sortAscending' => 'orderby asc',\n 'sortDescending' => 'orderby desc'\n ],\n 'emptyTable' => trans('bases::tables.no_data'),\n 'info' => '<span class=\"dt-length-records\"><i class=\"fa fa-globe\"></i> <span class=\"hidden-xs\">' . trans('bases::tables.show_from') . '</span> _START_ ' . trans('bases::tables.to') . ' _END_ ' . trans('bases::tables.in') . ' <span class=\"badge bold badge-dt\">_TOTAL_</span> <span class=\"hidden-xs\">' . trans('bases::tables.records') . '</span></span>',\n 'infoEmpty' => trans('bases::tables.no_record'),\n 'infoFiltered' => '(' . trans('bases::tables.filtered_from') . ' _MAX_ ' . trans('bases::tables.records') . ')',\n 'lengthMenu' => '<span class=\"dt-length-style\">_MENU_</span>',\n 'search' => '',\n 'zeroRecords' => trans('bases::tables.no_record'),\n 'processing' => '<img src=\"' . url('/vendor/core/images/loading-spinner-blue.gif') . '\" />',\n ],\n ]);\n }", "public function dataTable()\n {\n return (new EloquentDataTable($this->query()))\n ->addColumn('menus', function (Navigation $nav) {\n return '<span class=\"badge label-primary\">' . $nav->menus()->count() . '</span>';\n })\n ->editColumn('title', function (Navigation $navigation) {\n return html()->linkRoute('administrator.navigation.edit', $navigation->title, $navigation);\n })\n ->addColumn('action', function (Navigation $nav) {\n return view('administrator.navigation.datatables.action', $nav->toArray());\n })\n ->rawColumns(['menus', 'published', 'action'])\n ->editColumn('published', function (Navigation $row) {\n return dt_check($row->published);\n });\n }", "protected function table()\n {\n $table = new Table(new Client);\n\n $table->column('id', 'ID');\n $table->column('name', __('name'));\n $table->column('created_at', trans('admin.created_at'));\n $table->column('updated_at', trans('admin.updated_at'));\n\n return $table;\n }", "public function createBuilder($name, $data = null);", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "public function getBuilder();", "private function createDummyTable() {}", "public function dataTable()\n {\n return (new EloquentDataTable($this->query()))\n ->editColumn('alias', function (Menu $menu) {\n return '<span class=\"label bg-primary\">' . $menu->alias . '</span>';\n })\n ->editColumn('published', function (Menu $menu) {\n return dt_check($menu->published);\n })\n ->editColumn('authenticated', function (Menu $menu) {\n return view('administrator.navigation.menu.datatables.authenticated', $menu->toArray());\n })\n ->editColumn('title', function (Menu $menu) {\n return view('administrator.navigation.menu.datatables.title', compact('menu'))->render();\n })\n ->addColumn('type', function (Menu $menu) {\n return $menu->extension->name;\n })\n ->editColumn('lft', '<i class=\"fa fa-dot-circle-o\"></i>')\n ->addColumn('action', 'administrator.navigation.menu.datatables.action')\n ->rawColumns(['alias', 'published', 'authenticated', 'title', 'lft', 'action']);\n }", "function __construct($_dataTableName = 'Application_Model_DbTable_ProjectCcLicense')\n {\n $this->_dataTableName = $_dataTableName;\n $this->_dataTable = new $this->_dataTableName;\n }", "public function __construct(TableBuilder $builder)\n {\n $this->builder = $builder;\n }", "public function __construct(TableBuilder $builder)\n {\n $this->builder = $builder;\n }", "public function __construct() {\n parent::__construct();\n\n //kapcsolódás a db-hez:\n $this->db = db_connect();\t//\\Config\\Database::connect();\n $this->builder = $this->db->table(\"feladatok\");\n\n }", "protected function getTable(): Builder\n {\n return $this->connection->table($this->table);\n }", "public static function buildTable($data)\r\n {\r\n $table = '<table class=\"table table-hover\">';\r\n // Create the table header row\r\n $header = '<tr>';\r\n foreach ( $data[ 0 ] as $key => $cell ) {\r\n $header .= '<th>' . $key . '</th>';\r\n }\r\n $header .= '</tr>';\r\n // Add the header to the table\r\n $table .= $header;\r\n // Build the table rows\r\n $rowHTML = '';\r\n // Loop through each row of data and build a row\r\n foreach ( $data as $row ) {\r\n $rowHTML .= '<tr>';\r\n // Loop through each cell and create the cells\r\n foreach ( $row as $cell ) {\r\n $rowHTML .= '<td>' . $cell . '</td>';\r\n }\r\n $rowHTML .= '</tr>';\r\n }\r\n // Add the rows to the table\r\n $table .= $rowHTML;\r\n // Close out the table\r\n $table .= '</table>';\r\n return $table;\r\n }", "public function build() {\n\t\tif (is_null($this->name)) {\n\t\t\t$this->name = \"\";\n\t\t}\n\t\tif (!is_string($this->name)) {\n\t\t\tthrow new Exception(\"name must be a string\");\n\t\t}\n\n\t\tif (!is_string($this->value)) {\n\t\t\t$this->value = (string)$this->value;\n\t\t}\n\n\t\tif (is_null($this->text)) {\n\t\t\t$this->text = \"\";\n\t\t}\n\t\tif (!is_string($this->text)) {\n\t\t\t$this->text = (string)$this->text;\n\t\t}\n\n\t\tif (is_null($this->link)) {\n\t\t\t$this->link = \"\";\n\t\t}\n\t\tif (!is_string($this->link)) {\n\t\t\tthrow new Exception(\"type must be a string\");\n\t\t}\n\n\t\tif ($this->behavior && !($this->behavior instanceof IDataTableBehavior)) {\n\t\t\tthrow new Exception(\"change_behavior must be instance of IDataTableBehavior\");\n\t\t}\n\t\tif (is_null($this->placement)) {\n\t\t\t$this->placement = IDataTableWidget::placement_top;\n\t\t}\n\t\tif ($this->placement != IDataTableWidget::placement_top && $this->placement != IDataTableWidget::placement_bottom) {\n\t\t\tthrow new Exception(\"placement must be 'top' or 'bottom'\");\n\t\t}\n\n\t\tif (is_null($this->title)) {\n\t\t\t$this->title = \"\";\n\t\t}\n\t\tif (!is_string($this->title)) {\n\t\t\tthrow new Exception(\"title must be a string\");\n\t\t}\n\n\t\treturn new DataTableLink($this);\n\t}", "public function setRepository(TableRepository $repository): Builder;", "static function newOptsData($builder = null)\n {\n $options = new DataOptionsOpen;\n if ($builder !== null)\n $options->import($builder);\n\n return $options;\n }", "protected function createQueryBuilder()\n {\n $builder = new QueryBuilder();\n return $builder;\n }", "public static function makeFromSimpleArray($array)\n {\n $dataTable = new Piwik_DataTable();\n $dataTable->addRowsFromSimpleArray($array);\n return $dataTable;\n }", "public function getSchemaBuilder() : BuilderInterface;", "protected function _getTable()\n\t{\n\t\t$tableName = substr( get_class($this), strlen(self::PREFIX) );\n\t\t$tableClass = self::PREFIX . 'DbTable_' . $tableName;\n\t\t$table = new $tableClass();\n\t\treturn $table;\n\t}", "public function table($table): Builder;", "public function getDatatable()\n {\n return Datatables::of($this->dashboardDocumentsRepository->getCollection([], ['id', 'name']))\n ->addColumn('actions', function($document){\n return view('includes._datatable_actions', [\n 'editUrl' => route('dashboard.documents.edit', $document->id),\n 'deleteUrl' => route('dashboard.documents.destroy', $document->id),\n 'downloadUrl' => route('dashboard.documents.download', $document->id)\n ]);\n })\n ->make();\n }", "public function newQueryBuilder()\n {\n return new Builder($this->config);\n }", "public function datatable()\n {\n $reportes=Reporte::join('ilustraciones','reportes.id_ilustracion','=','ilustraciones.id_ilustracion')\n ->join('users','reportes.id_user','=','users.id')\n ->select(array('users.name','ilustraciones.name_draw','ilustraciones.estado','reportes.id_reporte'));\n return DataTables::of($reportes)\n ->addColumn('view','IntAdmin.intReportes.botones.revisar')\n ->rawColumns(['view'])\n ->toJson(); \n }", "function make_datatables($adviserId) { \n \n $this->make_query($adviserId); \n if($_POST[\"length\"] != -1) { \n $this->adviceprocess_db->limit($_POST['length'], $_POST['start']); \n } \n \n $query = $this->adviceprocess_db->get(); \n return $query->result(); \n \n }", "public function createQueryBuilder(): QueryBuilder\n {\n return new QueryBuilder($this->db, [\n 'separator' => \"\\n\"\n ]);\n }", "public function getHtmlBuilder()\n {\n if (! class_exists('\\Yajra\\DataTables\\Html\\Builder')) {\n throw new \\Exception('Please install yajra/laravel-datatables-html to be able to use this function.');\n }\n\n return $this->html ?: $this->html = app('datatables.html');\n }", "public function createRowTable($options = NULL) {\n $request = $this->getRequest();\n $params = $request->getParams();\n $table = $params['table'];\n //---------------------------\n\n if ($table == 'admin.blog_posts') {\n return new Default_Model_DbTable_BlogPost($this->db);\n }\n\n if ($table == 'admin.blog_posts_tags') {\n return new Default_Model_DbTable_BlogPostTag($this->db);\n }\n\n if ($table == 'admin.blog_posts_images') {\n return new Default_Model_DbTable_BlogPostImage($this->db);\n }\n\n if ($table == 'admin.blog_posts_audio') {\n return new Default_Model_DbTable_BlogPostAudio($this->db);\n }\n\n if ($table == 'admin.blog_posts_video') {\n return new Default_Model_DbTable_BlogPostVideo($this->db);\n }\n\n if ($table == 'admin.blog_posts_locations') {\n return new Default_Model_DbTable_BlogPostLocation($this->db);\n }\n }", "public static function getSchemaBuilder()\n {\n }", "public function datatables()\n {\n $param = [\n 'url' => 'publikasi',\n 'action' => ['show', 'edit', 'destroy'],\n 'file' => 'publikasi.download'\n ];\n\n return Datatables::of(Publikasi::with(['katfile', 'user']))\n ->addColumn('action', function($data) use ($param) {\n return generateAction($param, $data->slug);\n })\n ->editColumn('file', function($data) use ($param) {\n return generateFileDownload(route($param['file'], $data->slug), $data->file, $data->nama);\n })\n ->editColumn('tanggal', function($data) {\n return date('d F Y', strtotime($data->tanggal));\n })\n ->addColumn('user', function($data) {\n if ($data->user) {\n return $data->user->username;\n }\n\n return '-';\n })\n ->rawColumns(['tanggal', 'file', 'action'])\n ->addIndexColumn()\n ->make(true);\n }", "private function readColumsTableForBuilder()\n {\n $configs = config('datatables-html.configs');\n\n foreach ($this->columnsTable() as $key => $column) {\n \n $config = $configs['default'];\n\n $config['title'] = $column['title'];\n \n $config['name'] = 'column_' . $key;\n\n $config['data'] = $config['name'];\n\n if (isset($column['config'])) {\n $config = array_merge($config, $configs[$column['config']]);\n }\n\n if (isset($column['class'])) {\n $config['className'] = $column['class'];\n }\n\n if (isset($column['searchable'])) {\n $config['searchable'] = $column['searchable'];\n }\n\n if (isset($column['orderable'])) {\n $config['orderable'] = $column['orderable'];\n }\n\n if (isset($column['width'])) {\n $config['style'] = sprintf('width: %s;', $column['width']);\n }\n \n $this->columns[] = $config;\n }\n\n return $this;\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n // ->addAction(['width' => '80px'])\n ->parameters([\n 'lengthMenu' => [\n [ 10, 25, 50, -1 ],\n [ '10 rows', '25 rows', '50 rows', 'Show all' ]\n ],\n 'dom' => 'Bfrtip',\n 'order' => [[0, 'desc']],\n 'buttons' => [\n 'pageLength',\n ['extend' => 'create', 'text' => '<i class=\"fa fa-plus\"></i> '.trans(\"dataTable.create\"),],\n //['extend' => 'export', 'text' => '<i class=\"fa fa-save\"></i> '.trans(\"dataTable.export\"),],\n ['extend' => 'reload', 'text' => '<i class=\"fa fa-sync\"></i> '.trans(\"dataTable.reload\"),],\n ['extend' => 'reset', 'text' => '<i class=\"fa fa-cog\"></i> '.trans(\"dataTable.reset\"),],\n ['extend' => 'print', 'text' => '<i class=\"fa fa-print\"></i> '.trans(\"dataTable.print\"),],\n ['extend' => 'excel', 'text' => '<i class=\"fas fa-file-excel\"></i> excel'],\n ['extend' => 'csv', 'text' => '<i class=\"fas fa-file-csv\"></i> csv'],\n ],\n 'language' => [\n \"sProcessing\"=>trans(\"dataTable.sProcessing\"),\n \"sLengthMenu\"=>trans(\"dataTable.sLengthMenu\"),\n \"sZeroRecords\"=>trans(\"dataTable.sZeroRecords\"),\n \"sEmptyTable\"=>trans(\"dataTable.sEmptyTable\"),\n \"sInfo\"=>trans(\"dataTable.sInfo\"),\n \"sInfoEmpty\"=>trans(\"dataTable.sInfoEmpty\"),\n \"sInfoFiltered\"=>trans(\"dataTable.dataTable\"),\n \"sInfoPostFix\"=>\"\",\n \"sSearch\"=>trans(\"dataTable.sSearch\"),\n \"sUrl\"=>trans(\"dataTable.sUrl\"),\n \"sInfoThousands\"=>trans(\"dataTable.sInfoThousands\"),\n \"sLoadingRecords\"=>trans(\"dataTable.sLoadingRecords\"),\n \"oPaginate\"=>[\n \"sFirst\"=> trans(\"dataTable.sFirst\"),\n \"sLast\"=>trans(\"dataTable.sLast\"),\n \"sNext\"=> trans(\"dataTable.sNext\"),\n \"sPrevious\"=> trans(\"dataTable.sPrevious\"),\n ],\n \"oAria\"=>[\n \"sSortAscending\"=> trans(\"dataTable.sSortAscending\"),\n \"sSortDescending\"=> trans(\"dataTable.sSortDescending\"),\n ],\n ],\n ]);\n }", "public function getData()\n {\n return DataTables::of(App\\Models\\Config::all())->make(true);\n }", "public function html() {\n $table = $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '250px'])\n ->parameters([\n 'dom' => 'Bfrtip',\n 'buttons' => [\n ['extend' => 'create', 'className' => 'btn btn-success', 'text' => 'Create User', 'init' => 'function(api, node, config) {\n $(node).removeClass(\"dt-button buttons-create btn-default\")\n }']\n ],\n 'select' => true,\n 'initComplete' => 'function () {\n var r = $(\"#datatable-buttons tfoot tr\");\n $(\"#datatable-buttons thead\") . append(r);\n this.api().columns([0,1,2,3]).every(function () {\n var column = this; \n var input = document . createElement(\"input\");\n $(input).addClass(\"form-control input-lg col-xs-12\");\n $(input).appendTo($(column.footer()).empty())\n .on(\"change\", function () {\n\n column.search($(this).val(), false, false, true).draw();\n });\n });\n }',\n ]);\n return $table;\n }", "public function get(TableBuilder $builder);", "public function createQueryBuilder()\n {\n return new QueryBuilder($this->db);\n }", "public static function builder() {\n\t\treturn new Builder();\n\t}", "public static function create($data = [])\n {\n $table = new static();\n\n return $table->createRow((array) $data);\n }", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "protected abstract function createTestTable();", "protected function createBuilder(ResolvedType $type, array $options): TableBuilder\n {\n $builder = new TableBuilder($type, $this, $options);\n $extensions = $this->getExtensionsForType($type);\n\n // Extensions build pass\n foreach ($extensions as $extension) {\n $extension->buildTable($builder, $options);\n }\n\n // And build the fields\n $type->buildTable($builder, $options);\n\n // Extensions build pass\n foreach ($extensions as $extension) {\n $extension->finishTable($builder, $options);\n }\n\n return $builder;\n }", "function create_table($id, $data, $headers=[], $caption = \"\") {\n $table = \"<table id=\\\"$id\\\"><caption>$caption</caption>\";\n\n if (sizeof($headers) > 0) {\n $table .= add_row(create_headers($headers));\n }\n\n foreach($data as $vals) {\n $table .= add_row(create_row($vals));\n }\n\n $table .= \"</table>\";\n return $table;\n }", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "public static function DataTable($columns = null, array $rows = [], $timezone = null)\n {\n if ($columns === null || gettype($columns) === 'string') {\n $timezone = $columns;\n }\n\n $datatable = self::emptyDataTable($timezone);\n\n if (is_array($columns)) {\n $datatable->addColumns($columns);\n }\n\n if (is_array($rows)) {\n $datatable->addRows($rows);\n } else if ($rows instanceof \\Closure) {\n $datatable->addRows($rows());\n }\n\n return $datatable;\n }", "public function generateDataTable($header,$result,$class=null,$sumColumn=null,$tableStyle='htmltable') {\n\t\tif($tableStyle!='htmltable')\n\t\t\treturn 'Style : '.$tableStyle.' not supported !';\n\n\t\tif($tableStyle=='htmltable')\n\t\t\t{\n\t\t\t$returnTable=$this->generateHtmlTableData($header,$result,$class,$sumColumn);\n\t\t\treturn $returnTable;\n\t\t\t}\n\n\t\treturn $tableContent;\n\t}", "public function getData()\n {\n return Datatables::of(App\\Models\\DocumentType::all())->make(true);\n }", "public abstract function getCreateTable(Table $table, $config);", "public function datatables()\n {\n $param = [\n 'url' => 'prestasi',\n 'action' => ['show', 'edit', 'destroy'],\n 'gambar' => 'prestasi'\n ];\n\n return Datatables::of(Prestasi::query())\n ->addColumn('action', function($data) use ($param) {\n return generateAction($param, $data->slug);\n })\n ->editColumn('gambar', function($data) use ($param) {\n return generateImagePath($param['gambar'], $data->gambar, $data->judul);\n })\n ->editColumn('isi', function($data) {\n return str_limit($data->isi, 100);\n })\n ->rawColumns(['isi', 'gambar', 'action'])\n ->addIndexColumn()\n ->make(true);\n }", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}", "public static function build_jquery_datatable($aDBInfo=null,$table_id=\"datatable1\",$ajax_source_url=null,$datatable_properties=null)\n{\n$js=null; //Holds the javascript string\n$dba=array(\"a\",\"b\");\n\n\n\n$ajax_source_url = is_null($ajax_source_url)? basename(__FILE__) : $ajax_source_url;\nif (isset($aDBInfo))\n $serializd_db=base64_encode(serialize($aDBInfo));\n\n/* Edit Jqeury Here */\n$js= <<<EOT\n<!-- Start generated Jquery from $ajax_source_url --->\n<script type=\"text/JavaScript\" charset=\"utf-8\">\n$(document).ready(function() {\n\nvar oData=$('#$table_id').dataTable({\nlanguage: {\n \"url\": \"//cdn.datatables.net/plug-ins/1.10.15/i18n/Portuguese-Brasil.json\",\n \n },\najax: function (data, callback, settings) {\n\n\n settings.jqXHR = $.ajax( {\n \"dataType\": 'json',\n \"url\": \"$ajax_source_url?oDb='$serializd_db'\",\n \"type\": \"POST\",\n \"data\": data,\n \"success\": function (json) {\n oData.fnSettings().oLanguage.sInfoPostFix = ' (processado em '+json.iTime+') '; \n detalhesArquivo = ''+json.bdDetalhes+''\n callback(json)}\n });\n \n },\nresponsive: true,\nautoWidth:false,\nprocessing: true,\nsortClasses:true,\nserverSide: true,\ninitComplete: function (oSettings, json) {\n // Add \"Clear Filter\" button to Filter\n var btnOK = $('<button class=\"btnOKDataTableFilter\">OK</button>');\n btnOK.appendTo($('#' + oSettings.sTableId).parents('.dataTables_wrapper').find('.dataTables_filter'));\n $('#' + oSettings.sTableId + '_wrapper .btnOKDataTableFilter').click(function () {\n oData.fnFilter($(\"div.dataTables_filter input\").val());\n });\n oData.fnFilterOnReturn(); \n },\nstateSave: false,\ndeferRender: true,\njQueryUI: true,\nscrollInfinite: true,\nscrollCollapse: true,\nscrolX: true,\nsScrollX: \"100%\",\nsScrollXInner: \"100%\", \nscrollY: '72vh',\nscrollCollapse: true,\npaging: false,\n\nfixedHeader: {\n header: false,\n footer: false\n },\ndom:'Bfrtip',\n\nbuttons: [ \n {extend: 'copyHtml5', text: 'Copiar'},\n {extend: 'excelHtml5',\n text: 'Excel',\n customize: function ( xlsx ){\n var sheet = xlsx.xl.worksheets['sheet1.xml'];\n // muda o cabeçalho para cor verde. \n \n $('row c[r^=\"L\"]', sheet).each( function () {\n // Get the value and strip the non numeric characters\n $(this).attr( 's', '55' );\n $(this).attr( 's', '53' );\n \n\n }\n );\n $('row:first c', sheet).attr( 's', '42' );\n // ajusta coluna m\n \n }\n },\n \n\n {extend: 'pdfHtml5',\n 'text': 'PDF',\n pageSize: 'A4',\n filename : 'Consulta de Cargos no TCE-PB',\n title : ' ',\n footer : true,\n columns:':visible',\n newline:'auto',\n exportOptions: {\n modifier: {\n page: 'current',\n }\n },\n customize: function ( doc ) {\n \n doc['footer']=(function(page, pages) {\n return {\n columns: [\n '',\n {\n alignment: 'right',\n text: [ 'Pág. ',\n { text: page.toString(), italics: true },\n ' de ',\n { text: pages.toString(), italics: true }\n ]\n }\n ],\n margin: [10, 0]\n }\n }),\n\n \n\n doc.defaultStyle.fontSize = 7,\n doc.styles.tableHeader.fontSize = 7,\n doc.content[1].table.widths = [ '15%', '10%', '15%', '10%', '8%', '8%', '11%','12%','11%'],\n doc.pageMargins = [20,30,20,20],\n doc.content[0].text = doc.content[0].text.trim(),\n\n doc.content.splice( 1, 0, {\n margin: [ 0, 0, 0, 0 ],\n alignment: 'left',\n image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABI0AAAClCAMAAADmpv1OAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURRYmLBsrNR4wOyYkJyAuNyQyOzQmLTE5PRYmSBYmVRYmbiItRSU1RSw8VDM8RzI9VTQ5Zzo8dhZFdxZSahZSfyxCSS5AVzhBSjJDWjlTWzhJZj1OcD1ZYTxUdEMmLVcmLWgmLXwmLVVKLXFJLUhJTElMVU1QWlJTWkNMZERJeElUaERUd1laZ1Zcd0dlbUxsdE5wd1xieVp1alR0emFdSH9dSGhoVWBgbmRkd2h1amh1dhYmiRYmlhYmqz49gRZFixZFmhZShRZSkhZFpRZokhZmqRZkuBZ5tTRdjDRymjR2sBZ4wkI/ikVEiExHmElbhFBPj1BMnFRZhldXmFJOoVpWpk1gjE9ikFxjhlRnl1d6g1ptoV1xqGFdrGJesGprhWZqlmtyh2xxmHBxjHZ2l2dmqGpmtWJ0rGZ6uHFsr3Fuunx8o3d1t3l3whaFyRaW0Rar3TSQzDSk2F2CiUiFsWCEjmSLk2qTm32FjH2CmWiNp26YoWiVu3+Brn6CtHObp3iYtXupsVKQy1mq3FW15G2Bw2ifxHGFyXiN1nipznG56HfC637H8pImLaUmLZZFLY9hLY95LZpoLatFLaxoLZdzS5N1Z614SKx1d4F+uK1/jIB+yJ2GLY+Dd7GGT7uGd7eaeMOGLcuTLdKfLdmrLcWOTMeSd9WmSNOobeGwSOG3Y+e5f4+DhYWMl4uSnIKCq4iIt4+RrY+QtZOYp5SUuIOzvKWYhbuikqequK2wt7qwtYqKxouK0o6Qxo+Q0pGNwZCP15OTyJmZ1pyb4Ym5xaCeyaCf5KWjyqSj2a2yxLGu1bOzzbm316Ki5JHEzobI64nM95rK5pvW+6nD1a3T17TI263T66Xc/rXT67ja8rPk/syxjsO3tem9jMC+29rIktrCpdbFuNLTtenDjOHBkvDIjPbNluHMtenTt/zaqvXct/3it8TC3dDR2MzK4sTa68Pd8tjY6sTs/cXy/9bq9dj8/+zZxP3qxvbq1//xyf/83OPj7efn8+X6/v765/7+/hyy0woAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTczbp9jAAAf1klEQVR4Xu2dDZhc1VnH5+KOCXB3AyjsZJEqyibLToa4UttI1dpq/UCTSLaJWRLcJdkl28xGrSCpokVat0urtWq/ra21Ra0izarBNixYZxubVAN+VKwtVYu1H7QUxVpIA2R933Pe83Xn3pm7u3NJnvj/PX3K3DvnnnvuzZzfvuc9586UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACWzNcpZAMAAJ51tIWSyJsAAPBsIObJQkoBAECxiHMY2SPITkb2AABAUYhtMn0j78JHAIBCEdO0UY0UgpAAAAWxCMksoigAACyOxfplseUBACAXi5fL4o8AAIB2LM0sSzsKAAAyWbJVch247faQmcmRSiTvBVSkwE7ZLsUzsscxM72jGsvbhpRiHhVVJqjbbLRimzrMEfXtmFbnmd55cWrrW1BVNd4+nWy4wt2eyax6oz1SwmvWTtnhMzO5rTtRh7k3mXV7xJsnVemZ6Yx/IACKRilliSFOnkOTNlJMakkE5LGRYmZb0FmeBRtdNCm7NZN9i+mtkTm4KjsCvNvTJ7uSdLsLbGkjZmakLCUUuW0UVad1SWFHqjoBKJQ8QmlB+8NTbZTmo9w2InwfFW6j2MUmhslueS8HViY705Tg3Z4R2ZVks7xPtLURkXZv2tmoL3QRM9JOYAB0mPY2IaLyihXl4G+uo20FGTZq/rgvxka3T7rmFG0jGWglyN9ZR+SI22fSFObdnvShnIutiDw2un3S1ZPPRlFqbTNZsRoAhZDukqiry//0lldcRvSW0z/R6VU4Mm3k9xpmUTbyDi7WRpGVSYLUSCcFTyabZZePf3suln0hffIuk8tGntZy2SgOx6GO1KElAMWQbpKuFb29K7pkgzZ7WUbE0nSUbaPbp4NgYXE2cjYo1kbZzd+RT0eeTNKc4NefLrgd8i6Tz0ZOR3ls5MdeCaAj8KyRrhGxj3XPisv61Q7aJXsStNaR6W7VmOmubvM+/MHYJNNGk+pIolId8fIbl2QVC9BXEdQdyVsaMxAbkW2NuXhvmDazZ1t1805PfVYNLfFlkjL28W00EwaLmthP6TTZqE/aG8d9m730ljFlDhtFXgOnd2yujuiZNcVMU3IPgGJIl0hkQqEVsqPnsn6h1wVMAS11ZLqbG4ZEm+3n3e8l2Tbyu5IbVpjdef7+N9XtuFjeSnVLxbX0ItkVu7AkT2LFtE6xQ3Z6BLFX2lAuSFs12SjQReQqk6bluDcuR26m46I+e48zUlkAdJh0h0RlIx8THZUvWyt7+nsyPtTpVWmabUQnsT3a63/5bOT9Lc/f45ZqIzeI2exV3mcE46XSMwlkktK5AxulXEKYYW5tI69pMuhrf2/sjJ8fB7lkWdY8HwCdJMMgXb1iHqsjspGh3/z1PPfcc4PP9yJt5D7u3uAkp42cIqSnFGgjm/MJEyg2YkqLZUISSZnmRExgo5Roy1tsRLSzkZWfzN+1vzfG7QlRmmalzgMC0GEyBOK5Z40kinr6ZcfatXpP1P29m84Pl/1m6yjVRm59sfvjm9dGtsft0fuLs1HSexbTgvYDGZHJtIyHpMkecnvkGppDETlQ3m9rI9tk7b2298bKLuFB+++TMrgEoMNk6aO8RsTDaPl09com0csf63M3btq0aWPO6CjdRrafuOAot40S+4uzkQmNmqST6PMtkBhwRBrZHGrI7dmj388604zYp62NrCi119reGxOjNmnQaCo1sw5AJ8mUR1m0o1ijE0VlFxyp1BHZ6JprNp0ffsKzasywke0HdrST20bGBdJRirNRUxMtxlPtFh2ZpvYZfTSdRW7PThkxJYdqcqKd0pT2NrpI7oaOwtrdm7PMrWwekJkhHGb5QcEE6ojKZbeUKLARyYf3RT1r1wkqdRR1b7yGdHRe8BFfrI3MH1/bUU47G9mu2hweJJqQichk8ixzmqZGGhsZ7STeFwv1iRva2yi8G+3uTQur5hUuAMvEV0cXL7VeYT5zoY0kb13uFxkRPFaLzrtm69bhjeEf1AwdZdnIZCbsn+XTzkbmoOZkjwubmtPOASIRGgeZZUPJA4yN5KISepOjps2ygk7byPzjpARAxsXtc2MALIdARj16dZF8Xn3xEGv7eX/Us0a2aQ9/Os+9fCtx8bnqEEO6jrJsZBe6mFWMuW1kOrbsL8xGJgWTNnNmIoefkO10TNNYQSKmZFbY2Mj4LTyZNG6kaaDXGRs1/UXwMUO1plMA0Ek8b0RaRnahdcJG69aq1FHk7VXh0qofJxsNn6cOMSzSRqZDmwRqbhvZMYTeLMxGreIfM85MqdBDfKZaJq1Oju3k9kxGUmNwFWaxUXPaKdNG4ZW2uTfW62fJDp/kXwsAisDXxgqz2LFHL7SOekQ6hjUqpxT7YzUudjEHRxvDrpWqo0wbJTt0XhvZyWcJI4qykQ0c0oYqifgsHTOkVA01RyQGRdZG5nS++6yhzJvtbWQckmtOzbyd6lQj/WZNA9A5PGl09ZqF1jY4coMyjYqFol7ZInRwNHzdxMTw5cGnfHE2SvaUvDYyFZrhRWE2apU4yZXGFplIQyXUSr8a2iuBlD/XLmqp2tO1tZFxntzuNvfG3Jam+X2mxT0DoFP40vBWNspTaL53NGqs5o/gOJfUNTBBDNvHSxVpOsq0kelhZpiQz0bNDy2YYinYvroUG7UOf0QHLW0U+scM1cIcjbORnM+Tn9whOkdeG9nHZqRdbWzUMvwxx8JGoEB8ZXgLG/VsflpwxJ9sktTzNwjr2EHxMOsoDI6CqoW2NjIdOoeNou4Rqx7bawuzUcuenDlUcphZKRlRmusNAxG5PXw1YhI3VBNZ7HDHtrFR2QxiTbK8jY2yc2ZEm2MB6ABBAOOeA1m79jIJjipiIYuaVyv3D4mMNujg6PKJl01MjLUNjpZvo3Rs/uW0tVEyb506VJPbw4WkvFvgIweQnvLYKOozO6m6fKNY2AicYgJh9K5ZJy5au26NBEfxmg3P99mwjt+I4nUiIx0cRfHY3pftnbg8/JaRZ81GLhl82tpIili7mEYEc3SejeSGWHvJ0I3Pb9rSZKMMzDqBNkaBjcCpJQxf/LkynZ6mXtHvvKNYt4bf6OqXTYJLRlsmpqZeNhamQcLamUJs5H9nc4tip9RG5njrTXPBwZIjz0YmaW1UIi3jhpm6ctrIfi1l62uAjcApJtRFsLxIry0qlXoSNtqgF2B7wVGNoqWoMjZFDAQf1mfHRsFX5GcXO7U2kjkyG+pY23h7nI1Y6nJGOaEsNvLfyWkjd3taXwNsBE4xoS7CGTQVA4VRkGYdvxENyhbBwVHXFrbRFr9vJasn2tqo7ZxaksSUu+018pWsHrYfnQIbmcvzTmlWWPlLjszt4XrcYkdGzq+eSzFtyWOjtLgRNgKnI8ngJVzsqL4whD6IyeBog3qjZ92obG6o8RLIap1sVB9Qhxjy2yj5ac8fG4Wrg/P0msJsFMQ5AeaUnhusf70afRuZPLaedbOLjQjzZH57G83431LZ7t7kslHKPQOgIzTZyD6er9Cdq9wcHPEbUf+GUWEDT6utGpt9+9vfXgs+6cn6s22Ufy22RDqxWWcc9q2ibGTcscTVjzIhFhxtBm9eri2wkb/kSM6gjzftb2Ojpt+sbnNvTLVY/QhOCUlZJJ5Lk09zbGfzDeqNnprIaHSU59m6arPE2Cp1iCG3jczSO9MVsm1kupJRQDDUKdxGqcJpvTSSMIuNUvF6v7k9OoRyc/phnJRpI/ebId641NHm3iT/IASYf5/UwAmADpCURZg40pP55JnBDXZQphhVwVFXv7iIgiPOXg9MkY3qg+oQQ24bmTcW8Qz/JXpH+PX4RdnIqCE1NWROmtqPGdOXU/GaGt4eaScvCvDE1MJGaW3zaHNvWjrVfIUBnpoFBUGuCGWRzBGplY6lKHZRkEa/0WOHaqM1MkJljIOj0eCznNdGNvQww5YcNrLBkZkEZwqzkemO/skMRjaZ3yiSmdhRuGRSeHvkAikc8xYbEQXZqOU3irSSMQAdoNlG5cGaiEghieyIgqMQFRyVB2RrdDeP3eLa7Ic+9KHxYCiTPEOWjcwowXaUHDaywZGfjSnMRvaglIrNVXk56gDTqAzckqPE7REDbja6ExMWZCN79mDoqzHmT02bAdABmmRUiiqBjTYM6sXVXopIo4ZmUQ95SDNa6ypFA7ONRqMepk5z2sj86bUdLI+N0oKjwmy0nG+iNQn3DNxxidsjFzNpFhtJuaJsZEK8FOGaU6Z98yUAnaDZRhTgiIc0NQmObBRkqHGatFwzNto9Sj2l5wDZaLZpVk1eKTJsZH6TzA0S8tgoLTgqzEZWmM1DNdOLs7qqtWYWNhhJ3h55dLaqL8pYoigbmcRRylDNXHxK2ARAR0ixUVfyORCdIu4d2i0a0uwe5cxRVBkdF0b7u0rx+MFG4+CYn1TOZyPbXd2YJZeN7HFuWqo4GxnnNA1W7Be+ZXVVc77wx/2J7mTeOHl75JxyTWYgWJSNrHOa5vjNkZnRHwDLxaoiiszPxUbJxUU6OCr32yhIo/LWpfKQyGh8vBbTFtmocSD4xOaxkfseHvdHOZeNrCFcLynORinq05j8dmZOxXTy5rRS8tumk7cniKps/YXZyGTvki21/0DBQ3UAdBJno/M3/pj+CaLk/Jle6cjzZ6Ihwyjnh6JBFxz10nju4JG/PnJQHv7X5LBRbLuc54B8Nmo2RHE2suPCRAzU9pevW8ycG5ua5jfdHrODsddYmI2sdRJiNXmv1Nk2ADqClVH3xk2bNoqOBsVDgszyU3Ak2hF2K031bJDN8XEqF//Z0SNHGsGTs21tFG02vTnoJfls5IIj008KtJELVPznLayMMkOjpHI8rKjk6bym22OjFV8FhdnInW76ItlDRDYJn3IFAHQGFxqdt4l/vVr/mH5lSDwk8BP6RJyw0fgof/ajmmyNj5OdygeOHDnaUGM4S7qNqjpx0rfNG4oE3TmnjawhzBjCFtMnSKCPXaKNnHhunzRmKJtRWBju+ZinX1NdkRjENdnI5qT8C1+2jeRuBOja3ezfiPlX7Lb/RJm+BWDZJGy0aaP6RbR4nWjIMKg+qN6gTBjkz6sLmchO0Xjj6NEj1wcf2nQbpTAdDANy2sgGHqYnmmLp6F6+VBvZDBExs2NztTriuTQzbshouMY0X5rSHDq6U7rx4XJtlIo+1o7ViMmRanXzDu+YrOVUACwf30Yv3bTJ/Hq1e+BDsXuIn9AvRU3Bkdof1+qyOT5QioYO/s3RIz+vyhvy2mgy/MOb10YuONL7C7VRi+anLYrUmHAjtUo7qa6vvtlGpoA/nVWgjcK8eQhm90GBBDa6htC/iNY7JIlqYXSd6mnRoFjHwo+kRQPjdWGQihw8duzowaBT5LRR8JVpRF4bueBI/+Uu1kZRVvuzVwXa7p2uCjNU0ynwZhvZaTdvOqtIG5XKWTrKStID0BGsjVZds/WljAqOugZEQwY1fcYZaxsGaVSCqDIqMqrX4qjyp8eOHTvSz6UNuWxk8zCW3DayvV0LoVgbBYM1j6RLPYwtUwdqybdTbGQKeMOkQm0UDNYc/re2AVAA1kbd1/CPxW7dulFZoWd0t/hGc73OSyeDo7rKY9NQTXOApFU+QDY6FjzGn8NGO5tctAgbJYKjom1Uil1e2TDdygJh8NOE/a4RVUeKjcS2/mUXayO6o2Z06NgZzEwA0HmsKWKx0fD5/KEvD4Y2GpfgqHc0GRzR7qhibLRrIIruYhut48KG1jaamdymZ/KS5LdRGBwVbqNSqTv00WRf6gUILZ620BhbqSx4io0k7+TLrGgblaJLQh+l/bkAoLNYU3Rt0jbaupFneqOeZMK6phJKHByJejT8cFopHq8fULCcxo/927FjG/zfMQptdGYQ9Y1Mq549vbPqkstnFHF1j7rCmemRlrYFoENYU0QbxUb6t/TLbhWRoJdA9tgckUbtLg+JjQ6MRqXr//bRRx+93g/rz0QbAQA6jbPRxcPXiY5UcOSehhWG1BJIbwJNMT5E3okG6rNKRrO74tKGI489+uhuP16AjQAA7XFT/KuGf/I6xVYVHHU1BUd6CWQ8Wj8gJlLwV6tF8Th/5yMxXomGPvjYY4/5C47sKQAAIBuninO33KBtdN2wyipXEglrPX/GmSMVBhnqA12kLvUNtER9IFrHNrorsJG8AACAbLzA5fLrbtBMXM7jLNKOhD/CeE2lpuNR8ZDAeeyoVhcb1aLBg4+Tjbz5GdgIAJAH54rzhsVGN1yn5lDcokZhl5rlJ0vpJJFQJ/FEAzJUO7C93P/njz/+OGwEAFgszhXxZpHRDTds4dUl0YBYyDCupvMpONLmEQ5wPik2Q7Vd5V5lI4zUAACLxLki6psQGdFYjaOgZMK6Pq6/t8gEQsJ2Hqptl416HL+fbPR+ZyMksQEAufBk0b1FZHTD3mEeq0WVMGF94MComuWP1U/KWsb5h/erv6Rez83G5bueDmIjyAgAkA8/OBIZEcM8KCvXzKpGg/45o4rkrIUa7xpvzBGN2QrZ6KmnXqHGdArYCACQD88W8fANe7WM9k5cTt6J4l1BwvrA7JjKTieCo9Eyj+qMjeK7nn76qd1uLTZsBADIibMFBUdTexVTeydW8VhtMEwRzR4YSgmOxnlWrdZQzA4qGw2p+hjICACQlyA42rtvSrFvapjn1eLaAVGOoBPZ5e2zc7Jjdnbul/hB/sE5sVH5FQtPf9k9ww8bAQBy4wVHlYl9hqnNnPuphNP5s7NjvDdaVXc6mpsdIxv18W9eNxpzVbbRB923rUFGAIDceMKItuwVGe3bN6F+aH8gzFjP1tXjalFtVuWJFI16HHEam7mvFt+14CWxERoBAPLjG6N7WFxEjHHqKJGxJh3pWf5dSj6aWTJUvL0x36D/sY2+jNAIALAk/OCoz43V9o3xd4skll7r1Y6lqKpHZgqeVeuqNuYJstH7n7rLm1GT/wIAQA58ZUQDU+KiffumeNVRVBn3UtaMSmRTLGS5r07lKtpG1d5XfFD/cD8DGQEAFoUvjXjL1DsMU/wtq9FA3eWIiIZedDTgB0e0Z9WcstFgvMb7UmzYCACwKAJpxGP7xDtzc1Mqk10j8cgOojE71BQcDXaV4lcqG+lv8wcAgOUTxWPvEPHMzU3wA2sx68ijrsZqq2Y5b83MN0bjUlxnG91nZ9MYhEYAgOUQrRoTFxETHOzENb22UZjbxc4p19TYjGnUKxRS8atXBjYCAIBlEVUm7r1Xy+jeOfWISDwW6Gi2SvuiuK4S10xjgOTUuP/++TH/x0IAAGCZRH0Tc/cKc2PdEflp15wMyxR1jpiiwVmR0fx8NYoGyUZzagwHAACdIqrscTrazsuOKrtsIEQ01KKjrlG7j8oMNO6fryM0AgB0lmhVoCPaUxn3dTTHY7VSRWWumT2VqNK4f46fnwUAgE4SdY/N/ZVmfo4flY0qY76O6vyNj5FegE3MDpTixvx29X0jAADQSaJ4i50zm+NH1qJVgY7UvFo8Nn+UN442aqXymP6tfgAA6DDxlinlHeLesQrraNT6af7o3PYyKatvbv5+Zn6UgickjQAAxdBVnfpLkc/8HrUMcvt9sjk/f/8cf7dIeXtD2ej+MTkGAAAKIKrsEffMz0+p303bct/8UWF+Vi2MrKvgiEZqAABQHFFcnZ3/sGJ+biSmWGhgVg/NiHn1M7OVWXp531JTRmd/x3PkVQqXPFdedIpfW1i4Q156vOifF1L35+FnFhY+Ky+Xyjc8T14006L2F3xl4cSvy2sA/n9Q7ts1/xHtozn+6euoMu50tGsV6Yh8tWsgZ8rop6jfM8ffrSX0gv9ZOPEG9SqFVy8s3CkvO0SqjV7yVW7RKbMR3ZJHvl5eJ4GNAPCJKts5HPrIhzkY4m8YqYzOiY1IR+Sn8kCNh2y5MDYiH/2W2f499U4KH6d+Ki87RKqN/p7a8PCh35GtRbJ8G1GbvnapvE4CGwEQElXrDXIRM7e9h/RTfeW8xEeLfS6N7HPinkMP/i8J4MSbaPucTy48+W36rWZevrDwPvoPSSlTWIskzUYUni38obxePMu30Q89s/AZxEYA5IWXHol+pvrKURRvlwdm1TT/IiAbqUDgxaSAL32z3teOgm30PV9dOPlGeb14lm+jVsBGACSJunq2m+EZf/Uj+Sjuq9aqfXFX3jGaxtio9IPPLCy8R+1qS/E2Wka3ho0AeNaJ+7aMabb3qfmzqFwuL05FhLURi+ERqwISzh/8gzLFytfwKO74u6TIZ6nTKbhTfuMD/OqJN/N7lptU+Xf7Y52b/pvLfdofAa58Ldnv5EPGRheomr5AJagBCk5Qub2Emmhb+II+2Ys+xhvhmdWJP/1q8UVKCbmUh3S+/odVfZ+XRv3Iv/CWaiIZR2fHgisJaw+u6IV0pxaO/7axkW5ocLUAnOl0xYalr7l2Nvpp9crZiLmjdM4/6lcL/0qdMmGjq0koCk4mCStfJ/sescO+lb8qu06oPLliJVUlsI30LBrp6V2+jby9pdLL/ZMFGwKJQmBfpJQ4Ry5KJ8ZeJQVU5bY4587ERuGVBLWHV/RCGuRqlI1sVe5qAQA5cDb60We4NyVsxNY4+fAhDhxocMY2Wjl01ScpcLrquaXvIy+d+NRHOWb4fVUDw7324UMP0v9bDbycNj79J4dJLTrkYHjf8Xse5I5LNuL+fPwerulrl5595eQzCyffdtXzgr2l76aTffGdv/AJOuUbSt9PdT3xF7fyxuulQm4+teZjXCP5Iq3Er3Awdv1hKnGnHphS5VSMBcTe01tPXmpsFFxJWHtwRSvZ108c+i/6f75zXNUTqirnYwDOVKIcSNH2OBtpDzkbqaCBOq2aaqOeTB2PbUQb9CbnjShA+BJFGSwsm/9mabCaqL8++S16F0/Ys5moQ8uZ1Mzdwmcp2HohFScbce1UA+99r8sbBXulnbzxHg7jvijv2AQWnYVboWpWgV5TCWr2H9F/fpYLskIeoREbF/icOphPxc15j9govJKw9uCK2GtSkJtN78mVneQbB8CZS1SO4wsrq1cPXqFY/+2W9ev1rsHVld4L4/JZ+YyUbSPuuWwE9g/vpmKBjbhnqrQ3xSG245EF1MpBGs8l58WMZOS1PoSqotGgcYbOEUvBcC/3+fclV4mrozW8LEC1RtooeCWUUb5TXtsG0PWfeD0frE5Fg7M7xEbBlaTXrhtKxZWM9RZJ7IS6cCqp7iAAZxpnXUj+ufLam/fv33/Lrbfe1oZbb731lv37b77x2vVXrK7w90Rmkz1SU72YerCBdgc2kpKeNgiyl8XsK539Wh7NEbo8Yc+qzsNhiIE8IBWHe1eqlhx/+C1siFLpJh4YMcY1tjXGF00llNBoFPWBb6XXtgHqOHuwQtsouJJk7f4VmRPqMvokGuctAM4YylfcuP+W2267+/ADi+Lw3SSm/TdfqX77MQNno2QWW/Vi+q/BdbyEjWxhgkpYjI0SWV4mtBHVZHE2Suw9+7B+efzNXhY500YpJUqlq6Uh//kc1wBOyjvZKLSNgitJ1B5ckdwUaQFVbIGNwBlIfCOp6O7Di5QRcfjw3XffdsugVJOGsxEFH04Fno0+c5Xmu55jOl7CRn5sRCUekfJXcQzCUMVPkkL8Lt9ko5O/Kwc9zxZM7CUf3fTg09THT7yBxXmSh22mlYStXbcxpQRzyWEVMd3pGsBneaM9WGFt5K4kUXtwRXJTZIsqPvE2OazTjxgDcDoQXTi4/tqbbyElKQ63Qxe77bb9N155xeqWi5Bst5RkrPQ704tfR31Sj40Y6XjaRll5oye13Cwq+qD/+l2eXifyRt6jIFIw3HuJttuLqbI7rAA81yQyOyklzr7yqufTpfDE/ZOX2gawPV5v80ZXHzr0my5v5K4krD28ojBvZCsG4EwliqKzyuU4rqxe/U2DV6xff+W1NxI3M/s1/PLnaN+11165nlPZqysXxuVy+aw282vGRjyK4U4lKjC9mGe21VT9q/6dIg1no/fSf9Lm1HhmnaeUSlf/h1n9x32Xe/KrvZEam8abU6Oa1Mzd2Q/w5JQ0Idxr9EJhibLR5+g1T6Yb1/Ab3qxXSgmulqsj7X7t0vQ5Nd4yc2rhlQS1h1ckGpc5Na5YrWe64J/eSv9/iY0QATjT4Nl70hJ5ibkwgd7LDiIJ5Z5TC56aTdhIJY+fuOej5KrP+SO1k596SPXXpvVGnPw9fg+vvvmSRBbcP08+fIgXL1sbcdelYma9Ea9cWnj4EC/nceFZuJe1+Pl37nqA6noTT9IvPKGWAjkbsRTciqCUEtyOEx+46pfpUkg2XF/TeiO6FLfeKLiSoPbwivQtsuuNuCS9SZdGDaWzJENFAEAGZCPhSbV2OGGj0gX0SsGdVmzEKuEOm7YW++y/k30nraG4q2vcGCaxFvtqU4QjFGOjcK9dDH0nhSimUQsLf8wFFbYAtzGthM09H/8N2rJrsVU7U9Zih1cS1B5eUSJLbyrmLwKgqmxKDQDQGmMj8zhW0kallb/Iwc/Jh3j0ITZa+Vrawx027WmxlIfSfuATXOotNMpxeaCVr+EY4iGKYdR5LuAl0tIIa6NgrzxJ9oR6kOMcnmA7/m4KX7ysln6S7FW6jWkl9Ly8vhRTn3lOzXu4TGyUuJKg9vCKLlDPqb3149JsuSvc0Jd8RZkUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSxAAA47ZHueppRKv0fAj0ucjKrrs4AAAAASUVORK5CYII=',\n width: 560,\n height: 77},\n doc.content[1].text = detalhesArquivo ,\n\n\n );\n\n\n }\n },\n {extend: 'print', text: 'Imprim.'}\n ]\n\n\n\n } );\n \n \n} ); \n\n\n\n</script>\n\n<!-- End generated Jquery from $ajax_source_url ---> \nEOT;\n\nreturn $js; //returns the completed jquery string\n}", "function create()\n {\n $this->definitions['columns'] =& $this->columns;\n return $this->connection->create_table($this->name, $this->definitions);\n }", "public function anyData()\n\t{\n\t return Datatables::of(Estado::query())->make(true);\n\t}", "public function create($driver, array $params = array())\n {\n $params['browser'] = $this->_injector->getInstance('Horde_Browser');\n $params['vars'] = Horde_Variables::getDefaultVariables();\n\n if (strcasecmp($driver, 'csv') === 0) {\n $params['charset'] = 'UTF-8';\n }\n\n return Horde_Data::factory($driver, $params);\n }", "public function html(): Builder\n {\n return $this->builder()\n ->setTableId('floorsDatatable')\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->orderBy(1)\n ->lengthMenu([[5, 10, 25, 50, -1], [5, 10, 25, 50, 'All']]);\n\n }", "public function dataTables() \n\t{\n $spa = Spas::select(array(\n 'spas.id',\n 'spas.name',\n 'spas.description',\n 'hotels.name AS hotel_name',\n 'spas.status',\n 'spas.created_at'\n ))\n ->leftJoin('hotels', 'hotels.id', '=', 'spas.hotel_id');\n\n\t\treturn Datatables::of($spa)\n ->edit_column('status','@if($status == 1) Active @else Inactive @endif')\n ->add_column('actions', '\n <a href=\"{{ URL::action(\\'App\\Controllers\\Backend\\SpasController@edit\\', array($id) ) }}\" class=\"btn btn-info btn-sm\" title=\"Edit\"><i class=\"fa fa-fw fa-edit\"></i></a>\n <a href=\"javascript:void(0);\" onclick=\"deleteItem(\\'{{$id}}\\');\" class=\"btn btn-danger btn-sm\" title=\"Delete\"><i class=\"fa fa-fw fa-times\"></i></a>')\n ->edit_column ('id', '<span id=\"row-{{$id}}\" class=\"checkbox-column\"><input type=\"checkbox\" value=\"{{$id}}\" /></span>')\n\t\t\t->make();\n\t}", "public function factory(array $data = [])\n {\n $model = $this->newQuery()->getModel()->newInstance();\n\n $this->setModelData($model, $data);\n\n return $model;\n }", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "public function builder()\n {\n return new Builder($this);\n }", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "public function build($id)\n {\n $file = $this->getFile($id);\n $array = $this->parseFile($id, $file);\n\n // Type\n $type = $array[\"type\"];\n switch ($type) {\n case self::DATAGRID_TYPE_DATAGRID:\n $datagrid = new Datagrid($id);\n break;\n case self::DATAGRID_TYPE_ENTITY_DATAGRID:\n $datagrid = new EntityDatagrid($id);\n break;\n default:\n throw new Exception(\"Unknown datagrid type '$type' in '$file'\");\n }\n\n // Columns\n foreach ($array[\"columns\"] as $key => $columnData) {\n $label = $columnData[\"label\"];\n if (isset($columnData[\"path\"])) {\n $path = $columnData[\"path\"];\n } else {\n $path = null;\n }\n switch ($columnData[\"type\"]) {\n case self::COLUMN_TYPE_TEXT:\n case self::COLUMN_TYPE_LONGTEXT:\n $column = new Column($key, $label, $path);\n break;\n case self::COLUMN_TYPE_DATETIME:\n $column = new DateTimeColumn($key, $label, $path);\n break;\n default:\n throw new Exception(\"Unknown column type '{$columnData[\"type\"]}' for $key in '$file'\");\n }\n $datagrid->addColumn($column);\n }\n\n // Endpoints\n if (isset($array[\"endpoints\"])) {\n foreach ($array[\"endpoints\"] as $type => $url) {\n $datagrid->setEndpoint($type, $url);\n }\n }\n\n return $datagrid;\n }", "public static function builder() {\n return new self();\n }", "public function getData()\n {\n return Datatables::of(App\\Models\\LiberationItem::where('company_id', Auth::user()->company_id))->make(true);\n }", "function &Factory($element, $moduleID)\n{\n $view = new SubDataView($element, $moduleID);\n return $view;\n}", "public static function keys($builder)\n {\n return datatables()\n ->of($builder)\n ->addColumn('checkbox', function ($data) {\n return view(\n 'admin.common.checkbox',\n compact('data')\n )->render();\n })\n ->addColumn('g2a_product', function ($data) {\n return '<a href=\"' . route('admin.g2a-product.show', $data->g2a_product_id) . '\">'. $data->g2a_product_name . '</a>';\n })\n ->addColumn('key', function ($data) {\n return $data->key ?? '<code> Not Imported </code>';\n })\n ->addColumn('original_price', function ($data) {\n return $data->original_price ?? '<code> -- </code>';\n })\n ->addColumn('selling_price', function ($data) {\n return ($data->selling_price ?? \"<a href='\" . route('admin.g2a-product.key.edit', [$data->g2a_product_id, $data->id]) . \"'> Set Now </a>\");\n })\n ->addColumn('is_used', function ($data) {\n return view(\n 'admin.gift-cards.partials.is_used',\n compact('data')\n )->render();\n })\n ->addColumn('transaction', function ($data) {\n return view(\n 'admin.gift-cards.partials.transactions-details',\n compact('data')\n )->render();\n })\n ->addColumn('buyer', function ($data) {\n if($data->buyer_id){\n return '<a href=\"' . route('admin.user.show', $data->buyer_id) . '\"> '. $data->buyer_name . '</a>';\n }\n return '<code> Not Applicable </code>';\n })\n ->addColumn('picker', function ($data) {\n if($data->picker_id)\n return '<a href=\"' . route('admin.user.show', $data->picker_id) . '\"> '. $data->picker_name . '</a>';\n else{\n if($data->transaction_status == Payment::PAYMENT_STATUS_DELIVERED)\n return '<code> Automatic </code>';\n else\n return '<code> Not Picked </code>';\n }\n })\n ->addColumn('status', function ($data) {\n return '<span class=\"badge\">' . G2AProductKeys::$status[$data->status] . '</span>';\n })\n ->addColumn('created_at', function ($data) {\n return $data->created_at;\n })\n ->addColumn('updated_at', function ($data) {\n return $data->updated_at;\n })\n ->addColumn('actions', function ($data) {\n return view(\n 'admin.g2a.keys.datatable-actions',\n compact('data')\n )->render();\n })\n ->rawColumns([ 'gift_card', 'key', 'is_used', 'checkbox', 'actions', 'transaction', 'buyer', 'picker', 'status', 'original_price', 'selling_price' ])\n ->make(true);\n }", "public function getDataTable()\n {\n if (is_null($this->dataTable)) {\n throw new \\Exception(\"The DataTable object has not yet been created\");\n }\n\n return $this->dataTable;\n }", "public function getData()\n {\n return Datatables::of(App\\Models\\Courier::where('company_id', Auth::user()->company_id))->make(true);\n }", "public function getSchemaBuilder()\n {\n if (is_null($this->schemaGrammar)) {\n $this->useDefaultSchemaGrammar();\n }\n\n return new SQLiteBuilder($this);\n }", "protected function getDataSet()\n {\n $dir = $GLOBALS['DB_CSV_DIR'];\n\n // create a new CSV data set\n $dataSet = new CsvDataSet();\n\n $dataSet->addTable('Address', $dir . \"Address.csv\");\n $dataSet->addTable('Person', $dir . \"Person.csv\");\n $dataSet->addTable('EmailAddress', $dir . \"EmailAddress.csv\");\n $dataSet->addTable('L_EmailAddressType', $dir . \"L_EmailAddressType.csv\");\n $dataSet->addTable('R_PersonEmailAddress', $dir . \"R_PersonEmailAddress.csv\");\n\n return $dataSet;\n }", "public function columnFactory()\n {\n return $this->columnFactory;\n }", "public static function getDataset()\n {\n $dataset = new Beans\\Dataset();\n \n $dataset->setStatus(0);\n $dataset->setCreatedOn(date(Application::TIMESTAMP));\n $dataset->setDistinctMolecules(0);\n $dataset->setInitialMolecules(0);\n $dataset->setIsCleaned(0);\n $dataset->setTs(date(Application::TIMESTAMP));\n \n return $dataset;\n }" ]
[ "0.6687568", "0.66512233", "0.65645576", "0.6399188", "0.6253602", "0.62086797", "0.6186943", "0.60946995", "0.6080192", "0.6046568", "0.59955144", "0.59952843", "0.5994222", "0.58606464", "0.5830252", "0.5798715", "0.5784527", "0.5774832", "0.57320315", "0.5710996", "0.5704451", "0.5701265", "0.57012534", "0.5677915", "0.5663169", "0.5612788", "0.561102", "0.5597212", "0.5574404", "0.55726075", "0.5571555", "0.5565625", "0.5565229", "0.5562298", "0.5558273", "0.55579686", "0.55509853", "0.55456764", "0.5536992", "0.5531424", "0.5531424", "0.55266947", "0.5526458", "0.5526003", "0.54954314", "0.54929924", "0.5475807", "0.54687303", "0.5464231", "0.5458315", "0.5452401", "0.54494995", "0.5447128", "0.54465896", "0.54415834", "0.5430733", "0.54307264", "0.5425886", "0.5421083", "0.54166484", "0.5415385", "0.54082876", "0.5405604", "0.53977907", "0.53963244", "0.5395029", "0.5371486", "0.5343285", "0.5340207", "0.5337533", "0.5334418", "0.5326597", "0.53192943", "0.53164256", "0.5316025", "0.52969307", "0.5294446", "0.52896535", "0.5283511", "0.5276414", "0.52712166", "0.5271199", "0.52451694", "0.52425754", "0.5238134", "0.5226998", "0.52241063", "0.52151716", "0.521178", "0.52022916", "0.5198133", "0.51978606", "0.518628", "0.51827383", "0.5172001", "0.5171605", "0.51683676", "0.516297", "0.5161722", "0.5160848", "0.5148848" ]
0.0
-1
Public Methods ========================================================================= Parses some HTML for headings and adds anchor links to them.
public function parseHtml($html, $tags = 'h1,h2,h3') { $tags = ArrayHelper::stringToArray($tags); return preg_replace_callback('/<('.implode('|', $tags).')([^>]*)>(.+?)<\/\1>/', array($this, '_addAnchorToTagMatch'), $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heading_anchors() {\r\n\t\t// headings to have an anchor, so we can take the option that the structure() function now offers us for achieving the same end.\r\n\t\t$count = 0;\r\n\t\t$arrayRxp = array(\r\n\t\t//'(<h1>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h6>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t// (2011-06-27) the name attribute is deprecated\r\n\t\t// hmm, this is further complicated by the fact that preexistent id attributes on headings can act as anchors...\r\n\t\t'(<h1)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h6)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t);\r\n\t\tforeach($arrayRxp as $search => $replace) {\r\n\t\t\t$this->code = preg_replace('/' . $search . '/is', $replace, $this->code, -1, $ct);\r\n\t\t\t$count += $ct;\r\n\t\t}\r\n\t\t$this->logMsgIf('heading_anchors', $count);\r\n\t}", "public function getHeadingLinks($html) {\n $dom = new \\DOMDocument();\n\n // Load HTML but suppress warnings.\n $libxml_previous_state = libxml_use_internal_errors(TRUE);\n $dom->loadHTML($html);\n libxml_clear_errors();\n libxml_use_internal_errors($libxml_previous_state);\n\n $finder = new \\DomXPath($dom);\n $elements = $finder->query(\"//h2\");\n $links = [];\n foreach ($elements as $el) {\n if ($el->hasAttribute('id')) {\n $links[] = [\n 'title' => $el->textContent,\n 'url' => '#' . $el->getAttribute('id'),\n ];\n }\n }\n return $links;\n }", "function headings() {\r\n\t\t// and that they receive anchors so that they may be linked to from the table of contents.\r\n\t\t//ReTidy::force_headings();\r\n\t\tReTidy::heading_anchors();\r\n\t}", "function anchor_content_headings($content) {\n // now run the pattern and callback function on content\n // and process it through a function that replaces the title with an id \n $content = preg_replace_callback(\"/\\<h([1|2|3|4])\\>(.*?)\\<\\/h([1|2|3|4])\\>/\", function ($matches) {\n $hTag = $matches[1];\n $title = $matches[2];\n $slug = str_replace(\" \", \"-\", strtolower($title));\n return '<a href=\"#'. $slug .'\"><h'. $hTag .' id=\"' . $slug . '\">' . $title . '</h'. $hTag .'></a>';\n }, $content);\n return $content;\n }", "protected function processHeadingNodes()\n {\n $nodes = $this->getHeadingNodes();\n $this->setPageTitle($nodes);\n $this->addHeadings($nodes);\n $this->setHtmlFromDomDocument();\n }", "public function getHeadingLinks(): array;", "private function normalize_html_head(){\n\n foreach ( (new HEAD_Section_Normalizer())->as_array() as $result)\n {\n\n }\n\n }", "public function extract_headings(&$find, &$replace, $content = '') {\n $matches = array();\n $anchor = '';\n $items = FALSE;\n\n // reset the internal collision collection as the_content may have been triggered elsewhere\n // eg by themes or other plugins that need to read in content such as metadata fields in\n // the head html tag, or to provide descriptions to twitter/facebook\n $this->collision_collector = array();\n\n if (is_array($find) && is_array($replace) && $content) {\n // get all headings\n // the html spec allows for a maximum of 6 heading depths\n if (preg_match_all('/(<h([1-6]{1})[^>]*>).*<\\/h\\2>/msuU', $content, $matches, PREG_SET_ORDER)) {\n\n // remove undesired headings (if any) as defined by heading_levels\n\n $new_matches = array();\n for ($i = 0; $i < count($matches); $i++) {\n if (in_array($matches[$i][2], $this->options[\"heading_levels\"])) {\n $new_matches[] = $matches[$i];\n }\n }\n $matches = $new_matches;\n\n // remove empty headings\n $new_matches = array();\n for ($i = 0; $i < count($matches); $i++) {\n if (trim(strip_tags($matches[$i][0])) != FALSE) {\n $new_matches[] = $matches[$i];\n }\n }\n if (count($matches) != count($new_matches)) {\n $matches = $new_matches;\n }\n\n // check minimum number of headings\n if (count($matches) >= $this->options['start']) {\n\n for ($i = 0; $i < count($matches); $i++) {\n // get anchor and add to find and replace arrays\n $anchor = $this->url_anchor_target($matches[$i][0]);\n $find[] = $matches[$i][0];\n $replace[] = str_replace(\n array(\n $matches[$i][1], // start of heading\n '</h' . $matches[$i][2] . '>' // end of heading\n ),\n array(\n $matches[$i][1] . '<span id=\"' . $anchor . '\">',\n '</span></h' . $matches[$i][2] . '>'\n ),\n $matches[$i][0]\n );\n\n }\n\n // build a hierarchical toc?\n // we could have tested for $items but that var can be quite large in some cases\n $items = $this->build_hierarchy($matches);\n\n }\n }\n }\n\n return $items;\n }", "private function headings() {\n\t\t$this->section_data['general_h_tags'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_h_tags',\n\t\t\t'label' \t\t\t\t=> __( 'Headings', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h1' => 'Heading 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h2' => 'Heading 2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h3' => 'Heading 3',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h4' => 'Heading 4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h5' => 'Heading 5',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h6' => 'Heading 6',\n\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check which HTML headings automatically generated table of contents.', 'fixedtoc' )\n\t\t);\n\t}", "public function getTableOfContents($html)\n {\n preg_match_all(\"/(<h([1-6]{1})[^<>]*>)(.+)(<\\/h[1-6]{1}>)/\", $html, $matches, PREG_SET_ORDER);\n\n $toc = \"\";\n $list_index = 0;\n $indent_level = 0;\n $raw_indent_level = 0;\n $anchor_history = array();\n\n foreach ($matches as $val) {\n\n ++$list_index;\n $prev_indent_level = $indent_level;\n $indent_level = $val[2];\n $anchor = self::getSafeParameter( $val[3] );\n\n // ensure that we don't reuse an anchor\n $anchor_index = 1;\n $raw_anchor = $anchor;\n while ( in_array( $anchor, $anchor_history ) ) {\n $anchor_index++;\n $anchor = $raw_anchor . strval( $anchor_index );\n }\n\n array_push( $anchor_history, $anchor );\n if ( $indent_level > $prev_indent_level ) {\n // indent further (by starting a sub-list)\n $toc .= \"\\n<ul>\\n\";\n $raw_indent_level++;\n }\n if ( $indent_level < $prev_indent_level ) {\n // end the list item\n $toc .= \"</li>\\n\";\n // end this list\n $toc .= \"</ul>\\n\";\n $raw_indent_level--;\n }\n if ( $indent_level <= $prev_indent_level ) {\n // end the list item too\n $toc .= \"</li>\\n\";\n }\n // add permalink?\n if ( $this->config['permalink'] != \"\" ) {\n $pl = ' <a href=\"#'.$anchor.'\" class=\"permalink\" title=\"link to this section\">' . $this->config['permalink'] . '</a>';\n } else {\n $pl = \"\";\n }\n // print this list item\n $toc .= '<li><a href=\"#'.$anchor.'\">'. $val[3] . '</a>';\n $Sections[$list_index] = '/' . addcslashes($val[1] . $val[3] . $val[4], '/.*?+^$[]\\\\|{}-()') . '/'; // Original heading to be Replaced\n $SectionWIDs[$list_index] = '<h' . $val[2] . ' id=\"'.$anchor.'\">' . $val[3] . $pl . $val[4]; // New Heading\n }\n // close out the list\n $toc .= \"</li>\\n\";\n for ( $i = $raw_indent_level; $i > 1; $i-- ) {\n $toc .= \"</ul>\\n</li>\\n\";\n }\n $toc .= \"</ul>\\n\";\n\n return '<div id=\"toc\" class=\"alert alert-info col-lg-4 col-md-5 col-sm-12 col-xs-12 pull-right\" style=\"margin-left: 10px;\">' . $toc . '</div>' . \"\\n\" . preg_replace($Sections, $SectionWIDs, $html, 1);\n }", "private function _parseHead($H) {\n $result = array(\n 'meta' => array(),\n 'title' => '',\n 'script' => array(),\n 'stylesheets' => array(),\n 'custom' => array()\n );\n\n $H->select('head > meta')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n $result['meta'][] = $node->ownerDocument->saveXML($node);\n });\n\n $H->select('head > title')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n $result['title'] = $node->textContent;\n });\n\n $H->select('head > script')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if ($node->hasAttribute('src')) {\n $result['script'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'type' => $node->hasAttribute('type') ? $node->getAttribute('type') : 'text/javascript',\n 'src' => $node->getAttribute('src')\n );\n } else {\n // http://stackoverflow.com/questions/6399924/getting-nodes-text-in-php-dom\n foreach ($node->childNodes as $child) {\n if ($child->nodeType == XML_TEXT_NODE) {\n $result['script'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'type' => $node->hasAttribute('type') ? $node->getAttribute('type') : 'text/javascript',\n 'body' => $child->textContent\n );\n break;\n }\n }\n }\n });\n\n $H->select('head > link')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if ($node->hasAttribute('rel') && $node->getAttribute('rel') == 'stylesheet' && $node->hasAttribute('href')) {\n $result['stylesheets'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'rel' => 'stylesheet',\n 'type' => 'text/css',\n 'href' => $node->getAttribute('href')\n );\n } else {\n // Some other tag so add it to the custom array\n $result['custom'][] = $node->ownerDocument->saveXML($node);\n }\n });\n\n // Notably, remove() doesn't seem to work, so do it this way instead\n $H->select('head > *')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if (!in_array($node->tagName, array('meta', 'title', 'script', 'link')))\n $result['custom'][] = $node->ownerDocument->saveXML($node);\n });\n\n // For some reason the ordering gets reversed in the above, so fix it for the ones that matter\n $result['script'] = array_reverse($result['script']);\n $result['stylesheets'] = array_reverse($result['stylesheets']);\n $result['custom'] = array_reverse($result['custom']);\n\n return $result;\n }", "public function headerLinks(string $description) : string\n {\n /**\n * Support h1-h10 headers. You can using wysiwyg editor and replace h7-h10 tags.\n * This operation clear p tags around headers\n */\n $description = preg_replace(\"/<(p|[hH](10|[1-9]))>(<[hH](10|[1-9]).*?>(.*?)<\\/[hH](10|[1-9])>)<\\/(p|[hH](10|[1-9]))>/\", \"$3\", $description);\n\n preg_match_all(\"/<[hH](10|[1-9]).*?>(.*?)<\\/[hH](10|[1-9])>/\", $description, $items);\n\n $usedItem = [];\n\n for ($i = 0; $i < count($items[0]); $i++) {\n\n $name = preg_replace($this->stripTags, '', trim($this->replaceH1Symbols($items[2][$i])));\n\n if ($name) {\n $link = preg_replace($this->symbols, '', strtolower($name));\n $link = preg_replace($this->spaces, '-', $link);\n $repeatCount = count(array_keys($usedItem, $name));\n\n if ($repeatCount > 0) {\n $link .= '-' . ($repeatCount + 1);\n }\n\n $title = \"<h\" . $items[1][$i] . \" id='\" . $link . \"'>\" . $items[2][$i] . \"</h\" . $items[1][$i] . \">\";\n\n $description = $this->replaceFirstOccurrence($items[0][$i], $title, $description);\n\n $usedItem[] = $name;\n } else {\n $description = $this->replaceFirstOccurrence($items[0][$i], '', $description);\n }\n }\n\n return $description;\n }", "public function setHeadings($headings);", "protected function getHeadingNodes()\n {\n $xpath = new DomXpath($this->doc);\n $query = '/html/body/*[self::h1 or self::h2 or self::h3 or self::h4 '\n . ' or self::h5 or self::h6]';\n return $xpath->query($query);\n }", "function extractHrefs($html){\n\t$dom = new DOMDocument;\n\t//Parse the HTML. The @ is used to suppress any parsing errors\n\t//that will be thrown if the $html string isn't valid XHTML.\n\t@$dom->loadHTML($html);\n\t//Get all links. You could also use any other tag name here,\n\t//like 'img' or 'table', to extract other tags.\n\t$links = $dom->getElementsByTagName('a');\n\t$hrefs=array();\n\t//Iterate over the extracted links and display their URLs\n\tforeach ($links as $link){\n\t\t$hrefs[]=array('title'=>truncate_utf8($link->nodeValue,128),'link'=>$link->getAttribute('href'));\n\t}\n\treturn $hrefs;\n}", "static function __parseLinksHTML($match)\n\t{\n\t\t$completeUrl = $match[1] ? $match[0] : \"http://{$match[0]}\";\n\n\t\treturn '<a target=\"_blank\" href=\"' . $completeUrl . '\">'\n\t\t . $match[2] . $match[3] . $match[4] . '</a>';\n\t}", "protected function setHeadTags()\n {\n $strTagClose = ($GLOBALS['objPage']->outputFormat == 'xhtml')\n ? ' />'\n : '>';\n\n // Add rel=\"prev\" and rel=\"next\" links (see #3515)\n if ($this->hasPrevious()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"prev\" href=\"' .\n $this->linkToPage($this->intPage - 1) .\n '\"' . $strTagClose;\n }\n if ($this->hasNext()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"next\" href=\"' .\n $this->linkToPage($this->intPage + 1) .\n '\"' . $strTagClose;\n }\n }", "abstract function getheadings();", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "function linkHeaders($headers)\n {\n $this->headers = $headers;\n $this->align = false;\n $this->style = false;\n }", "function get_a_additionaltags($file){\r\n $h1count = preg_match_all('/<(a.*) href=\"(.*?)\"(.*)>(.*)(<\\/a>)/',$file,$patterns);\r\n return $patterns[3];\r\n}", "function remove_headerlinks($html) {\n\t// replace\n\t$target = [\n\t\t'search' => [\n\t\t\t'<a href=\"http://expressjs.com/\" class=\"express\">Express</a>',\n\t\t],\n\t\t'replace' => [\n\t\t\t'<span class=\"express\">Express</span>',\n\t\t],\n\t];\n\n\t$html = str_replace($target['search'], $target['replace'], $html);\n\n\t// remove\n\t$target = [\n\t\t['<li><a href=\"index.html\" id=\"home-menu\" class=\"active\"', \"</li>\\n\"],\n\t\t['<li><a href=\"index.html\" id=\"home-menu\"', \"</li>\\n\"],\n\t\t['<li><a href=\"../index.html\" id=\"home-menu\"', \"</li>\\n\"],\n\t\t['<li><a href=\"http://expressjs.com/2x/\"', \"</li>\\n\"],\n\t];\n\n\tforeach ($target as $val) {\n\t\tif ($html && ($p = strpos($html, $val[0])) !== false) {\n\t\t\tif (($q = strpos($html, $val[1], $p + 1)) !== false) {\n\t\t\t\t$html = substr($html, 0, $p) . substr($html, $q + strlen($val[1]));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $html;\n}", "function faculty_settings_headline_links() { \n faculty_setting_line(faculty_add_color_setting('h2_link_color', __('H2 Link Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('h2_link_decoration', __('H2 Link Decoration', FACULTY_DOMAIN), 'decoration'));\n faculty_setting_line(faculty_add_color_setting('h2_link_hover', __('H2 Link Hover', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('h2_link_hover_decoration', __('H2 Link Hover Decoration', FACULTY_DOMAIN), 'decoration'));\n do_action('faculty_settings_headline_links');\n}", "public function setHeadings($headings){\n\t\t\t$this->headings = $headings;\n\t\t}", "protected function getHeadingHtml() {\n\t\t$heading = '';\n\t\tif ( $this->isUserPage ) {\n\t\t\t// The heading is just the username without namespace\n\t\t\t$heading = $this->pageUser->getName();\n\t\t} else {\n\t\t\t$pageTitle = $this->getOutput()->getPageTitle();\n\t\t\tif ( $pageTitle ) {\n\t\t\t\t$heading = $pageTitle;\n\t\t\t}\n\t\t}\n\t\treturn Html::rawElement( 'h1', [ 'id' => 'section_0' ], $heading );\n\t}", "function headingify($to_headingify, $level) {\r\n\t\t$to_headingify = preg_replace('/<(h[1-6])([^<>]*?)>(.*?)<\\/\\1>/is', '<p$2>$3</p>', $to_headingify);\r\n\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, 0);\r\n\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t$tagname = $tagname_matches[1][0];\r\n\t\twhile($tagname === \"div\") {\r\n\t\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, $pre_heading_OString_offset + strlen($tagname) + 1);\r\n\t\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t\t$tagname = $tagname_matches[1][0];\r\n\t\t}\r\n\t\t$pre_heading_OString = substr($to_headingify, 0, $pre_heading_OString_offset);\r\n\t\t$heading_OString = OM::getOString($to_headingify, \"<\" . $tagname, \"</\" . $tagname . \">\");\r\n\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t$strlen_heading_OString = strlen($heading_OString);\r\n\t\tif(is_numeric($level) && $level > 0 && $level < 7) {\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = preg_replace('/<(\\w+)([^<>]*?)>/is', '<h' . $level . '$2>', $heading_OString, 1);\r\n\t\t\t$heading_OString = ReTidy::remove_tags($heading_OString, \"strong\");\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = substr($heading_OString, 0, strlen($heading_OString) - strlen($tagname) - 1) . \"h\" . $level . \">\";\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t} else {\r\n\t\t\t$pos_lt = strpos($heading_OString, '>');\r\n\t\t\t$pos_gt = ReTidy::strpos_last($heading_OString, '<');\r\n\t\t\t$heading_OString = substr($heading_OString, 0, $pos_lt + 1) . '<strong>' . substr($heading_OString, $pos_lt + 1, $pos_gt - ($pos_lt + 1)) . '</strong>' . substr($heading_OString, $pos_gt);\r\n\t\t}\r\n\t\t$headingified = $pre_heading_OString . $heading_OString . substr($to_headingify, strlen($pre_heading_OString) + $strlen_heading_OString);\r\n\t\treturn $headingified;\r\n\t}", "function _parseHtml($html)\n\t\t{\n\t\t\t$html=preg_replace(\"/<!DOCTYPE((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$html=preg_replace(\"/<script((.|\\n)*?)>((.|\\n)*?)<\\/script>/ims\",\"\",$html);\n\t\t\tpreg_match(\"/<head>((.|\\n)*?)<\\/head>/ims\",$html,$matches);\n\t\t\t$head=$matches[1];\n\t\t\tpreg_match(\"/<title>((.|\\n)*?)<\\/title>/ims\",$head,$matches);\n\t\t\t$this->title = $matches[1];\n\t\t\t$html=preg_replace(\"/<head>((.|\\n)*?)<\\/head>/ims\",\"\",$html);\n\t\t\t$head=preg_replace(\"/<title>((.|\\n)*?)<\\/title>/ims\",\"\",$head);\n\t\t\t$head=preg_replace(\"/<\\/?head>/ims\",\"\",$head);\n\t\t\t$html=preg_replace(\"/<\\/?body((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$this->htmlHead=$head;\n\t\t\t$this->htmlBody=$html;\n\t\t\treturn;\n\t\t}", "private function renderSectionHeadings() {\n\t\t$headings = array();\n\t\t$separator = $this->getSubpart('HEADING_SEPARATOR');\n\n\t\tforeach ($this->sections as $key => $section) {\n\t\t\t$class = ($key == 0) ? 'tx-explanationbox-pi1-active' : 'tx-explanationbox-pi1-inactive';\n\n\t\t\t$this->setMarker('class_heading', $class);\n\t\t\t$this->setMarker('heading_number', $key);\n\t\t\t$this->setMarker('heading', htmlspecialchars($section['title']));\n\t\t\t$headings[] = $this->getSubpart('SINGLE_HEADING');\n\t\t}\n\n\t\tif (count($this->sections) > 1) {\n\t\t\t$this->setMarker('class_rightarrow', 'tx-explanationbox-pi1-active');\n\t\t} else {\n\t\t\t$this->setMarker('class_rightarrow', 'tx-explanationbox-pi1-inactive');\n\t\t}\n\n\t\t$this->setMarker('number_of_sections', count($this->sections));\n\t\t$this->setSubpart('SECTION_HEADINGS', implode($separator, $headings));\n\t}", "function beerfamily_html_head_alter(&$head_elements) {\n \n // текущий url \n $current_uri = $_SERVER['REDIRECT_URL'];\n \n // цикл по meta-tags\n foreach ($head_elements as $key => $element) {\n\n \t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n\n\t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n }\n\n // получаем тип ноды\t \n $node = menu_get_object();\n $node->type;\n\n // если нода не news то не индексируем сущность\n if ( ($current_uri != \"/news\") && ($node->type != \"news\") ) {\n\t \n\t $head_elements[1000][\"#tag\"] = 'link';\n\t $head_elements[1000]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1000]['#attributes']['hreflang'] = 'ru';\n\t $head_elements[1000]['#attributes']['href'] = 'http://beerfamily.ru'.$current_uri;\n\t $head_elements[1000]['#type'] = 'html_tag';\n\n\t $head_elements[1001][\"#tag\"] = 'link';\n\t $head_elements[1001]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1001]['#attributes']['hreflang'] = 'en-us';\n\t $head_elements[1001]['#attributes']['href'] = 'http://beerfamily.ru/en'.$current_uri;\n\t $head_elements[1001]['#type'] = 'html_tag';\n\n\t $head_elements[1002][\"#tag\"] = 'link';\n\t $head_elements[1002]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1002]['#attributes']['hreflang'] = 'zh-cn';\n\t $head_elements[1002]['#attributes']['href'] = 'http://beerfamily.ru/cn'.$current_uri;\n\t $head_elements[1002]['#type'] = 'html_tag';\n\n }\n\n // получаем текущий язык\n if (strpos($current_uri,'en/') != \"\") $lang = 'en';\n if (strpos($current_uri,'cn/') != \"\") $lang = 'cn';\n \n // если нода news и язык en или cn то не индексируем сущность\n if ( ($node->type == \"news\") && ( ($lang == 'en') || ($lang == 'cn') )) {\n\t \n\t $head_elements[1003][\"#tag\"] = 'meta';\n\t $head_elements[1003]['#attributes']['name'] = 'robots';\n\t $head_elements[1003]['#attributes']['content'] = 'nofollow';\n\t $head_elements[1003]['#type'] = 'html_tag'; \n \n }\n \n // переопределяем description\n\n // если нода beers и язык не en и не cn пишем description для страницы Пива\n \n if ( ($node->type == \"beer\") && ( $lang != 'en') && ($lang != 'cn') ){\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить пиво '.$node->title.' оптом и в розницу. Описание, крепость, плотность пива.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n }\n \n switch ($current_uri) {\n case '':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'Официальный сайт ресторанной группы Beer Family Project холдинга ReCa в Санкт-Петербурге. История и описание компании.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n\t break;\n\t \n case '/restaurants':\t \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Список пивных ресторанов и баров в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/jager-haus':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть немецких пивных ресторанов Jager в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/karlovy-pivovary':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть чешских пивных ресторанов Karlovy Pivovary в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/kriek':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть бельгийских пивных ресторанов Kriek в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\n\tcase '/restaurants/ivandamaria':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть гастробаров Иван да Марья в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание ресторана русской кухни, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t\n\tcase '/restaurants/beer-family-restaurant':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family на Невском проспекте Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторана на карте.';\n\t break;\n\t \n\tcase '/about':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'История компании Beer Family Project';\n\t break;\n \n\tcase '/beers':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить импортное пиво оптом. Большой ассортимент пива разных сортов! Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/distribution':\n\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Дистрибуция пива в Санкт-Петербурге. Компании-дистрибьюторы пива';\n\t break;\n\n\tcase '/franchise':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Хотите открыть пивной ресторан или пивной бар по франшизе? Станьте новым членом нашей дружной семьи Beer Family Project с франшизой наших концептов! ';\n\t break;\n\n case '/restaurants':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family Project: Kriek, Karlovy Pivovary, Jager, Иван да Марья';\n\t break;\n\n case '/news':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Новости компании Beer Family Project';\n\t break;\n\n case '/jobs':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Вакансии компании Beer Family Project. ';\n\t break;\n\n case '/partners':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Партнеры компании Beer Family Project. ';\n\t break;\n \n\tcase '/beers/chehiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее чешское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n \n case '/beers/irlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее ирландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/beers/angliya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее английское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/shotlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее шотландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/germaniya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее немецкое пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/belgiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее бельгийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/kraftovoe-pivo': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить бутылочное и разливное крафтовое пиво. Звоните! ☎️ 8 (812) 337-58-95 ';\n\t break;\n\t\n\tcase '/beers/cidry': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящий сидр оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/avstriya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее австрийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/italiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее итальянское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t \n }\n \n // добавляем meta для постраничных\n if ($_GET['page'] >= 1){\n\t if ( ( $lang != 'en') && ($lang != 'cn') ){\n\t\t $head_elements[1005][\"#tag\"] = 'meta';\n\t\t $head_elements[1005]['#attributes']['name'] = 'robots';\n\t\t $head_elements[1005]['#type'] = 'html_tag'; \n\t\t $head_elements[1005]['#attributes']['content'] = 'noindex, follow';\n\t }\n }\n \n}", "public static function extractHeadingFromText( $parser, $page, $title,\n\t\t$text, $sec = '', $to = '', &$sectionHeading, $recursionCheck = true,\n\t\t$maxLength = - 1, $cLink = 'default', $trim = false, $skipPattern = array()\n\t) {\n\t\t$continueSearch = true;\n\t\t$n = 0;\n\t\t$output[$n] = '';\n\t\t$nr = 0;\n\t\t// check if we are going to fetch the n-th section\n\t\tif ( preg_match( '/^%-?[1-9][0-9]*$/', $sec ) ) {\n\t\t\t$nr = substr( $sec, 1 );\n\t\t}\n\t\tif ( preg_match( '/^%0$/', $sec ) ) {\n\t\t\t$nr = - 2; // transclude text before the first section\n\t\t}\n\n\t\t// if the section name starts with a # or with a @ we use it as regexp, otherwise as plain string\n\t\t$isPlain = true;\n\t\tif ( $sec != '' && ( $sec[0] == '#' || $sec[0] == '@' ) ) {\n\t\t\t$sec = substr( $sec, 1 );\n\t\t\t$isPlain = false;\n\t\t}\n\t\tdo {\n\t\t\t// Generate a regex to match the === classical heading section(s) === we're\n\t\t\t// interested in.\n\t\t\t$headLine = '';\n\t\t\tif ( $sec == '' ) {\n\t\t\t\t$begin_off = 0;\n\t\t\t\t$head_len = 6;\n\t\t\t} else {\n\t\t\t\tif ( $nr != 0 ) {\n\t\t\t\t\t$pat = '^(={1,6})\\s*[^=\\s\\n][^\\n=]*\\s*\\1\\s*($)';\n\t\t\t\t} elseif ( $isPlain ) {\n\t\t\t\t\t$pat = '^(={1,6})\\s*' . preg_quote( $sec, '/' ) . '\\s*\\1\\s*($)';\n\t\t\t\t} else {\n\t\t\t\t\t$pat = '^(={1,6})\\s*' . str_replace( '/', '\\/', $sec ) . '\\s*\\1\\s*($)';\n\t\t\t\t}\n\t\t\t\tif ( preg_match( \"/$pat/im\", $text, $m, PREG_OFFSET_CAPTURE ) ) {\n\t\t\t\t\t$mata = array();\n\t\t\t\t\t$no_parenthesis = preg_match_all( '/\\(/', $pat, $mata );\n\t\t\t\t\t$begin_off = $m[$no_parenthesis][1];\n\t\t\t\t\t$head_len = strlen( $m[1][0] );\n\t\t\t\t\t$headLine = trim( $m[0][0], \"\\n =\\t\" );\n\t\t\t\t} elseif ( $nr == - 2 ) {\n\t\t\t\t\t$m[1][1] = strlen( $text ) + 1; // take whole article if no heading found\n\t\t\t\t} else {\n\t\t\t\t\t// match failed\n\t\t\t\t\treturn $output;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// create a link symbol (arrow, img, ...) in case we have to cut the text block to maxLength\n\t\t\t$link = $cLink;\n\t\t\tif ( $link == 'default' ) {\n\t\t\t\t$link = ' [[' . $page . '#' . $headLine . '|..→]]';\n\t\t\t} elseif ( strstr( $link, 'img=' ) != false ) {\n\t\t\t\t$link = str_replace(\n\t\t\t\t\t'img=',\n\t\t\t\t\t\"<linkedimage>page=\" . $page . '#' . $headLine . \"\\nimg=Image:\",\n\t\t\t\t\t$link\n\t\t\t\t) . \"\\n</linkedimage>\";\n\t\t\t} elseif ( strstr( $link, '%SECTION%' ) == false ) {\n\t\t\t\t$link = ' [[' . $page . '#' . $headLine . '|' . $link . ']]';\n\t\t\t} else {\n\t\t\t\t$link = str_replace( '%SECTION%', $page . '#' . $headLine, $link );\n\t\t\t}\n\t\t\tif ( $nr == - 2 ) {\n\t\t\t\t// output text before first section and done\n\t\t\t\t$piece = substr( $text, 0, $m[1][1] - 1 );\n\t\t\t\t$output[0] = self::parse( $parser, $title, $piece,\n\t\t\t\t\t\"#lsth:${page}|${sec}\", 0, $recursionCheck, $maxLength,\n\t\t\t\t\t$link, $trim, $skipPattern\n\t\t\t\t);\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\tif ( isset( $end_off ) ) {\n\t\t\t\tunset( $end_off );\n\t\t\t}\n\t\t\tif ( $to != '' ) {\n\t\t\t\t// if $to is supplied, try and match it. If we don't match, just ignore it.\n\t\t\t\tif ( $isPlain ) {\n\t\t\t\t\t$pat = '^(={1,6})\\s*' . preg_quote( $to, '/' ) . '\\s*\\1\\s*$';\n\t\t\t\t} else {\n\t\t\t\t\t$pat = '^(={1,6})\\s*' . str_replace( '/', '\\/', $to ) . '\\s*\\1\\s*$';\n\t\t\t\t}\n\t\t\t\tif ( preg_match( \"/$pat/im\", $text, $mm, PREG_OFFSET_CAPTURE, $begin_off ) ) {\n\t\t\t\t\t$end_off = $mm[0][1] - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !isset( $end_off ) ) {\n\t\t\t\tif ( $nr != 0 ) {\n\t\t\t\t\t$pat = '^(={1,6})\\s*[^\\s\\n=][^\\n=]*\\s*\\1\\s*$';\n\t\t\t\t} else {\n\t\t\t\t\t$pat = '^(={1,' . $head_len . '})(?!=)\\s*.*?\\1\\s*$';\n\t\t\t\t}\n\t\t\t\tif ( preg_match( \"/$pat/im\", $text, $mm, PREG_OFFSET_CAPTURE, $begin_off ) ) {\n\t\t\t\t\t$end_off = $mm[0][1] - 1;\n\t\t\t\t} elseif ( $sec == '' ) {\n\t\t\t\t\t$end_off = - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$nhead = self::countHeadings( $text, $begin_off );\n\t\t\twfDebug( \"LSTH: head offset = $nhead\" );\n\n\t\t\tif ( isset( $end_off ) ) {\n\t\t\t\tif ( $end_off == - 1 ) {\n\t\t\t\t\treturn $output;\n\t\t\t\t}\n\t\t\t\t$piece = substr( $text, $begin_off, $end_off - $begin_off );\n\t\t\t\tif ( $sec == '' ) {\n\t\t\t\t\t$continueSearch = false;\n\t\t\t\t} else {\n\t\t\t\t\t$text = substr( $text, $end_off );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$piece = substr( $text, $begin_off );\n\t\t\t\t$continueSearch = false;\n\t\t\t}\n\n\t\t\tif ( $nr > 1 ) {\n\t\t\t\t// skip until we reach the n-th section\n\t\t\t\t$nr--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $m[0][0] ) ) {\n\t\t\t\t$sectionHeading[$n] = $headLine;\n\t\t\t\t// $sectionHeading[$n] = preg_replace( \"/^=+\\s*/\", '', $m[0][0] );\n\t\t\t\t// $sectionHeading[$n] = preg_replace( \"/\\s*=+\\s*$/\", '', $sectionHeading[$n] );\n\t\t\t} else {\n\t\t\t\t// $sectionHeading[$n] = '';\n\t\t\t\t$sectionHeading[0] = $headLine;\n\t\t\t}\n\n\t\t\tif ( $nr == 1 ) {\n\t\t\t\t// output n-th section and done\n\t\t\t\t$output[0] = self::parse( $parser, $title, $piece,\n\t\t\t\t\t\"#lsth:${page}|${sec}\", $nhead, $recursionCheck,\n\t\t\t\t\t$maxLength, $link, $trim, $skipPattern\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( $nr == - 1 ) {\n\t\t\t\tif ( !isset( $end_off ) ) {\n\t\t\t\t\t// output last section and done\n\t\t\t\t\t$output[0] = self::parse( $parser, $title, $piece,\n\t\t\t\t\t\t\"#lsth:${page}|${sec}\", $nhead, $recursionCheck,\n\t\t\t\t\t\t$maxLength, $link, $trim, $skipPattern\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// output section by name and continue search for another section with the same name\n\t\t\t\t$output[$n++] = self::parse( $parser, $title, $piece,\n\t\t\t\t\t\"#lsth:${page}|${sec}\", $nhead, $recursionCheck,\n\t\t\t\t\t$maxLength, $link, $trim, $skipPattern\n\t\t\t\t);\n\t\t\t}\n\t\t} while ( $continueSearch );\n\n\t\treturn $output;\n\t}", "public function ParseHTML()\r\n {\r\n\r\n\t\t\t$this->Display[\"title\"] = $this->Label;\t\t\t\r\n\t\t\t$this->Display[\"links\"] = $this->ShowNextPrev;\r\n\t\t\t$this->Display[\"total\"] = $this->Total;\r\n\t\t\t\r\n $totalpages = ($this->ItemsOnPage > 0) ? ceil($this->Total / $this->ItemsOnPage) : 0;\r\n\t\t\t\r\n\t\t\tif ($this->PageNo > $totalpages) \r\n\t\t\t\t$this->PageNo = $totalpages;\r\n\r\n $firstpage = $this->PageNo >= 10 ? $this->PageNo - 5 : 1;\r\n $lastpage = $firstpage + 9;\r\n\r\n $lastpage = $lastpage > $totalpages ? $totalpages : $lastpage;\r\n\t\t\t\r\n\t\t\t// Generate URL\r\n\t\t\t$url = $this->URLFormat . $this->GetQueryString();\r\n\t\t\t\r\n\t\t\tif ($this->ShowNextPrev)\r\n\t\t\t{\r\n\t\t\t\tif ($this->PageNo > 1)\r\n\t\t\t\t\t$this->Display[\"prevlink\"] = $this->URL.sprintf($url, $this->PageNo - 1, $this->Total);\r\n\t\t\t\tif ($this->PageNo < $lastpage)\r\n\t\t\t\t\t$this->Display[\"nextlink\"] = $this->URL.sprintf($url, $this->PageNo + 1, $this->Total);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($firstpage > 1)\r\n\t\t\t\t$this->Display[\"firstpage\"] = array(\"link\" => $this->URL.sprintf($url, 1, $this->Total), \"num\" => \"1\");\r\n\t\t\t\r\n for ($n = $firstpage; $n <= $lastpage; $n++)\r\n {\r\n\t\t\t\t$selected = ($this->PageNo == $n);\r\n $this->Display[\"pages\"][] = array(\"num\" => $n, \"selected\"=>$selected, \"link\" => $this->URL.sprintf(urldecode($url), $n, $this->Total));\r\n }\r\n\r\n if ($lastpage < $totalpages)\r\n\t\t\t\t$this->Display[\"lastpage\"] = array(\"link\" => $this->URL.sprintf($url, $totalpages, $this->Total), \"num\" => $totalpages);\r\n\r\n }", "function CreateInternalLinks($html)\r\n{\r\n//! @return string\r\n\r\n\t$regexp = '/href=[\"]?#([^\\\\s>\"]+)/si';\r\n\tpreg_match_all( $regexp, $html, $aux);\r\n foreach($aux[1] as $val=>$key) $this->internallink['#' . $key] = true;\r\n //Fix name=something to name=\"something\"\r\n\t$regexp = '/ name=([^\\\\s>\"]+)/si';\r\n\t$html = preg_replace($regexp,' name=' . \"\\\"\\$1\\\"\",$html);\r\n\r\n return $html;\r\n}", "function smarty_outputfilter_admintitle($source, $view)\n{\n // get all the matching H1 tags\n $regex = \"/<h1>[^<]*<\\/h1>/\";\n preg_match_all($regex, $source, $h1);\n $regex = \"/<h2>[^<]*<\\/h2>/\";\n preg_match_all($regex, $source, $h2);\n $regex = \"/<h3>[^<]*<\\/h3>/\";\n preg_match_all($regex, $source, $h3);\n\n // init vars\n $titleargs = array();\n $header1 = $header2 = $header3 = '';\n\n // set the title\n // header level 1\n if (isset($h1[0]) && isset($h1[0][1])) {\n $header1 = $h1[0][1];\n }\n if (isset($header1) && !empty($header1)) {\n $titleargs[] = $header1;\n }\n // header level 2\n if (isset($h2[0][0])) {\n $header2 = $h2[0][0];\n }\n if (isset($header2) && !empty($header2)) {\n $titleargs[] = $header2;\n }\n // header level 3\n if (isset($h3[0]) && isset($h3[0][1])) {\n $header3 = $h3[0][1];\n }\n if (isset($header3) && !empty($header3)) {\n $titleargs[] = $header3;\n }\n\n if (!empty($titleargs)) {\n PageUtil::setVar('title', System::getVar('sitename') . ' - ' . strip_tags(implode(' / ', $titleargs)));\n }\n\n // return the modified source\n return $source;\n}", "function getURLs($html, $base_url)\r\n{\r\n\tpreg_match_all('~<a\\s+.*?</a>~is',$html,$anchors);\r\n\t$urls = array();\r\n\t$parse = parse_url($base_url);\r\n\r\n\t//if no URL found on page, return blank array\r\n\tif(empty($anchors[0]))\r\n\t\treturn $urls;\r\n\r\n\t//clean up each URLs\r\n\tforeach ($anchors[0] as $key => $link) {\r\n\t\t//get the HREF from the URL\r\n\t\tpreg_match_all('/<a[^>]+href=([\\'\"])(?<href>.+?)\\1[^>]*>/i', $link, $result);\r\n\r\n\t\tif(empty($result['href'][0]))\r\n\t\t\tcontinue;\r\n\r\n\t\t$url = $result['href'][0];\r\n\t\t$url = rel2abs($url, $base_url);\r\n\r\n\t\tif( clean_url($url, $parse['host']) )\r\n\t\t{\r\n\t\t\t$hash = generate_hash( $url );\r\n\t\t\t$urls[$hash]['url'] = $url;\r\n\t\t\t$urls[$hash]['title'] = '';\r\n\t\t\t$urls[$hash]['data'] = '';\r\n\r\n\t\t\t//get the TITLE from the URL\r\n\t\t\tpreg_match_all('/<a[^>]+title=([\\'\"])(?<title>.+?)\\1[^>]*>/i', $link, $title);\r\n\r\n\t\t\tif( !empty($title['title'][0]) )\r\n\t\t\t{\r\n\t\t\t\t$urls[$hash]['title'] = $title['title'][0];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $urls;\r\n}", "public function __construct($records, $headings){\n\t\t\t$i = -1;\n\t\t\tif(empty($_GET)){\n\t\t\t\tforeach($records as $record){\n\t\t\t\t\t$i++;\n\t\t\t\t\t// call the html class\n\t\t\t\t\t\\classes\\Html\\html::makeLink('record',$i, $record['INSTNM']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function addHeadings(DomNodeList $nodes)\n {\n foreach ($nodes as $node) {\n $this->addHeading($node);\n }\n }", "function minorite_links($variables) {\n $links = $variables['links'];\n $attributes = $variables['attributes'];\n $heading = $variables['heading'];\n global $language_url;\n $output = '';\n\n if (count($links) > 0) {\n $output = '';\n\n // Treat the heading first if it is present to prepend it to the\n // list of links.\n if (!empty($heading)) {\n if (is_string($heading)) {\n // Prepare the array that will be used when the passed heading\n // is a string.\n $heading = array(\n 'text' => $heading,\n // Set the default level of the heading.\n 'level' => 'h2',\n );\n }\n $output .= '<' . $heading['level'];\n if (!empty($heading['class'])) {\n $output .= drupal_attributes(array('class' => $heading['class']));\n }\n $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>';\n }\n\n $output .= '<ul' . drupal_attributes($attributes) . '>';\n\n $num_links = count($links);\n $i = 1;\n\n foreach ($links as $key => $link) {\n $class = array($key);\n\n if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))\n && (empty($link['language']) || $link['language']->language == $language_url->language)) {\n $class[] = 'nav-selected';\n }\n $output .= '<li' . drupal_attributes(array('class' => $class)) . '>';\n\n if (isset($link['href'])) {\n // Pass in $link as $options, they share the same keys.\n $output .= l($link['title'], $link['href'], $link);\n }\n elseif (!empty($link['title'])) {\n // Some links are actually not links, but we wrap these in <span> for adding title and class attributes.\n if (empty($link['html'])) {\n $link['title'] = check_plain($link['title']);\n }\n $span_attributes = '';\n if (isset($link['attributes'])) {\n $span_attributes = drupal_attributes($link['attributes']);\n }\n $output .= '<span' . $span_attributes . '>' . $link['title'] . '</span>';\n }\n\n $i++;\n $output .= \"</li>\\n\";\n }\n\n $output .= '</ul>';\n }\n\n return $output;\n}", "function get_sanitized_heading($text) {\n\n $tags = [\n '<a>', '<b>', '<i>', '<u>', '<strong>', '<em>', '<sup>', '<sub>'\n ];\n\n $text = strip_tags($text,implode('',$tags));\n\n $raw = preg_split('#(<[^>]+>)#ismu',$text);\n\n foreach($raw as $replace) {\n $text = str_replace($replace,esc_html($replace),$text);\n }\n\n return nl2br($text);\n}", "function ind_hrefparser($text) {\n\t$answer = false;\n\t$regexp = \"<a\\s[^>]*href=(\\\"??)([^\\\" >]*?)\\\\1[^>]*>(.*)<\\/a>\";\n\tif(preg_match_all(\"/$regexp/siU\", $text, $matches)) {\n\t\t$answer['url'] = $matches[2][0];\n\t\t$answer['chapter'] = $matches[3][0];\n\t}\n\treturn $answer;\n}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "public function generateAnchorName($heading)\n\t{\n\t\t// Remove HTML tags\n\t\t$heading = preg_replace('/<(.*?)>/', '', $heading);\n\n\t\t// Remove parentheses\n\t\t$heading = preg_replace('/\\(.*?\\)/', '', $heading);\n\n\t\t// Remove inner-word punctuation\n\t\t$heading = preg_replace('/[\\'\"‘’“”]/', '', $heading);\n\n\t\t// Get the \"words\". This will search for any unicode \"letters\" or \"numbers\"\n\t\tpreg_match_all('/[\\p{L}\\p{N}]+/u', $heading, $words);\n\t\t$words = ArrayHelper::filterEmptyStringsFromArray($words[0]);\n\n\t\t// Turn them into camelCase\n\t\tforeach ($words as $i => $word)\n\t\t{\n\t\t\t// Special case if the whole word is capitalized\n\t\t\tif (strtoupper($word) == $word)\n\t\t\t{\n\t\t\t\t$words[$i] = strtolower($word);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$words[$i] = lcfirst($word);\n\t\t\t}\n\t\t}\n\n\t\t// Put them together as the anchor name\n\t\treturn implode('-', $words);\n\t}", "function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}", "public function parse($html);", "public function parse($html);", "public function sidebar_headings( $html, $template, $file, $slug, $name ) {\n\t\tif ( $slug && false !== strpos( $slug, 'modules/meta/' ) ) {\n\t\t\treturn str_replace( [ '<h2', '</h2>' ], [ '<h4', '</h4>' ], $html );\n\t\t}\n\t\treturn $html;\n\t}", "function anchor($title, $link, $tabs = 0, $nl = true)\n{\n start_anchor($link, $tabs, false) ;\n echo $title ;\n close_anchor($tabs = 0, $nl) ;\n}", "public function parseHtml($html)\n {\n // So as a quick fix, we'll str_replace those ahead of time\n // and then keep the Xpath parser consistent.\n $html = str_replace(\n [\n '<td>Vendor:</td>',\n '<td>Reference Number:</td>',\n '<td>Contract Date:</td>',\n '<td>Description of Work:</td>',\n '<td>Contract Period :</td>',\n '<td>Contract Period:</td>',\n '<td>Delivery Date:</td>',\n '<td>Contract Value:</td>',\n '<td>Comments:</td>',\n // Fixes for eg.\n // https://www.statcan.gc.ca/eng/about/contract/2004/62700-04-0035\n '<th class=\"row-stub\" scope=\"row\">Nom du vendeur:</th>',\n '<th class=\"row-stub\" scope=\"row\">Numéro de référence :</th>',\n '<th class=\"row-stub\" scope=\"row\">Description&nbsp;of&nbsp;Work:</th>',\n ],\n [\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Contract Date:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Delivery Date:</th>',\n '<th scope=\"row\">Contract Value:</th>',\n '<th scope=\"row\">Comments:</th>',\n // Replacements per above\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n\n ],\n $html\n );\n\n $keyArray = [\n 'vendorName' => 'Vendor',\n 'referenceNumber' => 'Reference Number',\n 'contractDate' => 'Contract Date',\n 'description' => 'Description of work',\n 'extraDescription' => 'Detailed Description',\n 'contractPeriodStart' => '',\n 'contractPeriodEnd' => '',\n 'contractPeriodRange' => 'Contract Period',\n 'deliveryDate' => 'Delivery Date',\n 'originalValue' => 'Original Contract Value',\n 'contractValue' => 'Contract Value',\n 'comments' => 'Comments',\n ];\n\n return Parsers::extractContractDataViaGenericXpathParser($html, \"//table//th[@scope='row']\", \"//table//td\", ' to ', $keyArray);\n }", "protected function addLinks()\n {\n }", "protected function callback_numbered_heading_as_html ($matches) {\n\t\t$heading = preg_replace(\"|%%(\\d+)%%|\", '', $matches[2]);\n\n\t\t$this->headings[strlen($matches[1])]++;\n\t\t\n\t\t$numbering = '';\n\n\t\t$numbering = $headings[2];\n\n\t\tforeach($this->headings as $headingLevel => $count) {\n\t\t\tif($headingLevel > strlen($matches[1])) {\n\t\t\t\t$this->headings[$headingLevel] = 0;\n\t\t\t} elseif($headingLevel <= strlen($matches[1]) && $headingLevel > 2) {\n\t\t\t\t$numbering = $numbering . '.' . $count;\n\t\t\t}\n }\n\t\t\t\n\t\t$numbering .= ' ';\n\n\t $result = str_repeat ('+', (strlen($matches[1]) - 1)).' '.$numbering.$heading.\"\\n\";\n\n\t return $result;\n\t}", "function setHeading($h)\n\t{\n\t\t$this->_headingText=$h;\n\t}", "function addHeading(& $heading, & $parentElement) {\n\t\t$headingElement =& $this->_document->createElement('heading');\n\t\t$parentElement->appendChild($headingElement);\n\t\t\n\t\t$this->addCommonProporties($heading, $headingElement);\n\t\t\n\t\tif ($heading->getField('location') == 'right')\n\t\t\t$headingElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$headingElement->setAttribute('location', 'left');\n\t}", "function _headerToLink($title, $create = false) {\n if($create) {\n return sectionID($title, $this->headers);\n } else {\n $check = false;\n return sectionID($title, $check);\n }\n }", "private function parseLinks($str) {\n\n //parse URL\n $str = preg_replace('/(https{0,1}:\\/\\/[\\w\\-\\.\\/#?&=]*)/','<a href=\"$1\">$1</a>',$str);\n //parse @ID\n $str = preg_replace('/@(\\w+)/','@<a href=\"http://twitter.com/$1\" class=\"at\">$1</a>',$str);\n //parse #hashtag\n $str = preg_replace('/\\s#(\\w+)/',' <a href=\"http://twitter.com/#!/search?q=%23$1\" class=\"hashtag\">#$1</a>',$str);\n\n return $str; \n }", "function remove_h1_from_heading($args) {\n$args['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Pre=pre';\nreturn $args;\n}", "function get_link_rel($file){\r\n $h1tags = preg_match_all('/(rel=)(\".*\") href=(\".*\")/im',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "function H($num = 1, $title = '', $pref = 0, $extra = '')\n{\n /**\n * H tag - this is an HTML Document Header line.\n *\n * Args:\n * $num (int): the header number (1-6) default is 1\n * $title (str): the text in the header line\n * $pref (int): number of tabs for indentation, default is 0\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n Tab($pref) ;\n echo '<h' . $num ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' . $title ;\n close_tag('h' . $num, '', true) ;\n}", "protected function callback_heading_as_html ($matches) {\n\t\t$heading = preg_replace(\"|%%(\\d+)%%|\", '', $matches[2]);\n\n $result = str_repeat ('+', (strlen($matches[1]) - 1)).' '.$heading.\"\\n\";\n\n return $result;\n }", "public function extractLinks($html, $url) {\n\t\t$links = array();\n\t\t$url_info = parse_url($url);\n\t\t\n\t\tpreg_match_all(\"/<a[\\s]+[^>]*?href[\\s]?=[\\s\\\"\\']+(.*?)[\\\"\\']+.*?>/\", $html, $matches);\n\t\t\n\t\tif(empty($url_info['path'])) $url_info['path'] = '/';\n\t\t\n\t\t// If there is a file at the end of the URL, then get it\n\t\tif($url_info['path']{strlen($url_info['path']) - 1} != '/') {\n\t\t\t$url_info['path'] = substr( $url_info['path'], 0, strrpos($url_info['path'], '/') + 1);\n\t\t}\n\t\t\n\t\tif(substr($url_info['host'], 0, 4) == 'www.') $host = substr($url_info['host'], 4) . '/';\n\t\telse $host = $url_info['host'];\n\t\t\n\t\tfor($i = 0; isset($matches[1][$i]); $i++) {\n\t\t\tif($matches[1][$i]{0} != '#' && !strpos($matches[1][$i], '@')) { // stop #top sort of links and remove emails\n\t\t\t\tif(strpos($matches[1][$i], '#')) $matches[1][$i] = substr($matches[1][$i], 0, strpos($matches[1][$i], '#'));\n\t\n\t\t\t\tif($matches[1][$i]{0} == '/') { // add host to any links\n\t\t\t\t\t$links[] = $url_info['scheme'] . '://' . $url_info['host'] . $matches[1][$i];\n\t\t\t\t} elseif($matches[1][$i]{0} == '.') {\n\t\t\t\t\t$done = true;\n\t\t\t\t\t$url = $matches[1][$i];\n\t\t\t\t\t$cur_dir = explode('/', $url_info['path']);\n\t\t\t\t\tarray_shift($cur_dir);\n\t\t\t\t\tarray_pop($cur_dir);\n\t\t\t\t\t\n\t\t\t\t\tfor($j = 0; isset($cur_dir[$j]); $j++) $cur_dir[$j] = '/' . $cur_dir[$j];\n\t\t\t\t\t\n\t\t\t\t\twhile($done) {\n\t\t\t\t\t\t// if no more ./ or ../ then it's done\n\t\t\t\t\t\tif($url{0} != '.') {\n\t\t\t\t\t\t\t$links[] = $url_info['scheme'] . '://' . $url_info['host'] . implode('', $cur_dir) . '/' . $url;\n\t\t\t\t\t\t\t$done = false;\n\t\t\t\t\t\t} elseif(substr($url, 0, 2 ) == './') { // remove same dir as that is the default\n\t\t\t\t\t\t\t$url = substr($url, 2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$url = substr($url, 3);\n\t\t\t\t\t\t\tarray_pop($cur_dir);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif(substr($matches[1][$i] , 0, 7) != 'http://' && substr($matches[1][$i], 0, 8) != 'https://') { // do any links left without root\n\t\t\t\t\t/*\n\t\t\t\t\tWe can't use $url_info['host'].$url_info['path'] since it breaks in the following situations:\n\t\t\t\t\t1. in a page (http://localhost/mysite/page1) link as '<a href=\"page2\">Page2</a>', the rendered link becomes http://localhost/mysite/page1/page2.\n\t\t\t\t\t2. in a page (http://www.mysite.com/page1) link as '<a href=\"page2\">Page2</a>', the rendered link becomes http://www.mysite.com/page1/page2.\n\t\t\t\t\t3. in a page (http://mysite.localhost/page1) link as '<a href=\"page2\">Page2</a>', the rendered link becomes http://mysite.localhost/page1/page2.\n\t\t\t\t\ti.e. it is always rendered as a nested url if the current page is not \"/\", which causes a false alerm in normal case (NestedURL module is not used)\t\t\t\t\n\t\t\t\t\t$links[] = $url_info['scheme'] . '://' . $url_info['host'] . $url_info['path'] . $matches[1][$i];\n\t\t\t\t\t*/\n\t\t\t\t\t$links[] = Director::absoluteBaseURL() . $matches[1][$i];\n\t\t\t\t} else {\n\t\t\t\t\t$links[] = $matches[1][$i];\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $links;\n\t}", "function heading( $data = '', $h = '1', $attributes = '' )\n\t{\n\t\treturn '<h' . $h . _stringify_attributes( $attributes ) . '>' . $data . '</h' . $h . '>';\n\t}", "public function parseHTTPLinkHeaders($linkHeader)\n {\n $links = explode(',', $linkHeader);\n $linkarray = [];\n foreach ($links as $linkstring) {\n list($linktarget, $linkrel) = explode(';', $linkstring);\n $linkrel = substr(trim($linkrel), strlen('rel=\"'), -1);\n $linktarget = trim($linktarget, '<> ');\n $linkarray[$linkrel] = $linktarget;\n }\n return $linkarray;\n }", "function quail_server_parse_links($address, $html, $options = array()) {\n\t$links = array();\n\t$dom = new DOMDocument();\n\t$result = @$dom->loadHTML($html);\n\tif(!$result) {\n\t\treturn $links;\n\t}\n\tforeach($dom->getElementsByTagName('a') as $a) {\n\t\tif($a->hasAttribute('href')) {\n\t\t\tif(substr($a->getAttribute('href'), 0, 1) != '#' && parse_url($a->getAttribute('href'))) {\n\t\t\t\t//We ignore anchor links to the same page\n\t\t\t\t$links[$a->getAttribute('href')] = $a->getAttribute('href');\n\t\t\t}\n\t\t}\n\t}\n\tforeach($dom->getElementsByTagName('frame') as $frame) {\n\t\tif($frame->hasAttribute('src')) {\n\t\t\t//We ignore anchor links to the same page\n\t\t\t$links[$frame->getAttribute('src')] = $frame->getAttribute('src');\n\t\t}\n\t}\n\tforeach($links as $k => $link) {\n\t\t$start = parse_url($options['start_uri']);\n\t\tif(!$options['span_hosts']) {\n\t\t\t$link_url = parse_url($link);\n\t\t\tif($link_url['host'] && $link_url['host'] != $start['host']) {\n\t\t\t\tunset($links[$k]);\n\t\t\t}\n\t\t\telseif(!isset($link_url['host']) && $link_url['path']) {\n\t\t\t\t$links[$k] = quail_server_build_absolute($address, $link);\n\t\t\t} \n\t\t}\n\t}\n\treturn $links;\n}", "function setHeadings($headings){\n\t\t\tglobal $tableHeadings;\n\t\t\t\n\t\t\t$tableHeadings = $headings;\n\t\t\t\n\t\t}", "function setHeadings($headings){\n\t\t\tglobal $tableHeadings;\n\t\t\t\n\t\t\t$tableHeadings = $headings;\n\t\t\t\n\t\t}", "public function breadcrumbs($h)\n {\n if ($h->pageName == 'edit_post') {\n $post_link = \"<a href='\" . $h->url(array('page'=>$h->post->id)) . \"'>\";\n $post_link .= $h->post->title . \"</a>\";\n $h->pageTitle = $h->pageTitle . \" / \" . $post_link;\n }\n }", "function get_h1($file){\r\n $h1tags = preg_match_all(\"/(<h1.*>)(\\w.*)(<\\/h1>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function process($html);", "public function getLinks(){\n\t\t\n\t\t// Get the global config\n\t\tglobal $CrawlerConfig;\n\t\t\n\t\t// Create DOM object and load HTML\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Get links\n\t\t$links = $dom->getElementsByTagName('a');\n\t\t\n\t\t// Extract links data\n\t\tforeach ($links as $tag){\n\t\t\t\n\t\t\t// Get the hyperlink reference\n\t\t\t$url = trim($tag->getAttribute('href'));\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$url = self::filterUrl($url);\n\t\t\tif($url === false) continue;\n\t\t\t\n\t\t\t// Skip URL's that start with #\n\t\t\tif(substr($url, \"0\", 1) == \"#\") continue;\n\t\t\t\n\t\t\t// Skip mailto links\n\t\t\tif(strpos($url, \"mailto:\") !== false) continue;\n\t\t\t\n\t\t\t// Skip links that don't match the 'FOLLOW_LINKS_LIKE' config param\n\t\t\tif(\n\t\t\t\t!empty($CrawlerConfig['FOLLOW_LINKS_LIKE']) &&\n\t\t\t\tstrpos($url, $CrawlerConfig['FOLLOW_LINKS_LIKE']) === false\n\t\t\t) continue;\n\t\t\t\n\t\t\t// Skip links that DO match the \"IGNORE_LINKS_LIKE\" config param\n\t\t\tif(!empty($CrawlerConfig['IGNORE_LINKS_LIKE'])){\n\t\t\t\tforeach($CrawlerConfig['IGNORE_LINKS_LIKE'] as $l){\n\t\t\t\t\tif(strpos($url, $l) !== false) continue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dump it to the array\n\t\t\tarray_push($ret, array(\n\t\t\t\t\"url\" => $url,\n\t\t\t\t\"title\" => $tag->textContent ///$tag->childNodes->item(0)->nodeValue\n\t\t\t));\t\t\t\n }\n\t\t\n\t\t$ret = self::doopScooper($ret, array(\"url\"));\n\t\t\t\t\n\t\treturn $ret;\n\t}", "function DOM_primalize_anchors() {\r\n\t\t$blockString = DTD::getBlock() . \"|tr|th|td|li\";\r\n\t\t$blockString2 = \"|\" . $blockString;\r\n\t\t$blockString2 = str_replace('|', '|//' . ReTidy::get_html_namespace(), $blockString2);\r\n\t\t$blockString2 = substr($blockString2, 1);\r\n\t\t$query = $blockString2;\r\n\t\t$blocks = $this->xpath->query($query);\r\n\t\tforeach($blocks as $block) {\r\n\t\t\t$firstChild = $block->firstChild;\r\n\t\t\t$as = $this->xpath->query(ReTidy::get_html_namespace() . 'a[@name]', $block);\r\n\t\t\tif(sizeof($as) > 0) {\r\n\t\t\t\tforeach($as as $a) {\r\n\t\t\t\t\t// ignore footnotes\r\n\t\t\t\t\t$name_attribute = ReTidy::getAttribute($a, \"name\");\r\n\t\t\t\t\tif(strpos($name_attribute->nodeValue, \"note\") !== false || strpos($name_attribute->nodeValue, \"_ftnref\") !== false) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($a != $firstChild) {\r\n\t\t\t\t\t\t$new_node = $a->cloneNode(true);\r\n\t\t\t\t\t\t$a->setAttribute(\"stripme\", \"y\");\r\n\t\t\t\t\t\tReTidy::DOM_strip_node($a);\r\n\t\t\t\t\t\t$block->insertBefore($new_node, $firstChild);\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 function getHeadingText(string $markdown, string $heading = '#') : string\n {\n // Try to find a heading 1 and if so use that text for the title tag of the generated page\n $matches = array();\n $title = '';\n\n try {\n preg_match(\"/\".$heading.\" ?(.*)/\", $markdown, $matches);\n $title = (count($matches) > 0) ? trim($matches[1]) : '';\n\n // Be sure that the heading 1 wasn't type like # MyHeadingOne # i.e. with a final #\n\n $title = ltrim(rtrim($title, $heading), $heading);\n } catch (Exception $e) {\n }\n\n return $title;\n }", "function parseLinkAttrs($html)\n {\n $stripped = preg_replace($this->_removed_re,\n \"\",\n $html);\n\n $html_begin = $this->htmlBegin($stripped);\n $html_end = $this->htmlEnd($stripped);\n\n if ($html_begin === false) {\n return [];\n }\n\n if ($html_end === false) {\n $html_end = strlen($stripped);\n }\n\n $stripped = substr($stripped, $html_begin,\n $html_end - $html_begin);\n\n // Workaround to prevent PREG_BACKTRACK_LIMIT_ERROR:\n $old_btlimit = ini_set( 'pcre.backtrack_limit', -1 );\n\n // Try to find the <HEAD> tag.\n $head_re = $this->headFind();\n $head_match = [];\n if (!$this->match($head_re, $stripped, $head_match)) {\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return [];\n }\n\n $link_data = [];\n $link_matches = [];\n\n if (!preg_match_all($this->_link_find, $head_match[0],\n $link_matches)) {\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return [];\n }\n\n foreach ($link_matches[0] as $link) {\n $attr_matches = [];\n preg_match_all($this->_attr_find, $link, $attr_matches);\n $link_attrs = [];\n foreach ($attr_matches[0] as $index => $full_match) {\n $name = $attr_matches[1][$index];\n $value = $this->replaceEntities(\n $this->removeQuotes($attr_matches[2][$index]));\n\n $link_attrs[strtolower($name)] = $value;\n }\n $link_data[] = $link_attrs;\n }\n\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return $link_data;\n }", "function setHead($tagName,$attributes,$inner = '',$index = ''){\r\n\t\t$this->head($index,$tagName,$attributes,$inner);\r\n\t}", "function parse_headers($str)\n\t{\n\t\t$str = \"\\n\\n\".str_replace(\"\\r\", '', $str).\"\\n\\n\";\n\t\t// convert markups\n\t\t$marks = array('=', '-', '#');\n\t\tforeach($marks as $i => $m) {\n\t\t\t$i++;\n\t\t\t$str = preg_replace_callback(\n\t\t\t\tarray(\n\t\t\t\t\t// multi-lines\n\t\t\t\t\t\"`(?:(?:\\n\\n)?$m{3,}\\n?|\\n\\n)[ \\t]*((?:.+?\\n)+.*?)[ \\t]*$m{4,}[ \\t]*\\n`\",\n\t\t\t\t\t// one line\n\t\t\t\t\t\"`\\n[ \\t]*$m{3,}[ \\t]*([^\\n]+?)[ \\t]*$m*[ \\t]*\\n`\"),\n\t\t\t\tcreate_function(\n\t\t\t\t\t'$out', 'return \\'<h'.$i.'>\\'.trim($out[1]).\\'</h'.$i.'>\\';'),\n\t\t\t\t$str);\n\t\t}\n\t\t// create structure\n\t\tfor($i=1; $i<=6; $i++) {\n\t\t\t$pattern = \"`(<\\s*h$i.*>(.*)</\\s*h$i>.*)(?=</div><div class=.h[1-$i]|<h[1-$i]|$)`siU\";\n\t\t\t$function = create_function('$out',\n\t\t\t\t'return \\'<div class=\"h'.$i.'\" id=\"\\'.string_to_id($out[2]).\\'\">\\'.$out[1].\\'</div>\\';');\n\t\t\t$tmp = preg_replace_callback($pattern, $function, $str);\n\t\t\tif($tmp !== null) $str = $tmp;\n\t\t}\n\t\treturn $str;\n\t}", "function SampleHomePageHTML($teamName)\n{\n $hp = \"<h1>$teamName</h1>\\n\" .\n \"<p>\\n\" .\n \" Welcome to your team site. This is one possible layout for your home page. Just replace our sample\\n\" .\n \" content with your text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris et mauris lectus.\\n\" .\n \" Ut gravida, felis in commodo consectetur, quam augue tincidunt nulla, nec pellentesque orci ligula non\\n\" .\n \" lacus. Quisque non odio rutrum ligula auctor facilisis.\\n\" .\n \"</p>\\n\" .\n \"<h2>Riding for the Future</h2>\\n\" .\n \" <div style=\\\"float:left;margin: 3px 10px 0px 0px\\\">\\n\" .\n \" <img src=\\\"/images/hosted/SharingTheRoad.jpg\\\"><br>\\n\" .\n \" <p class=photo-caption>Enough Room for Everyone</p>\\n\" .\n \" </div>\\n\" .\n \"<p>\\n\" .\n \" Aliquam erat volutpat. Nunc at risus ut sapien auctor laoreet. Aliquam ac eros augue. Fusce posuere nisl\\n\" .\n \" vitae turpis aliquam pharetra luctus lectus auctor. Phasellus euismod rhoncus lacus, quis suscipit velit\\n\" .\n \" eleifend id. Nam tincidunt scelerisque libero. Maecenas mi eros, porttitor at commodo eu, tincidunt et\\n\" .\n \" massa. Sed nec tellus eu dolor gravida consequat. Integer ante sapien, elementum in auctor a, condimentum\\n\" .\n \" id elit. Integer at rutrum orci. Nullam lobortis tempus nisi, id ultrices nulla porttitor sed. Nunc sit\\n\" .\n \" eleifend id. Nam tincidunt scelerisque libero. Maecenas mi eros, porttitor at commodo eu, tincidunt et\\n\" .\n \" amet commodo nibh. Maecenas tincidunt quam quis arcu iaculis vel laoreet libero fringilla. iaculis vel\\n\" .\n \" vitae turpis aliquam pharetra luctus lectus auctor. Phasellus euismod rhoncus lacus, quis suscipit velit\\n\" .\n \" laoreet libero fringilla.\" .\n \"<br class='clearfloat'>\\n\" .\n \"</p>\\n\" .\n \"<h2>Roots in the Past</h2>\\n\" .\n \"<p>\\n\" .\n \" Mauris eget turpis ac tortor dignissim suscipit. Duis quis mi id ante blandit elementum. Nullam turpis tortor,\\n\" .\n \" rhoncus vehicula consequat at, molestie nec felis. Pellentesque sit amet sem sit amet tellus venenatis pulvinar.\\n\" .\n \" Sed aliquam semper eros, vel condimentum neque egestas nec. Nam vel sagittis diam. Phasellus aliquam, lacus sit\\n\" .\n \" amet porta vulputate, neque est bibendum lectus, at varius tortor velit sed nisi. Praesent ultrices luctus ornare.\\n\" .\n \" Sed tortor mauris, placerat quis gravida nec, bibendum quis nulla. Fusce purus massa, malesuada eu hendrerit\\n\".\n \" ultrices, rhoncus eu leo. Pellentesque ac metus in tellus auctor porta. Suspendisse potenti. Sed at arcu vel erat\\n\" .\n \" eleifend ultricies quis nec mi.\\n\" .\n \"</p>\\n\";\n return($hp);\n}", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function parseLinksOld($text)\n{\n\t// ADD LINE BREAKS\n\t$text = nl2br($text);\n\t\n\t/*\n\tthe counting method doesn't work - if there is, for example, a case with 1 instance of plain www and 3 instances of https://www,\n\tthen the count is < 0 and the www will not get replaced\n\t*/\n\t// COUNT THE NUMBER OF OCCURRENCES OF \"WWW\" WITHOUT A PRECEEDING \"HTTP\"\n\t$numWWW \t= substr_count ( $text, 'www.' );\n\t$numHTTPWWW = substr_count ( $text, '://www.' );\n\t$numHTTPSWWW = substr_count($text, 'https://www');\n\t$w = $numWWW - $numHTTPWWW - $numHTTPSWWW;\n\n\t// REPLACE ALL INSTANCES OF \"WWW\" WITH \"HTTP://WWW\" SO THAT PARSING FUNCTION WILL HANDLE ALL CASES\n\tif ($w > 0) { $text = str_replace ( 'www', 'http://www', $text, $w ); }\n\t\n\t// BEGIN PARSING\n\t$needle = 'http';\n\t$needleLength = strlen($needle);\n\t$needleCount = substr_count ( $text, $needle );\n\t\n\t// DECLARE ARRAYS FOR THE LINKS\n\t$needles = array();\n\t$tags = array();\n\t$hyperlinks = array();\n\n\t// LOOP THROUGH ALL LINKS AND PARSE THEM\n\tfor ( $i = 0; $i < $needleCount; $i++ )\n\t{\n\t\t// DETERMINE START POS OF LINK\n\t\t$needleStart = strpos($text, $needle, $needleStart + $needleLength );\n\n\t\t// DETERMINE ENDPOINT OF LINK - EITHER A SPACE OR LINE BREAK\n\t\t$distSpace \t= abs(stripos($text, ' ', $needleStart) - $needleStart); \n\t\t$distNL \t= abs(stripos($text, \"\\n\", $needleStart) - $needleStart); \n\t\t$distBR\t\t= abs(stripos($text, '<br>', $needleStart) - $needleStart);\n\t\tif ($distSpace <= $distNL) { $needleLength = $distSpace; } else { $needleLength = $distNL; } $needleLength += 0;\n\n\t\t// PARSE OUT THE LINK FROM BETWEEN THE START POS AND ENDPOINT\n\t\t$needleParsed = substr($text, $needleStart, $needleLength);\n\t\t$needleUntrimmed = $needleParsed;\n\n\t\t// TRIM EXTRA CHARACTERS ( periods or parentheses or <br> tags from end of string )\n\t\t$needleTrim1 = substr($needleParsed, 0, strlen($needleParsed)-1);\n\t\t$needleTrim2 = substr($needleParsed, 0, strlen($needleParsed)-2);\n\n\t\t$lastChar \t\t= substr($needleParsed, -1);\n\t\t$secondLastChar = substr($needleParsed, -2, 1);\n\n\t\tif ($lastChar == '.' or $lastChar == ',' or $lastChar == ')') \t\t\t\t\t\t{ $needleParsed = $needleTrim1; }\n\t\tif ($secondLastChar == '.' or $secondLastChar == ',' or $secondLastChar == ')') \t{ $needleParsed = $needleTrim2; }\n\n\t\t$needleTrimBR \t= substr($needleParsed, 0, strlen($needleParsed)-3);\n\t\tif ( substr_count ( $needleParsed, '<br') > 0 )\t\t\t\t\t\t\t\t\t\t{ $needleParsed = $needleTrimBR; }\n\n\t\t// THE LINK SHOULD NOW BE PROPERLY PARSED\t\n\n\t\t// CONSTRUCT THE <a> TAG\n\t\t$needleTag = '<a href = \"'.$needleParsed.'\" target = \"_blank\">'.$needleParsed.'</a>'; \n\t\t// COULD EVENTUALLY DEFINE A VALUE FOR HREF AND DISPLAY TEXT SEPARATELY?\n\n\t\t// UPDATE THE LINK ARRAYS\n\t\t$needles[$i] = $needleParsed;\n\t\t$tags[$i] = $needleTag;\n\t\t$hyperlinks[$i] = array($needleParsed, $needleTag);\n\t\t\n\t} // END FOR LOOP\n\n\t// REPLACE THE LINK TEXT WITH THE <a> TAGS (USING THE ARRAYS AS PARAMS IN THE STR REPLACE FUNCTION)\n\t$parsed = str_replace($needles, $tags, $text);\n\treturn $parsed;\n\n}", "public function getHeadlines()\n {\n return $this->headlines;\n }", "public function getHeadlines()\n {\n return $this->headlines;\n }", "public abstract function get_html();", "public function links() {\n\t\t?>\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/15uoww1\" target=\"_blank\"><?php echo __( 'Installation manual', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/W9GDQT\" target=\"_blank\"><?php echo __( 'Frequently Asked Questions', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/WW93Sk\" target=\"_blank\"><?php echo __( 'Report a bug', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/11UE2lF\" target=\"_blank\"><?php echo __( 'Request a function', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/XkivOW\" target=\"_blank\"><?php echo __( 'Submit a translation', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://bit.ly/UlDG4t\" target=\"_blank\"><?php echo __( 'More cool stuff by WPBuddy', $this->_google_drive_cdn->get_textdomain() ); ?></a>\n\t\t\t</li>\n\t\t</ul>\n\t<?php\n\t}", "protected function addHeading($a_id)\n\t{\n\t\t$this->callEditor(\"addHeadingObject\", \"q_id\", $a_id);\t\t\n\t\treturn true;\n\t}", "function get_html_header();", "public function printResultSectionLinks() {}", "public function setHeading($heading)\n {\n $this->heading = $heading;\n return $this;\n }", "function v2_mumm_html_head_alter(&$head_elements) {\n $url = explode('/', current_path());\n if ($url[0] == 'gallery-photo') {\n unset($head_elements['metatag_og:title_0']);\n unset($head_elements['metatag_og:url_0']);\n }\n if(isset($head_elements['metatag_canonical']) && $head_elements['metatag_canonical']['#type'] =='html_tag'){\n $head_elements['metatag_canonical']['#value'] = urldecode($head_elements['metatag_canonical']['#value']);\n }\n}", "protected function parseEmph($text)\n\t{\n\t\t// must take care of code elements, 'http://', 'https://', and 'ftp://'\n\t\t$pattern =<<< REGEXP\n/^\\/\\/(\n (.*?{{{.*?}}}.*?)+?| # including inline code span\n ((?!.*{{{.*?}}}).*?) # without inline code span\n)(?<!http:|(?<=h)ttps:|(?<=f)tp:)\\/\\/(?!\\/)/sx\nREGEXP;\n\n\t\tif (preg_match($pattern, $text, $matches)) {\n\t\t\treturn [\n\t\t\t\t[\n\t\t\t\t\t'emph',\n\t\t\t\t\t$this->parseInline($matches[1])\n\t\t\t\t],\n\t\t\t\tstrlen($matches[0])\n\t\t\t];\n\t\t} else {\n\t\t\t// no ending // ... should be treated as em\n\t\t\treturn [\n\t\t\t\t[\n\t\t\t\t\t'emph',\n\t\t\t\t\t$this->parseInline(substr($text,2))\n\t\t\t\t],\n\t\t\t\tstrlen($text)\n\t\t\t];\n\t\t}\n\t}", "public function appendH1(mixed $content = null): H1;", "function parseText($txt,$wrap){\n\t\t\t$txt = $this->TS_links_rte($txt, $wrap);\n\t\t\t//prepend relative paths with url\n\t\t\t$txt = $this->makeAbsolutePaths($txt);\n\t\t\t$txt = $this->cleanHTML($txt);\n\t\t\treturn $txt;\n\t\t\n\t}", "function get_h6($file){\r\n $h1tags = preg_match_all(\"/(<h6.*>)(\\w.*)(<\\/h6>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "function start_anchor($link, $tabs = 0, $nl = false)\n{\n /**\n * Starting Anchor tag.\n *\n * Args:\n * $link (int): the link of the Anchor\n * $tabs (int): number of tabs for indentation, default is 0\n * $nl (bool): print NewLine in the end ? default is 'false'.\n */\n start_tag('a', Tab($tabs), $nl, \"href='\" . $link . \"'\") ;\n}", "function efSidebarHeadingRenderH1( $input, $argv, $parser ) {\n return extraTags::headerTagsCommon(\"h1\",$input,$argv,$parser);\n }", "public function renderTagAnchor($result);", "function get_h2($file){\r\n $h1tags = preg_match_all(\"/(<h2.*>)(\\w.*)(<\\/h2>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "protected function add_ids_and_jumpto_links( $items, $content ) {\n\t\t$first = true;\n\t\t$matches = array();\n\t\t$replacements = array();\n\n\t\tforeach ( $items as $item ) {\n\t\t\t$replacement = '';\n\t\t\t$matches[] = $item[0];\n\t\t\t$tag = 'h' . $item['level']; // 'h2'\n\t\t\t$id = $item['id'];\n\t\t\t$title = $item['title'];\n\t\t\t$extra_attrs = $item['attrs']; // 'class=\"\" style=\"\"'\n\t\t\t$class = 'toc-heading';\n\n\t\t\tif ( $extra_attrs ) {\n\t\t\t\t// Strip all IDs from the heading attributes (including empty), we'll replace it with one below.\n\t\t\t\t$extra_attrs = trim( preg_replace( '/id=([\"\\'])[^\"\\']*\\\\1/i', '', $extra_attrs ) );\n\n\t\t\t\t// Extract any classes present, we're adding our own attribute.\n\t\t\t\tif ( preg_match( '/class=([\"\\'])(?P<class>[^\"\\']+)\\\\1/i', $extra_attrs, $m ) ) {\n\t\t\t\t\t$extra_attrs = str_replace( $m[0], '', $extra_attrs );\n\t\t\t\t\t$class .= ' ' . $m['class'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $first ) {\n\t\t\t\t$replacement .= '<p class=\"toc-jump\"><a href=\"#top\">' . $this->args->top_text . '</a></p>';\n\t\t\t} else {\n\t\t\t\t$first = false;\n\t\t\t}\n\n\t\t\t$replacement .= sprintf(\n\t\t\t\t'<%1$s id=\"%2$s\" class=\"%3$s\" tabindex=\"-1\" %4$s><a href=\"#%2$s\" class=\"dashicons-before dashicons-admin-links\">%5$s</a></%1$s>',\n\t\t\t\t$tag,\n\t\t\t\t$id,\n\t\t\t\t$class,\n\t\t\t\t$extra_attrs,\n\t\t\t\t$title\n\t\t\t);\n\t\t\t$replacements[] = $replacement;\n\t\t}\n\n\t\tif ( $replacements ) {\n\t\t\tif ( count( array_unique( $matches ) ) !== count( $matches ) ) {\n\t\t\t\tforeach ( $matches as $i => $match ) {\n\t\t\t\t\t$content = preg_replace( '/' . preg_quote( $match, '/' ) . '/', $replacements[ $i ], $content, 1 );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$content = str_replace( $matches, $replacements, $content );\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}", "function minorite_menu_link__home(array $variables) {\n $element = $variables['element'];\n\n $output = l('<span>' . $element['#title'] . '</span>', $element['#href'], array('html' => TRUE));\n return '<li>' . $output . \"</li>\\n\";\n}", "public static function includeHeadLinks()\n {\n $code = '';\n foreach (self::$_headLinks as $link) {\n $code .= \"<link href=\\\"{$link['href']}\\\" {$link['attrs']} />\".PHP_EOL;\n }\n\n return $code;\n }", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "function get_a_content($file){\r\n $h1count = preg_match_all(\"/(<a.*>)(\\w.*)(<.*>)/ismU\",$file,$patterns);\r\n return $patterns[2];\r\n}", "public function provideTestSelfLinks() {\n\n\t\tyield [\n\t\t\t'Self link to page without display title, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lower case page title, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, fragment, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page#Fragment]]',\n\t\t\t'Snake Page#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, fragment only, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[#Fragment]]',\n\t\t\t'#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, page name link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, page name with underscores link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Snake_Page]]',\n\t\t\t'Snake_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, other link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// self link to content page with display title\n\n\t\tyield [\n\t\t\t'Self link to page with display title, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lower case page title, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, fragment, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page#Fragment]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, fragment only, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[#Fragment]]',\n\t\t\t'#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, page name link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, page name with underscores link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Sable_Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, other link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\t}", "function getAllLinks($html){\n $tmp_str=\"\";\n $tmp_links=array();\n if (count($html->find('span[class=pl]'))>0)\n foreach ($html->find('span[class=pl] a') as $ahref)\n {\n $tmp_str=$tmp_str.'<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a><br/>';\n $tmp_links[]='<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a>';\n\n }\n return $tmp_links;\n}", "private function parse()\n {\n\n // set facebook image\n $this->header->addOpenGraphData('url', 'http://copacobana.be/nl/artiesten/line-up', true);\n $this->header->addOpenGraphData('title', 'Line Up', true);\n $this->header->addOpenGraphData('description', 'Het tijdsrooster van Copacobana Festival 2015', true);\n $this->header->addOpenGraphData('image', SITE_URL . '/src/Frontend/Themes/Copacobana/Core/Layout/images/copacobana_fb.png', true);\n $this->header->addOpenGraphData('site_name', 'Copacobana', true);\n $this->header->addOpenGraphData('type', 'article', true);\n $this->header->addOpenGraphData('author', 'Copacobana', true);\n $this->header->addOpenGraphData('publisher', 'Copacobana', true);\n\n // parse the extra header files\n $this->header->addJS('/src/Frontend/Modules/Festival/Js/masonry.min.js', false, false);\n $this->header->addJsData($this->module, 'backstage', 'undefined');\n\n\n // assign the items\n $this->tpl->assign('friday', (array) $this->friday);\n $this->tpl->assign('saturday', (array) $this->saturday);\n $this->tpl->assign('sunday', (array) $this->sunday);\n }" ]
[ "0.76134026", "0.69676524", "0.6715134", "0.6466037", "0.6269547", "0.61735755", "0.61275625", "0.60819227", "0.60324043", "0.5929578", "0.5808945", "0.5769234", "0.5621077", "0.55724424", "0.5571138", "0.5563406", "0.54859465", "0.5477194", "0.5352219", "0.5345598", "0.53198254", "0.5317281", "0.5303397", "0.52787566", "0.52203745", "0.5218407", "0.520628", "0.5200557", "0.51324946", "0.5131384", "0.51234055", "0.5104481", "0.5103002", "0.5090116", "0.5077361", "0.5051218", "0.5042491", "0.50301284", "0.50125873", "0.50038284", "0.49960256", "0.49948105", "0.49934566", "0.49934566", "0.4971549", "0.4946846", "0.4946375", "0.49326745", "0.4924113", "0.49192533", "0.48894927", "0.48743457", "0.48547238", "0.4852559", "0.4851591", "0.48459724", "0.48402178", "0.4835677", "0.48086855", "0.4807268", "0.47907615", "0.4786272", "0.4786272", "0.47812048", "0.47772145", "0.4772109", "0.47709695", "0.47679743", "0.47568536", "0.47521472", "0.4741555", "0.4734172", "0.47290644", "0.47202295", "0.47129613", "0.47124866", "0.47124866", "0.4709574", "0.46991077", "0.4692517", "0.46867907", "0.4671136", "0.4667372", "0.4666345", "0.4654257", "0.4654165", "0.46438396", "0.4632486", "0.46305966", "0.46250385", "0.46244943", "0.4614449", "0.45862246", "0.45857525", "0.45832047", "0.4579668", "0.457678", "0.45747373", "0.45721948", "0.45676446" ]
0.55214024
16
Generates an anchor name based on a given heading.
public function generateAnchorName($heading) { // Remove HTML tags $heading = preg_replace('/<(.*?)>/', '', $heading); // Remove parentheses $heading = preg_replace('/\(.*?\)/', '', $heading); // Remove inner-word punctuation $heading = preg_replace('/[\'"‘’“”]/', '', $heading); // Get the "words". This will search for any unicode "letters" or "numbers" preg_match_all('/[\p{L}\p{N}]+/u', $heading, $words); $words = ArrayHelper::filterEmptyStringsFromArray($words[0]); // Turn them into camelCase foreach ($words as $i => $word) { // Special case if the whole word is capitalized if (strtoupper($word) == $word) { $words[$i] = strtolower($word); } else { $words[$i] = lcfirst($word); } } // Put them together as the anchor name return implode('-', $words); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heading_anchors() {\r\n\t\t// headings to have an anchor, so we can take the option that the structure() function now offers us for achieving the same end.\r\n\t\t$count = 0;\r\n\t\t$arrayRxp = array(\r\n\t\t//'(<h1>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h6>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t// (2011-06-27) the name attribute is deprecated\r\n\t\t// hmm, this is further complicated by the fact that preexistent id attributes on headings can act as anchors...\r\n\t\t'(<h1)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h6)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t);\r\n\t\tforeach($arrayRxp as $search => $replace) {\r\n\t\t\t$this->code = preg_replace('/' . $search . '/is', $replace, $this->code, -1, $ct);\r\n\t\t\t$count += $ct;\r\n\t\t}\r\n\t\t$this->logMsgIf('heading_anchors', $count);\r\n\t}", "function anchor_content_headings($content) {\n // now run the pattern and callback function on content\n // and process it through a function that replaces the title with an id \n $content = preg_replace_callback(\"/\\<h([1|2|3|4])\\>(.*?)\\<\\/h([1|2|3|4])\\>/\", function ($matches) {\n $hTag = $matches[1];\n $title = $matches[2];\n $slug = str_replace(\" \", \"-\", strtolower($title));\n return '<a href=\"#'. $slug .'\"><h'. $hTag .' id=\"' . $slug . '\">' . $title . '</h'. $hTag .'></a>';\n }, $content);\n return $content;\n }", "function anchor($title, $link, $tabs = 0, $nl = true)\n{\n start_anchor($link, $tabs, false) ;\n echo $title ;\n close_anchor($tabs = 0, $nl) ;\n}", "protected function getHeadingHtml() {\n\t\t$heading = '';\n\t\tif ( $this->isUserPage ) {\n\t\t\t// The heading is just the username without namespace\n\t\t\t$heading = $this->pageUser->getName();\n\t\t} else {\n\t\t\t$pageTitle = $this->getOutput()->getPageTitle();\n\t\t\tif ( $pageTitle ) {\n\t\t\t\t$heading = $pageTitle;\n\t\t\t}\n\t\t}\n\t\treturn Html::rawElement( 'h1', [ 'id' => 'section_0' ], $heading );\n\t}", "public function get_name()\n {\n return 'section-heading';\n }", "function emc_fmc_section_title() {\r\n\r\n\t$url = get_post_type_archive_link( 'emc_content_focus' );\r\n\t$html = sprintf( '<h2 class=\"emc-section-heading\">%1$s <a class=\"emc-what-is-this\" href=\"%2$s\">%3$s</a></h2>',\r\n\t\tesc_html__( 'Foundational Math Concepts', 'emc' ),\r\n\t\tesc_url( $url ),\r\n\t\tesc_html__( 'What is this?', 'emc' )\r\n\t);\r\n\r\n\techo $html;\r\n\r\n}", "private function _addAnchorToTagMatch($match)\n\t{\n\t\t$anchorName = $this->generateAnchorName($match[3]);\n\n\t\treturn '<'.$match[1].$match[2].' id='.$anchorName.'>' .\n\t\t\t$match[3] .\n\t\t\t' <a class=\"anchor\" href=\"#'.$anchorName.'\" title=\"'.Craft::t('Direct link to {heading}', array('heading' => $match[3])).'\">#</a>' .\n\t\t\t'</'.$match[1].'>';\n\t}", "function addHeading(& $heading, & $parentElement) {\n\t\t$headingElement =& $this->_document->createElement('heading');\n\t\t$parentElement->appendChild($headingElement);\n\t\t\n\t\t$this->addCommonProporties($heading, $headingElement);\n\t\t\n\t\tif ($heading->getField('location') == 'right')\n\t\t\t$headingElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$headingElement->setAttribute('location', 'left');\n\t}", "function make_heading(& $str, $strip = TRUE)\n{\n\tglobal $NotePattern;\n\n\t// Cut fixed-heading anchors\n\t$id = '';\n\t$matches = array();\n\tif (preg_match('/^(\\*{0,3})(.*?)\\[#([A-Za-z][\\w-]+)\\](.*?)$/m', $str, $matches)) {\n\t\t$str = $matches[2] . $matches[4];\n\t\t$id = $matches[3];\n\t} else {\n\t\t$str = preg_replace('/^\\*{0,3}/', '', $str);\n\t}\n\n\t// Cut footnotes and tags\n//\tif ($strip === TRUE) $str = strip_htmltag(make_link(preg_replace($NotePattern, '', $str)));\n\tif ($strip === TRUE) $str = strip_htmltag(make_link(preg_replace_callback($NotePattern, create_function('$matches','return;'), $str)));\t\t// PHP5.5用修正\n\t\n\treturn $id;\n}", "function new_heading()\n {\n }", "private function generateTitle()\n {\n $label = $this->pre_link_text.' ';\n if($this->terms_page) {\n // if a page has been given, create the anchor\n $label.= '<a href=\"'.$this->terms_page.'\"';\n if($this->open_new_window) {\n // if were to open the link in a new window, add target=\"_blank\"\n $label.= ' target=\"_blank\"';\n }\n $label.= '>'.$this->link_text;\n $label.= '</a>';\n } else {\n // else just show the link text as plain text\n $label.= $this->link_text;\n }\n if(!is_null($this->post_link_text)) {\n // if the post link text is not blank, add it our string\n $label.= ' '.$this->post_link_text;\n }\n $label.= '.';\n // set the field title (label). We use DBField here to stop SS escaping it.\n $this->title = DBField::create_field('HTMLFragment', $label);\n return $this;\n }", "function _headerToLink($title, $create = false) {\n if($create) {\n return sectionID($title, $this->headers);\n } else {\n $check = false;\n return sectionID($title, $check);\n }\n }", "private function generateHeading()\n {\n //get current dimensions\n\t\t$highestRow = $this->objWorksheet->getHighestRow(); // e.g. 10\n\t\t$highestColumn = $this->objWorksheet->getHighestColumn(); // e.g 'F'\n\n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\t//insert row on top\n\t\t$this->objWorksheet->insertNewRowBefore(1,2);\n\n\t\t//merge cells\n\t\t$this->objWorksheet->mergeCells(\"A1:\".$highestColumn.\"1\");\n\n\t\t//set the text for header\n\t\t$this->objWorksheet->setCellValue(\"A1\", $this->_headingText);\n\t\t$this->objWorksheet->getStyle('A1')->getAlignment()->setWrapText(true);\n\t\t$this->objWorksheet->getRowDimension('1')->setRowHeight(48);\n\n //Apply style\n\t\t$this->objWorksheet->getStyle(\"A1\")->applyFromArray($this->_headingStyleArray);\n }", "function heading( $data = '', $h = '1', $attributes = '' )\n\t{\n\t\treturn '<h' . $h . _stringify_attributes( $attributes ) . '>' . $data . '</h' . $h . '>';\n\t}", "protected function callback_heading_as_html ($matches) {\n\t\t$heading = preg_replace(\"|%%(\\d+)%%|\", '', $matches[2]);\n\n $result = str_repeat ('+', (strlen($matches[1]) - 1)).' '.$heading.\"\\n\";\n\n return $result;\n }", "private function url_anchor_target($title) {\n $return = FALSE;\n\n if ($title) {\n $return = trim(strip_tags($title));\n\n // convert accented characters to ASCII\n $return = StringUtils::spanish_stemmer($return);\n\n // replace newlines with spaces (eg when headings are split over multiple lines)\n $return = str_replace(array(\"\\r\", \"\\n\", \"\\n\\r\", \"\\r\\n\"), ' ', $return);\n\n // remove &amp;\n $return = str_replace('&amp;', '', $return);\n\n // remove non alphanumeric chars\n $return = preg_replace('/[^a-zA-Z0-9 \\-_]*/', '', $return);\n\n // convert spaces to _\n $return = str_replace(\n array(' ', ' '),\n '_',\n $return\n );\n\n // remove trailing - and _\n $return = rtrim($return, '-_');\n\n // lowercase everything?\n $return = strtolower($return);\n\n // hyphenate?\n $return = str_replace('_', '-', $return);\n $return = str_replace('--', '-', $return);\n }\n\n if (array_key_exists($return, $this->collision_collector)) {\n $this->collision_collector[$return]++;\n $return .= '-' . $this->collision_collector[$return];\n }\n else {\n $this->collision_collector[$return] = 1;\n }\n\n return $return;\n }", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function getHeadingText(string $markdown, string $heading = '#') : string\n {\n // Try to find a heading 1 and if so use that text for the title tag of the generated page\n $matches = array();\n $title = '';\n\n try {\n preg_match(\"/\".$heading.\" ?(.*)/\", $markdown, $matches);\n $title = (count($matches) > 0) ? trim($matches[1]) : '';\n\n // Be sure that the heading 1 wasn't type like # MyHeadingOne # i.e. with a final #\n\n $title = ltrim(rtrim($title, $heading), $heading);\n } catch (Exception $e) {\n }\n\n return $title;\n }", "abstract protected function generateName();", "function genesis_seo_site_title_new_link() {\n\t\n\t//* Set what goes inside the wrapping tags\n\t$inside = sprintf( '<a href=\"%s\" title=\"Visit Bruno Group Signature Services\">%s</a>', trailingslashit( '//brunogroup.com/signature-services' ), get_bloginfo( 'name' ) );\n\n\t//* Determine which wrapping tags to use\n\t$wrap = is_home() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';\n\n\t//* A little fallback, in case an SEO plugin is active\n\t$wrap = is_home() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;\n\n\t//* And finally, $wrap in h1 if HTML5 & semantic headings enabled\n\t$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;\n\n\t//* Build the title\n\t$title = genesis_html5() ? sprintf( \"<{$wrap} %s>\", genesis_attr( 'site-title' ) ) : sprintf( '<%s id=\"title\">%s</%s>', $wrap, $inside, $wrap );\n\t$title .= genesis_html5() ? \"{$inside}</{$wrap}>\" : '';\n\n\t//* Echo (filtered)\n\techo apply_filters( 'genesis_seo_title', $title, $inside, $wrap );\n\n}", "function tep_create_sort_heading($sortby, $colnum, $heading) {\n global $PHP_SELF;\n\n $sort_prefix = '';\n $sort_suffix = '';\n\n if ($sortby) {\n $sort_prefix = '<a href=\"' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '\" title=\"' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '\" class=\"productListing-heading\">' ;\n $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';\n }\n\n return $sort_prefix . $heading . $sort_suffix;\n }", "function qa_anchor($basetype, $postid)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn strtolower($basetype) . $postid; // used to be $postid only but this violated HTML spec\n}", "function makeLink($text, $link, $section = '', $title = '', $target = '')\n{\n\t// if there's nothing to link, don't link anything\n\tif(!$text)\n\t\treturn '';\n\n\t$ret = '<a href=\"';\n\n\tif($section != 'EXTERIOR')\n\t{\n\t\tif($section == '/')\n\t\t\t$ret .= ARC_WWW_PATH;\n\t\telse if($section)\n\t\t\t$ret .= ARC_WWW_PATH . $section . '/';\n\n\t\t$ret .= '?';\n\t}\n\n\tif($section != 'EXTERIOR' && isset($_GET['sqlprofile']) || isset($_POST['sqlprofile']))\n\t\t$link .= '&sqlprofile';\n\n\t$ret .= str_replace('&', '&amp;', $link) . '\"';\n\n\tif($title)\n\t\t$ret .= ' title=\"' . $title . '\"';\n\n\tif($target)\n\t\t$ret .= ' target=\"' . $target . '\"';\n\n\t$ret .= '>' . $text . '</a>';\n\n\treturn $ret;\n}", "public static function makeTitle($name);", "function generateHeading()\n{\n\t$heading = \"\";\n\t \n $randomNum = rand(1, 100);\n\t \n\tif (($randomNum >= 1) && ($randomNum <= 26))\n\t{\n\t\t$heading = getMealTypeHeading();\n\t}\n\n\tif (($randomNum >= 27) && ($randomNum <= 30))\n\t{\n\t $heading = \"Under the Clock\";\n\t}\n\n\tif (($randomNum >= 31) && ($randomNum <= 32))\n\t{\n\t\t$heading = \"Newest\";\n\t}\n\t\n\tif (($randomNum >= 33) && ($randomNum <= 40))\n\t{\n\t\t$heading = \"Top Hits\";\n\t}\n\t\n\tif (($randomNum >= 41) && ($randomNum <= 42))\n\t{\n\t\t$heading = \"Chef Favourites\";\n\t}\n\t\n\tif (($randomNum >= 43) && ($randomNum <= 50))\n\t{\n\t\t$heading = \"Trending Now\";\n\t}\n\t\n\tif (($randomNum >= 51) && ($randomNum <= 52))\n\t{\n\t\t$heading = \"Spotlight\";\n\t}\n\t\n\tif (($randomNum >= 53) && ($randomNum <= 57))\n\t{\n\t\t$heading = getNextHolidayHeading();\n\t\t\n\t\tif (strcmp($heading, \"None\") == 0)\n\t\t{\n\t\t\tgenerateHeading();\n\t\t}\n\t}\n\t\n\tif (($randomNum >= 58) && ($randomNum <= 62))\n\t{\n\t\t$heading = \"New\";\n\t}\n\t\n\tif (($randomNum >= 63) && ($randomNum <= 77))\n\t{\n\t\t$heading = getPopularIngredientHeading();\n\t}\n\t\n\tif (($randomNum >= 78) && ($randomNum <= 90))\n\t{\n\t\t$heading = getOtherFeatureHeading();\n\t}\n\t\n\tif (($randomNum >= 91) && ($randomNum <= 100))\n\t{\n\t\t$heading = getEthnicityHeading();\n\t}\n\n\treturn $heading;\n}", "function get_anchor( $title ) {\n $unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',\n 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',\n 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',\n 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',\n 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' );\n $title = strtr( $title, $unwanted_array );\n $title = str_replace(\" \", \"-\", $title);\n $title = str_replace(\"'\", \"-\", $title);\n $title = strtolower($title);\n $title = substr($title, 0, 50);\n return $title;\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nUnique to Oracle\nMAINHEADING;\n }", "function createSimpleLink($idName) {\n echo '<a href=\"index.php\" id=\"' . $idName . '\" class=\"nested\">homepage</a>';\n }", "public function get_name() {\n return 'apr_modern_heading';\n }", "function getPersonLink($lastname,$firstname) {\n return getNormalisedChars($lastname).'_'.getNormalisedChars($firstname);\n}", "protected function createAnchor($item, $level)\n {\n \t// <a href=\"{{ route('admin.home') }}\"><i class=\"fa fa-lg fa-fw fa-home\"></i> <span class=\"menu-item-parent\">Dashboard</span></a>\n $output = '<a class=\"menu__item\" href=\"' . $item['url'] . '\">';\n $output .= $this->createIcon($item);\n\n if ($level === 1) {\n\t\t\t$output .= '<span class=\"menu-item-parent\">';\n }\n\n $output .= $item['name'];\n\n\t\tif ($level === 1) {\n\t\t\t$output .= '</span>';\n }\n\n $output .= '</a>';\n\n return $output;\n }", "protected function callback_numbered_heading_as_html ($matches) {\n\t\t$heading = preg_replace(\"|%%(\\d+)%%|\", '', $matches[2]);\n\n\t\t$this->headings[strlen($matches[1])]++;\n\t\t\n\t\t$numbering = '';\n\n\t\t$numbering = $headings[2];\n\n\t\tforeach($this->headings as $headingLevel => $count) {\n\t\t\tif($headingLevel > strlen($matches[1])) {\n\t\t\t\t$this->headings[$headingLevel] = 0;\n\t\t\t} elseif($headingLevel <= strlen($matches[1]) && $headingLevel > 2) {\n\t\t\t\t$numbering = $numbering . '.' . $count;\n\t\t\t}\n }\n\t\t\t\n\t\t$numbering .= ' ';\n\n\t $result = str_repeat ('+', (strlen($matches[1]) - 1)).' '.$numbering.$heading.\"\\n\";\n\n\t return $result;\n\t}", "function set_heading()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->heading = $this->_prep_args($args);\n\t}", "function make_link($params = null) {\n $params = func_get_args();\n $name = array_shift($params);\n $url = call_user_func_array('url_for', $params);\n \n return sprintf('<a href=\"%s\">%s</a>', $url, $name);\n}", "public static function anchorify(string $id): string {\n\t\treturn SwissKnife::stringToID($id);\n\t}", "function headlink($label, $this_sort) {\n global $sort, $reverse, $course_code, $themeimg, $langUp, $langDown;\n $base_url = $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code;\n\n if ($sort == $this_sort) {\n $this_reverse = !$reverse;\n $indicator = \" <img src='$themeimg/arrow_\" .\n ($reverse ? 'up' : 'down') . \".png' alt='\" .\n ($reverse ? $langUp : $langDown) . \"'>\";\n } else {\n $this_reverse = $reverse;\n $indicator = '';\n }\n return '<a class=\"text-white\" href=\"' . $base_url .\n '&amp;sort=' . $this_sort . ($this_reverse ? '&amp;rev=1' : '') .\n '\">' . $label . $indicator . '</a>';\n}", "public function getHeading(): string;", "function start_anchor($link, $tabs = 0, $nl = false)\n{\n /**\n * Starting Anchor tag.\n *\n * Args:\n * $link (int): the link of the Anchor\n * $tabs (int): number of tabs for indentation, default is 0\n * $nl (bool): print NewLine in the end ? default is 'false'.\n */\n start_tag('a', Tab($tabs), $nl, \"href='\" . $link . \"'\") ;\n}", "public function property_title() {\n\n\t\t\t$this->add_package = $this->getAddPackage();\n\n\t\t\t$headline_select = get_field( 'headline_select' );\n\t\t\t$standard_section = get_field( 'practice_type' ) . ' ' . get_field( 'building_type' );\n\t\t\t$custom_section = ( $headline_select == 'Custom Headline' )\n\t\t\t\t? get_field( 'custom_headline' )\n\t\t\t\t: $standard_section;\n\n\t\t\t$location = get_field( 'address_city' ) . ', ' . get_field( 'address_state' );\n\t\t\t$headline = get_field( 'practice_is_for' ) . ' - ' . $custom_section . ' - ' . $location;\n\n\t\t\t$out = '<h3>' . $headline . '</h3>';\n\t\t\t$out .= '<div class=\"hr hr-default\"><span class=\"hr-inner \"><span class=\"hr-inner-style\"></span></span></div>';\n\n\n\t\t\treturn $out;\n\t\t}", "public function htmlAnchor($controller, $link_name, $action_method = null, $param = null,$text=null) {\n if (is_null($param) && is_null($action_method)) {\n $href = \"{$controller}\";\n } else if (!is_null($action_method) && is_null($param)) {\n $href = \"{$controller}/{$action_method}\";\n } else {\n $href = \"{$controller}/{$action_method}/{$param}\";\n }\n\n return \"<a href=\\\"\" . DOMAIN_NAME . \"{$href}\\\">{$link_name}{$text}</a>\";\n }", "public function insertAnchor($key, $default = \"\")\n\t{\n\t\techo \"<orion anchor=\\\"\" . $key . \"\\\">\" . $default . \"</orion>\";\n\t}", "public function htmlAnchor($controller, $link_name, $action_method = null, $param = null) {\n if (is_null($param) && is_null($action_method)) {\n $href = \"{$controller}\";\n } else if (!is_null($action_method) && is_null($param)) {\n $href = \"{$controller}/{$action_method}\";\n } else {\n $href = \"{$controller}/{$action_method}/{$param}\";\n }\n\n return \"<a href=\\\"\" . DOMAIN_NAME . \"/{$href}\\\">{$link_name}</a>\";\n }", "public function headline($text) {\n\t\treturn \"<h2 class='headline'>$text</h2>\";\n\t}", "public function getH1()\n\t{\n\t\treturn empty($this->h1) ? $this->name : $this->h1;\n\t}", "public function set_heading($heading) {\n $this->heading=$heading;\n if (!isset($this->form_name) or $this->form_name=='') {\n $this->form_name=$heading;\n error_log(\"BasicForm: Had to revert form name to form heading\");\n }\n }", "function setHeading($h)\n\t{\n\t\t$this->_headingText=$h;\n\t}", "function headingify($to_headingify, $level) {\r\n\t\t$to_headingify = preg_replace('/<(h[1-6])([^<>]*?)>(.*?)<\\/\\1>/is', '<p$2>$3</p>', $to_headingify);\r\n\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, 0);\r\n\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t$tagname = $tagname_matches[1][0];\r\n\t\twhile($tagname === \"div\") {\r\n\t\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, $pre_heading_OString_offset + strlen($tagname) + 1);\r\n\t\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t\t$tagname = $tagname_matches[1][0];\r\n\t\t}\r\n\t\t$pre_heading_OString = substr($to_headingify, 0, $pre_heading_OString_offset);\r\n\t\t$heading_OString = OM::getOString($to_headingify, \"<\" . $tagname, \"</\" . $tagname . \">\");\r\n\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t$strlen_heading_OString = strlen($heading_OString);\r\n\t\tif(is_numeric($level) && $level > 0 && $level < 7) {\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = preg_replace('/<(\\w+)([^<>]*?)>/is', '<h' . $level . '$2>', $heading_OString, 1);\r\n\t\t\t$heading_OString = ReTidy::remove_tags($heading_OString, \"strong\");\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = substr($heading_OString, 0, strlen($heading_OString) - strlen($tagname) - 1) . \"h\" . $level . \">\";\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t} else {\r\n\t\t\t$pos_lt = strpos($heading_OString, '>');\r\n\t\t\t$pos_gt = ReTidy::strpos_last($heading_OString, '<');\r\n\t\t\t$heading_OString = substr($heading_OString, 0, $pos_lt + 1) . '<strong>' . substr($heading_OString, $pos_lt + 1, $pos_gt - ($pos_lt + 1)) . '</strong>' . substr($heading_OString, $pos_gt);\r\n\t\t}\r\n\t\t$headingified = $pre_heading_OString . $heading_OString . substr($to_headingify, strlen($pre_heading_OString) + $strlen_heading_OString);\r\n\t\treturn $headingified;\r\n\t}", "function heading() {\n\t?>\n\t\t<!DOCTYPE html>\n\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta charset=\"utf-8\" />\n\t\t\t\t<title>Remember the Cow</title>\n\t\t\t\t<link href=\"https://webster.cs.washington.edu/css/cow-provided.css\" \n\t\t\t\t type=\"text/css\" rel=\"stylesheet\" />\n\t\t\t\t<link href=\"cow.css\" type=\"text/css\" rel=\"stylesheet\" />\n\t\t\t\t<link href=\"https://webster.cs.washington.edu/images/todolist/favicon.ico\" \n\t\t\t\t type=\"image/ico\" rel=\"shortcut icon\" />\n\t\t\t</head>\n\n\t\t\t<body>\n\t\t\t\t<div class=\"headfoot\">\n\t\t\t\t\t<h1>\n\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/todolist/logo.gif\" alt=\"logo\" />\n\t\t\t\t\t\tRemember<br />the Cow\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t<?php\n\t}", "function permalink_anchor($mode = 'id')\n {\n }", "function getTitleArgos($link) {\r\n $html = file_get_contents($link);\r\n if(!empty($html))\r\n {\r\n $matchCount = preg_match('/<h1 class=\"fn\">(.*?)<\\/h1>/s', $html, $matches);\r\n\r\n if($matchCount != 0)\r\n {\r\n return $matches[1];\r\n }\r\n }\r\n }", "protected function newHeading(DomNode $node)\n {\n // the full heading number\n $number = $this->getHeadingNumber($node);\n\n // strip the leading <hN> and the closing </hN>\n // this assumes the <hN> tag has no attributes\n $title = substr($node->C14N(), 4, -5);\n\n // lose the trailing dot for the ID\n $id = substr($number, 0, -1);\n\n return $this->headingFactory->newInstance(\n $number,\n $title,\n $this->page->getHref(),\n null,\n $id\n );\n }", "function h1tag ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('th1tag');\n return $rc->newInstanceArgs( $arguments ); \n}", "protected function SelfLink_name() {\n\treturn $this->SelfLink($this->NameSingular());\n }", "public function renderTagAnchor($result);", "function fumseck_linked_title( $id ) {\n\t$post_title = get_the_title( $id );\n\techo '<a href=\"' . esc_url( get_permalink( $id ) ) . '\" title=\"' . esc_attr( $post_title, 'fumseck' ) . '\">'. $post_title . '</a>' ;\n}", "public function headerLinks(string $description) : string\n {\n /**\n * Support h1-h10 headers. You can using wysiwyg editor and replace h7-h10 tags.\n * This operation clear p tags around headers\n */\n $description = preg_replace(\"/<(p|[hH](10|[1-9]))>(<[hH](10|[1-9]).*?>(.*?)<\\/[hH](10|[1-9])>)<\\/(p|[hH](10|[1-9]))>/\", \"$3\", $description);\n\n preg_match_all(\"/<[hH](10|[1-9]).*?>(.*?)<\\/[hH](10|[1-9])>/\", $description, $items);\n\n $usedItem = [];\n\n for ($i = 0; $i < count($items[0]); $i++) {\n\n $name = preg_replace($this->stripTags, '', trim($this->replaceH1Symbols($items[2][$i])));\n\n if ($name) {\n $link = preg_replace($this->symbols, '', strtolower($name));\n $link = preg_replace($this->spaces, '-', $link);\n $repeatCount = count(array_keys($usedItem, $name));\n\n if ($repeatCount > 0) {\n $link .= '-' . ($repeatCount + 1);\n }\n\n $title = \"<h\" . $items[1][$i] . \" id='\" . $link . \"'>\" . $items[2][$i] . \"</h\" . $items[1][$i] . \">\";\n\n $description = $this->replaceFirstOccurrence($items[0][$i], $title, $description);\n\n $usedItem[] = $name;\n } else {\n $description = $this->replaceFirstOccurrence($items[0][$i], '', $description);\n }\n }\n\n return $description;\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nOrganizational Units\nMAINHEADING;\n }", "protected function generatePageHeader($headline = \"\") \n {\t\n $headline = htmlspecialchars($headline);\n header(\"Content-type: text/html; charset=UTF-8\");\n \n\t\t\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html lang=\\\"de\\\">\\n\";\n\t\techo \"<head>\\n\";\n\t\techo \"<meta charset=\\\"UTF-8\\\" />\\n\";\n\t\techo \"<title> $headline </title>\\n\";\n\t\techo \"<link rel=\\\"stylesheet\\\" href=\\\"style/main.css\\\"/>\\n\";\n\t\techo \"<script type=\\\"text/javascript\\\" src=\\\"js/functions.js\\\"> </script>\\n\";\n\t\techo \"</head>\\n\";\n\t\techo \"<body>\\n\";\n\t\techo \"<header><h1>$headline</h1></header>\\n\";\n // to do: output common beginning of HTML code \n // including the individual headline\n }", "function eventLink ( $id, $name ) {\n return \"<a class='e' href='\" . pathToRoot() . \"e.php?i=$id'>$name</a>\";\n}", "function headings() {\r\n\t\t// and that they receive anchors so that they may be linked to from the table of contents.\r\n\t\t//ReTidy::force_headings();\r\n\t\tReTidy::heading_anchors();\r\n\t}", "public function linkTitle($link){\n $link = str_replace(\" \", \"-\", $link);\n return $link;\n }", "function link_to_home_page($text = null, $props = array())\n{\n if (!$text) {\n $text = option('site_title');\n }\n return '<a href=\"' . html_escape(WEB_ROOT) . '\" '. tag_attributes($props) . '>' . $text . \"</a>\\n\";\n}", "public function heading(string $heading): CustomTextCard\n {\n return $this->setMeta('heading', $heading);\n }", "public function setAnchor($str, $title)\n {\n parent::setLink(new Link(Link::TYPE_NAME, $str))->setTitle($title);\n }", "public function get_title()\n {\n return __('Section Heading', 'careerfy-frame');\n }", "function navHalaman($halaman_aktif, $jmlhalaman){\n$link_halaman = \"\";\n\n// Link halaman 1,2,3, ...\nfor ($i=1; $i<=$jmlhalaman; $i++){\n if ($i == $halaman_aktif){\n $link_halaman .= \"<b>$i</b> | \";\n }\nelse{\n $link_halaman .= \"<a href=halprofile-$i.html>$i</a> | \";\n}\n$link_halaman .= \" \";\n}\nreturn $link_halaman;\n}", "private function rep_title_callback($match) {\r\n\t\t\r\n\t\t$query = substr($match[0],3,-3);\t\t\r\n\t\t$title = '<h2>'.$query.'</h2>';\r\n\t\treturn $title;\r\n\t\t\r\n\t}", "protected function compile()\n\t{\n\t\t$this->Template->anchor = standardize($this->headline) . '-' . $this->id;\n\t}", "function hijack_title(&$text, $url, $title) {\n if (preg_match('/^\\s*<h1>(.*)<\\/h1>(.*)$/sxi', $text, $matches)) {\n $text = $matches[2];\n if (is_null($url)) {\n return '<h1>'.$matches[1].'</h1>';\n } else {\n return '<h1>'.format_link($url, $matches[1], false).'</h1>';\n }\n } else {\n if (is_null($url)) {\n return '<h1>'.html_escape($title).'</h1>';\n } else {\n return '<h1>'.format_link($url, $title).'</h1>';\n }\n }\n}", "public function get_title() {\n return __( 'APR Heading', 'apr-core' );\n }", "protected function title() {\n\t\t$title = Text::get('login_title');\n\n\t\treturn \"$title &mdash; Automad\";\n\t}", "function createLinkText($name,$ext='') {\n\t\t$ext = strtolower($ext);\n\n\t\t$ret = str_replace('&', ' and ', $name);\n\t\t$ret = str_replace(' ', '_', $ret);\n\n\t\t$pattern = '/[\\x{21}-\\x{2C}]|[\\x{2F}]|[\\x{5B}-\\x{5E}]|[\\x{7E}]/';\n\t\t$ret = preg_replace($pattern, '_', $ret);\n\t\t$ret = str_replace('___', '_', $ret);\n\t\t$ret = str_replace('__', '_', $ret);\n\t\t$ret = str_replace('__', '_', $ret);\n\n\t\tif ($ext != '' && $ext != 'html' && $ext != 'htm') {\n\t\t\t$ret .= '.'.$ext;\n\t\t}\n\t\treturn $ret;\n\t}", "public static function panchor($protocol, $uri, $title = FALSE, $attributes = FALSE)\n\t{\n\t\treturn html::anchor($uri, $title, $attributes, $protocol);\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nSQL Basics\nMAINHEADING;\n }", "function timezonecalculator_get_section_link($section, $allSections, $section_nicename='') {\r\n\tif (!array_key_exists($section, $allSections))\r\n\t\treturn;\r\n\r\n\t$fieldsPre=\"timezones_\";\r\n\t$sectionPost='_Section';\r\n\r\n\t$menuitem_onclick='';\r\n\r\n\tif (strlen($section_nicename)<1)\r\n\t\t$section_nicename=str_replace('_', ' ', $section);\r\n\r\n\tif ($allSections[$section]=='1')\r\n\t\t$menuitem_onclick=\" onclick=\\\"timezonecalculator_assure_open_section('\".$section.\"');\\\"\";\r\n\r\n\treturn '<a'.$menuitem_onclick.' href=\"#'.$fieldsPre.$section.'\">'.$section_nicename.'</a>';\r\n}", "public function appendH1(mixed $content = null): H1;", "function personlink($personid, $text) {\n\treturn \"<a href=\\\"\". personlinkurl($personid) .\"\\\">$text</a>\";\n}", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "private static function generateSectionA($familyName)\n {\n $familyName = self::clean($familyName);\n $familyName = preg_replace(\"/^MAC/\", \"MC\", $familyName);\n $familyName = substr($familyName, 0, 5);\n $familyName = str_pad($familyName, 5, \"9\");\n\n return $familyName;\n }", "abstract public function routeName();", "function heading( $element )\n\t\t{\t\n\t\t\t$extraclass = $required = \"\";\t\n\t\t\tif(isset($element['required'])) \n\t\t\t{ \n\t\t\t\t$required = '<input type=\"hidden\" value=\"'.$element['required'][0].'::'.$element['required'][1].'\" class=\"ace_required\" />'; \n\t\t\t\t$extraclass = ' ace_hidden ace_required_container';\n\t\t\t} \n\t\t\t\n\t\t\tif(isset($element['class'])) $extraclass .= ' '.$element['class'];\n\t\t\n\t\t\t$output = '<div class=\"ace_section ace_'.$element['type'].' '.$extraclass.'\" id=\"ace_'.$element['id'].'\">';\n\t\t\t$output .= $required;\n\t\t\tif($element['name'] != \"\") $output .= '<h4>'.$element['name'].'</h4>';\n\t\t\t$output .= $element['desc'];\n\t\t\t$output .= '</div>';\n\t\t\treturn $output;\n\t\t}", "public function getTitleWithLink()\n {\n $id = $this->id;\n $url = route('demopost.manager', ['id' => $id]);\n return \"<a href='$url' target='_blank'>$this->title</a>\";\n }", "private function makeCalendarTitle()\n\t{\n\t\tif(strlen($this->headerTitle) > 0) {\n\t\t\t$this->calWeekDays .= \"\\t<tr>\\n\\t\\t<th class=\\\"headerTitle\\\" colspan=\\\"7\\\">\".$this->headerTitle.\"</th>\\n\\t</tr>\";\n\t\t\t$this->outArray['title'] = $this->headerTitle;\n\t\t}\n\t}", "public function subhead($text) {\n\t\treturn \"<h4 class='subhead'>$text</h4>\";\n\t}", "public function getNameLink()\n\t{\n\t\treturn CHtml::link($this->getNameText(), array(\n\t\t\t'tab/update',\n\t\t\t'id'=>urlencode($this->owner->id),\n\t\t));\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nAdvanced Collections in C#\nMAINHEADING;\n }", "function crb_create_anchor($value, $link, $classes = '', $target = '_self') {\n\tif ( empty($link) || empty($link) ) {\n\t\treturn;\n\t}\n\n\tif ( $classes ) {\n\t\tif ( is_array($classes) ) {\n\t\t\t$classes = implode(' ', $classes);\n\t\t}\n\n\t\t$classes = 'class=\"' . $classes . '\"';\n\t}\n\n\tob_start();\n\t?>\n\n\t<a href=\"<?php echo $link; ?>\" target=\"<?php echo $target; ?>\" <?php echo $classes; ?>><?php\n\t\techo $value;\n\t?></a>\n\n\t<?php\n\treturn ob_get_clean();\n}", "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "function generate_archive_title() {\n\t\tif ( ! function_exists( 'the_archive_title' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$clearfix = is_author() ? ' clearfix' : '';\n\t\t?>\n\t\t<header class=\"page-header<?php echo $clearfix; // WPCS: XSS ok, sanitization ok. ?>\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * generate_before_archive_title hook.\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t */\n\t\t\tdo_action( 'generate_before_archive_title' );\n\t\t\t?>\n\n\t\t\t<h1 class=\"page-title\">\n\t\t\t\t<?php the_archive_title(); ?>\n\t\t\t</h1>\n\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * generate_after_archive_title hook.\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t *\n\t\t\t * @hooked generate_do_archive_description - 10\n\t\t\t */\n\t\t\tdo_action( 'generate_after_archive_title' );\n\t\t\t?>\n\t\t</header><!-- .page-header -->\n\t\t<?php\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nOverview of the Android Ecosystem\nMAINHEADING;\n }", "public function computedTitle();", "function admJournoLink( $ref, $prettyname=null )\n{\n return sprintf( \"<a href=\\\"/%s\\\">%s</a> <small>(<a href=\\\"/adm/%s\\\">admin</a>)</small>\",\n $ref,\n $prettyname?$prettyname:$ref,\n $ref );\n}", "public function giveSectionLinkTitle( $report_row )\n\t{\n\t\t/* Got a comment? O_ò */\n\t\tif ( $report_row['exdat3'] && is_numeric( $report_row['exdat3'] ) )\n\t\t{\n\t\t\t$album = $this->registry->gallery->helper('albums')->fetchAlbumsById( $report_row['exdat3'] );\n\t\t\t\n\t\t\t/* Album exists? */\n\t\t\tif ( $album['album_id'] )\n\t\t\t{\n\t\t\t\treturn array( 'title'\t\t=> IPSLib::getAppTitle('gallery') . ': '. $album['album_name'],\n\t\t\t\t\t\t\t 'url'\t\t\t=> '/index.php?app=gallery&amp;album=' . $album['album_id'],\n\t\t\t\t\t\t\t 'seo_title'\t=> $album['album_name_seo'],\n\t\t\t\t\t\t\t 'seo_template'=> 'viewalbum'\n\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Got here? Fallback on normal link then */\n\t\treturn array( 'title'\t\t=> $this->lang->words['report_section_title_site_gallery'],\n\t\t\t\t\t 'url'\t\t\t=> '/index.php?app=gallery',\n\t\t\t\t\t 'seo_title'\t=> 'false',\n\t\t\t\t\t 'seo_template'=> 'app=gallery'\n\t\t\t\t\t );\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nXML Schemas continued..\nMAINHEADING;\n }", "private static function _getSectionHeading($customSectionNameShort)\n {\n $string1 = \" CUSTOM FORM SECTION: $customSectionNameShort \";\n $string2 = str_repeat(' ', 98 - strlen($string1));\n\n $str = '/' . str_repeat('*', 98) . \"*\\n\";\n $str .= '*' . str_repeat(' ', 98) . \"*\\n\";\n $str .= '*' . \"$string1$string2\" . \"*\\n\";\n $str .= '*' . str_repeat(' ', 98) . \"*\\n\";\n $str .= '*' . str_repeat('*', 98) . \"*/\\n\\n\";\n\n return $str;\n }", "function getSortMapping($heading) {\n\t\tswitch ($heading) {\n\t\t\tcase 'id': return 'a.submission_id';\n\t\t\tcase 'submitDate': return 'a.date_submitted';\n\t\t\tcase 'section': return 'section_abbrev';\n\t\t\tcase 'authors': return 'author_name';\n\t\t\tcase 'title': return 'submission_title';\n\t\t\tcase 'active': return 'incomplete';\n\t\t\tcase 'reviewerName': return 'u.last_name';\n\t\t\tcase 'quality': return 'average_quality';\n\t\t\tcase 'done': return 'completed';\n\t\t\tcase 'latest': return 'latest';\n\t\t\tcase 'active': return 'active';\n\t\t\tcase 'average': return 'average';\n\t\t\tcase 'name': return 'u.last_name';\n\t\t\tdefault: return null;\n\t\t}\n\t}", "private function generate_title_link($publication)\n {\n if ($this->get_component()->is_allowed(WeblcmsRights::EDIT_RIGHT))\n {\n return $this->generate_teacher_title_link($publication);\n }\n return $this->generate_student_title_link($publication);\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nASP.NET Model-View-Controller\nMAINHEADING;\n }", "public function getGridNameLink()\n\t{\n\t\t$markup = CHtml::link($this->owner->name, array(\n\t\t\t'tab/update',\n\t\t\t'id'=>urlencode($this->owner->id),\n\t\t));\n\n\t\t$markup .= $this->childCount();\n\t\t$markup .= $this->sortableId();\n\n\t\treturn $markup;\n\t}", "function person_link(stdClass $person, string $id = 'id'): string {\n\t$text = $person->first_name . ' ' . $person->last_name;\n\t$title = sprintf('View %s\\'s record', $text);\n\t$options = [\n\t\t'title' => $title,\n\t];\n\t$path = 'person/view/' . $person->{$id};\n\treturn create_link($path, $text, $options);\n}" ]
[ "0.67633224", "0.6057888", "0.60150397", "0.58401763", "0.58030105", "0.5766994", "0.5761064", "0.56733775", "0.5601421", "0.5550285", "0.5527711", "0.55157316", "0.5511428", "0.549522", "0.54193324", "0.54011625", "0.5390055", "0.5373236", "0.5349038", "0.5334081", "0.52985007", "0.5294069", "0.52653766", "0.5248362", "0.5231715", "0.5228947", "0.52286106", "0.5184138", "0.5172474", "0.51680577", "0.51660216", "0.5161134", "0.51504296", "0.51145554", "0.5102375", "0.50991267", "0.5093735", "0.50869036", "0.50853014", "0.5080562", "0.5072247", "0.5070602", "0.506644", "0.50605446", "0.50418496", "0.5030081", "0.50151455", "0.49995685", "0.49991775", "0.49841064", "0.49749318", "0.4971561", "0.49567634", "0.4941806", "0.49409837", "0.49317688", "0.49193138", "0.49167007", "0.49140894", "0.49101585", "0.4909957", "0.4905524", "0.49019486", "0.48886517", "0.48874396", "0.48690453", "0.486401", "0.48619068", "0.48615655", "0.4828896", "0.48269102", "0.48019108", "0.4798161", "0.47961342", "0.47951508", "0.4793947", "0.479292", "0.47903568", "0.4789342", "0.47888625", "0.47786605", "0.47753483", "0.4774573", "0.47711006", "0.47661814", "0.47565016", "0.475409", "0.47505936", "0.47482744", "0.47462022", "0.4740434", "0.47378686", "0.47367695", "0.47344854", "0.4728469", "0.472298", "0.47195292", "0.47044364", "0.47030804", "0.47018924" ]
0.84614486
0
Private Methods ========================================================================= Adds an anchor link to the given HTML tag match.
private function _addAnchorToTagMatch($match) { $anchorName = $this->generateAnchorName($match[3]); return '<'.$match[1].$match[2].' id='.$anchorName.'>' . $match[3] . ' <a class="anchor" href="#'.$anchorName.'" title="'.Craft::t('Direct link to {heading}', array('heading' => $match[3])).'">#</a>' . '</'.$match[1].'>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function __parseLinksHTML($match)\n\t{\n\t\t$completeUrl = $match[1] ? $match[0] : \"http://{$match[0]}\";\n\n\t\treturn '<a target=\"_blank\" href=\"' . $completeUrl . '\">'\n\t\t . $match[2] . $match[3] . $match[4] . '</a>';\n\t}", "public function renderTagAnchor($result);", "public function appendHyperlink(?string $href = null, mixed $content = null, ?string $target = null): A;", "public static function anchor($url,$text,$attributes = null) {\r\n\t\treturn \"<a href='\".Configuration::getURLPath().\"/\".$url.\"' \".$attributes.\">\".$text.\"</a>\";\r\n\t}", "public function renderTagAnchor($result) {\n\n\t\t$file = $this->file;\n\n\t\treturn sprintf('<a href=\"%s%s\" target=\"%s\">%s</a>',\n\t\t\t$this->getAnchorUri() ? $this->getAnchorUri() : $file->getPublicUrl(TRUE),\n\t\t\t$this->getAppendTimeStamp() ? '?' . $file->getProperty('tstamp') : '',\n\t\t\t$this->getTarget(),\n\t\t\t$result\n\t\t);\n\t}", "public function renderTagAnchor($result) {\n\t\t$uri = $this->thumbnailService->getAnchorUri();\n\t\tif (! $uri) {\n\t\t\t$uri = $this->getUri();\n\t\t}\n\n\t\treturn sprintf('<a href=\"%s\" target=\"_blank\" data-uid=\"%s\">%s</a>',\n\t\t\t$uri,\n\t\t\t$this->getFile()->getUid(),\n\t\t\t$result\n\t\t);\n\t}", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function start_anchor($link, $tabs = 0, $nl = false)\n{\n /**\n * Starting Anchor tag.\n *\n * Args:\n * $link (int): the link of the Anchor\n * $tabs (int): number of tabs for indentation, default is 0\n * $nl (bool): print NewLine in the end ? default is 'false'.\n */\n start_tag('a', Tab($tabs), $nl, \"href='\" . $link . \"'\") ;\n}", "function linktag($destination, $content, $class='', $style='', $id='', $extra='', $title_alt='')\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$extra .= ' href=\"' . $destination . '\"';\n\t\t$extra .= ($title_alt == '' ? '' : ' alt=\"' . $title_alt . '\" title=\"' . $title_alt . '\"');\n\t\treturn $this->tag('a', $content, $class, $style, $id, $extra);\n\t}", "static function a($href=false, $content='', $arguments=false) {\n\t\t$arguments = self::arguments($arguments);\n\t\tif (empty($href)) {\n\t\t\t$arguments['class'] = (empty($arguments['class'])) ? 'empty' : $arguments['class'] . ' empty';\n\t\t} else {\n\t\t\t$arguments['href'] = $href;\n\t\t}\n\t\tif ($email = str::starts($href, 'mailto:')) {\n\t\t\t$encoded = str::encode($email);\n\t\t\t$href = 'mailto:' . $encoded;\n\t\t\t$content = str_replace($email, $encoded, $content);\n\t\t}\n\t\treturn self::tag('a', $arguments, $content);\n\t}", "private function rep_links_callback($match) {\t\r\n\t\t\r\n\t\t$query = substr($match[0],2,-2);\r\n\r\n\t\t$db_Article = Article::getArticle()->select($query);\r\n\t\t\r\n\t\tif($db_Article != FALSE) {\r\n\t\t\t$query = ' <a href=\"' . urlencode($query) . '\">' . $query . '</a> ';\r\n\t\t\t$this->links[$this->linkCount] = $db_Article;\r\n\t\t\t$this->linkCount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $query;\t\t\r\n\t}", "public function addAnchor ($href, $text, $id = NULL, $class = NULL, $attributes = array ())\n\t{\n\t\t$id = (empty($id) ? '' : ' id=\"' . $id . '\"');\n\t\t$class = (empty($class) ? '' : ' class=\"' . $class . '\"');\n\n\t\t$html = \"<a href=\\\"$href\\\"\" . $id . $class . \"\";\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= \">$text</a>\";\n\n\t\treturn $html;\n\t}", "function links_add_target($content, $target = '_blank', $tags = array('a'))\n {\n }", "function alink($title=null,$url=null,$attributes=[], $secure=null,$escape=false) \n\t{\n\t\treturn app('html')->alink($title,$url,$attributes,$secure,$escape);\n\t}", "static function a($link, $text, $id = Null, $class = Null)\n {\n return '<a'.self::_id($id).self::_class($class).' href=\"'. $link.'\" title=\"'.$text.'\" >'.$text.'</a>';\n }", "protected static function doInternalAnchorsCallback($matches)\n {\n $whole_match = $matches[1];\n\n $text = trim($matches[2], '/');\n\n if(count($matches) > 3)\n {\n $url = $matches[3] == '' ? $matches[4] : $matches[3];\n $title =& $matches[7];\n }\n else\n {\n $url = $matches[2];\n $title = '';\n }\n\n $url = self::encodeAttribute($url);\n\n $red =(self::isLink($url)) ? '' : ' redlink';\n\n $attribs = 'class=\"internal'.$red.'\"';\n\n $url = self::encodeAttribute(self::getLink($url));\n\n $redAdvise =($red) ? jgettext('Click to create this page...') : '';\n\n $attribs .=((isset($title) && $title) || $redAdvise)\n ? ' title=\"'.$redAdvise.$title.'\"'\n : '';\n\n return JHtml::link($url, $text, $attribs);\n }", "protected function single_post_tag_link( $match = '' ) {\n\t\treturn $this->get_term_link( $match, 'post_tag' );\n\t}", "public static function linkField($text,$url='#',$option=array()) {\n $option['href']=$url;\n \t\treturn self::htmltag('a',$option,$text);\n\t}", "function tag_href($selector, $text = '', $source = false)\r\n{\r\n $t = tags_href($selector, $text, $source);\r\n if ($t) $r = reset($t);\r\n else $r='';\r\n\r\n if (DEV)\r\n xlogc('tag_href', $r, $selector, $text, $source);\r\n\r\n return $r;\r\n}", "function url_to_link_callback($matches)\n{\n return '<a href=\"' . htmlspecialchars($matches[1]) . '\">' . $matches[1] . '</a>';\n}", "function link($text,$url = '#',$attribute = array()){ \r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\tif($url){\r\n\t\t\tpreg_match(\"/([^\\?]+)?(\\?)?(.+)?/\", $url, $reg);\r\n\t\t\tif(isset($reg[3])){\r\n\t\t\t\tpreg_match_all(\"/&(amp;)?([^&]+)/\",\"&\".$reg[3], $exp);\r\n\t\r\n\t\t\t\tfor ($i=0;$i<count($exp[2]);$i++){\r\n\t\t\t\t\t$var = explode(\"=\",$exp[2][$i]);\r\n\t\t\t\t\t$exp[2][$i] = $var[0].\"=\".urlencode(isset($var[1]) ? $var[1] : '');\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t$reg[3] = implode(\"&\",$exp[2]);\r\n\t\t\t}else{\r\n\t\t\t\t$reg[3] = '';\r\n\t\t\t}\r\n\t\t\t$stat = '';\r\n\t\t\tif(isset($attribute['state'])){\r\n\t\t\t\tif($attribute['state'] == \"*\"){\r\n\t\t\t\t\t$ex = array();\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$ex = explode(\",\",$attribute['state']);\r\n\t\t\t\t}\r\n\t\t\t\t$stat = $GLOBALS['BASIC_URL']->serialize($ex);\r\n\t\t\t\tunset($attribute['state']);\r\n\t\t\t}\r\n\t\t\t$tmp = $stat.$reg[3];\r\n\t\t\t$attribute['href'] = $reg[1].($tmp ? '?' : '').$tmp;\r\n\t\t\tif(isset($attribute['path'])){\r\n\t\t\t\t$tmp = $GLOBALS['BASIC']->pathFile(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t$GLOBALS['BASIC']->ini_get('root_virtual'),\r\n\t\t\t\t\t\t$attribute['href']\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$attribute['href'] = $tmp[0].$tmp[1];\r\n\t\t\t\tunset($attribute['path']);\r\n\t\t\t}\r\n\t\t\t$attribute['href'] = $GLOBALS['BASIC_URL']->link($attribute['href']);\r\n\t\t}else{\r\n\t\t\t$attribute['href'] = '#';\r\n\t\t}\r\n\t\treturn $this->createTag('a',$attribute,$text);\r\n\t}", "public function toHyperlink(?string $linkText = null): A;", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "function tags_href($selector, $text = '', $source = false)\r\n{\r\n $r = urls(tags_attr($selector, 'href', $text, $source));\r\n if (DEV)\r\n xlogc('tags_href', $r, $selector, $text, $source);\r\n\r\n return $r;\r\n}", "static public function a($href = '', $title = '', $target = \"_self\", $misc = '', $newline = true)\n {\n global $config;\n if(empty($title)) $title = $href;\n $newline = $newline ? \"\\n\" : '';\n /* if page has onlybody param then add this param in all link. the param hide header and footer. */\n if(strpos($href, 'onlybody=yes') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')\n {\n $onlybody = $config->requestType == 'PATH_INFO' ? \"?onlybody=yes\" : \"&onlybody=yes\";\n $href .= $onlybody;\n }\n if($target == '_self') return \"<a href='$href' $misc>$title</a>$newline\";\n return \"<a href='$href' target='$target' $misc>$title</a>$newline\";\n }", "public function add_link($url, $title, $sort_order=NULL, $attributes=array()) {\n $args = func_get_args();\n \t$filter_pass = DynamicMenu_Filter::apply_filters('add_link', $args);\n if (!$filter_pass) {\n return $this;\n }\n $attributes = array_merge($this->attributes, $attributes);\n $anchor = Html::anchor($url, $title, $attributes);\n $key = self::slugify($title);\n $this->links[$key] = array(\n 'html' => $anchor,\n 'title' => $title,\n 'sort_order' => (int) $sort_order,\n );\n return $this;\n }", "public static function panchor($protocol, $uri, $title = FALSE, $attributes = FALSE)\n\t{\n\t\treturn html::anchor($uri, $title, $attributes, $protocol);\n\t}", "function anchor($title, $link, $tabs = 0, $nl = true)\n{\n start_anchor($link, $tabs, false) ;\n echo $title ;\n close_anchor($tabs = 0, $nl) ;\n}", "protected function addLinks()\n {\n }", "private function make_clickable($text) {\r\n return preg_replace_callback(\r\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', create_function(\r\n '$matches', 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\r\n ), $text\r\n );\r\n }", "public function addLink(string $name, array $attributes);", "function anchor_li($uri = '', $title = '', $attributes = '', $li_attributes = '') {\r\n $return = '<li ' . $li_attributes . '>';\r\n $return .= anchor($uri, $title, $attributes);\r\n $return .= '</li>';\r\n return $return;\r\n}", "public function addLink($href, $text){\n $this->links[] = array(\"href\" => $href, \"text\" => $text);\n }", "function render_link($text, $url) {\n return \"<a href=\\\"$url\\\">$text</a>\";\n }", "function the_feed_link($anchor, $feed = '')\n {\n }", "function _make_url_clickable_cb($matches)\n {\n }", "public static function a($url, $text = null, $options = array())\n {\n if ('@admin' == substr($url, 0, 6)) {\n $url = admin_url(ltrim(substr($url, 6), '/'));\n } elseif (false != strpos($url, 'http')) {\n $url = url($url);\n }\n\n $options['href'] = $url;\n\n if (is_null($text)) {\n $text = $url;\n }\n\n return static::tag('a', $text, $options);\n }", "function crb_create_anchor($value, $link, $classes = '', $target = '_self') {\n\tif ( empty($link) || empty($link) ) {\n\t\treturn;\n\t}\n\n\tif ( $classes ) {\n\t\tif ( is_array($classes) ) {\n\t\t\t$classes = implode(' ', $classes);\n\t\t}\n\n\t\t$classes = 'class=\"' . $classes . '\"';\n\t}\n\n\tob_start();\n\t?>\n\n\t<a href=\"<?php echo $link; ?>\" target=\"<?php echo $target; ?>\" <?php echo $classes; ?>><?php\n\t\techo $value;\n\t?></a>\n\n\t<?php\n\treturn ob_get_clean();\n}", "function olink($destination='', $class='', $style='', $id='', $extra='')\n\t{\n\t\t$extra = ($extra == '' ? 'href=\"' . $destination . '\"' : $extra . ' href=\"' . $destination . '\"');\n\t\treturn $this->otag('a', $class, $style, $id, $extra);\n\t}", "public function add_link($rel, $href, $attributes = array())\n {\n }", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }", "function link_to($url, $title = null, $attributes = [], $secure = null)\n {\n return app('html')->link($url, $title, $attributes, $secure);\n }", "public static function makeHashTagClickable($text) {\n\t\treturn preg_replace('/\\B#(\\w*[a-zA-Z]+\\w*)/', '<a href=\"/?q=%23$1\">#$1</a>', $text);\n\t}", "public function toLink(string $plaintext, $attributes='')\n {\n // Find and replace link\n $str = preg_replace('@((https?://)?([-\\w]+\\.[-\\w\\.]+)+\\w(:\\d+)?(/([-\\w/_\\.~]*(\\?\\S+)?)?)*)@', '<a href=\"$1\" '.$attributes.'>$1</a>', $plaintext);\n \n // Add \"http://\" if not set\n $str = preg_replace('/<a\\s[^>]*href\\s*=\\s*\"((?!https?:\\/\\/)[^\"]*)\"[^>]*>/i', '<a href=\"http://$1\" '.$attributes.'>', $str);\n \n return $str;\n }", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "public function makeClickable($text)\n {\n return preg_replace_callback(\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#',\n function ($matches) {\n return \"<a href=\\\"{$matches[0]}\\\">{$matches[0]}</a>\";\n },\n $text\n );\n }", "function HTMLLink ($params) {\n $val = $params['value'];\n unset($params['value']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<a {$str} >{$val}</a>\";\n }", "function link_to($url, $title = null, $attributes = [], $secure = null, $escape = true)\n {\n return app('html')->link($url, $title, $attributes, $secure, $escape);\n }", "function heading_anchors() {\r\n\t\t// headings to have an anchor, so we can take the option that the structure() function now offers us for achieving the same end.\r\n\t\t$count = 0;\r\n\t\t$arrayRxp = array(\r\n\t\t//'(<h1>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h6>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t// (2011-06-27) the name attribute is deprecated\r\n\t\t// hmm, this is further complicated by the fact that preexistent id attributes on headings can act as anchors...\r\n\t\t'(<h1)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h6)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t);\r\n\t\tforeach($arrayRxp as $search => $replace) {\r\n\t\t\t$this->code = preg_replace('/' . $search . '/is', $replace, $this->code, -1, $ct);\r\n\t\t\t$count += $ct;\r\n\t\t}\r\n\t\t$this->logMsgIf('heading_anchors', $count);\r\n\t}", "function get_archives_link($url, $text, $format = 'html', $before = '', $after = '', $selected = \\false)\n {\n }", "function addLink($link){\r\n if(!$this->isURLExistingInLinkArry($link->getURL())){\r\n $this->crawlPage($link);\r\n }\r\n \r\n }", "public function linkTag($src = \"\", $link_text = NULL, $options = NULL)\n {\n $src = ($src != \"\") ? $src : \"javascript:void(0)\";\n $pt_str = isset($options) ? $this->options2str($options) : '';\n return '<a href=\"' . $src . '\" ' . $pt_str . '>' . $link_text . '</a>';\n }", "function make_links_clickable($text)\r\n {\r\n return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href=\"$1\" target=\"_blank\">$1</a>', $text);\r\n }", "public function a($url = \"#\", $content) {\n echo \"<a href='\" . $url . \"'>\" . $content . \"</a>\";\n }", "function addLink(& $story, & $pageElement) {\t\t\n\t\t$storyElement =& $this->_document->createElement('link');\n\t\t$pageElement->appendChild($storyElement);\n\t\t\n\t\t$this->addCommonProporties($story, $storyElement);\n\t\t\n \t\t// description\n\t\t$shorttext =& $this->_document->createElement('description');\n\t\t$storyElement->appendChild($shorttext);\n\t\t$shorttext->appendChild($this->_document->createTextNode(htmlspecialchars($story->getField('shorttext'))));\n \t\t\n \t\t// file\n\t\t$longertext =& $this->_document->createElement('url');\n\t\t$storyElement->appendChild($longertext);\n\t\t$longertext->appendChild($this->_document->createTextNode(htmlspecialchars($story->getField(\"url\"))));\n\t\t\n\t\t$this->addStoryProporties($story, $storyElement);\n\t}", "function _make_clickable_rel_attr($url)\n {\n }", "function &makeClickable( &$text ) {\n $patterns = array( \"/(^|[^]_a-z0-9-=\\\"'\\/])([a-z]+?):\\/\\/([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])www\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])ftp\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/:\\.])([a-z0-9\\-_\\.]+?)@([^, \\r\\n\\\"\\(\\)'<>\\[\\]]+)/i\" );\n $replacements = array( \"\\\\1<a href=\\\"\\\\2://\\\\3\\\" target=\\\"_blank\\\">\\\\2://\\\\3</a>\", \"\\\\1<a href=\\\"http://www.\\\\2.\\\\3\\\" target=\\\"_blank\\\">www.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"ftp://ftp.\\\\2.\\\\3\\\" target=\\\"_blank\\\">ftp.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\" );\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }", "public function link($href, $text = null, $title = '') {\r\n\t\t\t$text = $text ? $text : $href;\r\n\t\t\treturn sprintf('<a href=\"%s\" title=\"%s\">%s</a>', $href, $title, $text);\r\n\t\t}", "function _hashtags_replace_with_links( $result ) {\n $tag = $result[2];\n $space = $result[1];\n $tag_object = get_term_by(\"name\", $result[2], \"post_tag\");\n \n if ($tag_object) {\n $link = get_term_link($tag_object, \"post_tag\");\n return \"$space<a href='$link' rel='tag'>#$tag</a>\";\n } \n \n return $space.\"#\".$tag;\n}", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "private function _gqbReplaceHref() {\n\t\tglobal $wgGqbDefaultWidth;\n\n\t\t$page = self::$_page->getHTML();\n\t\t$pattern = '~href=\"/wiki/([^\"]+)\"\\s*class=\"image\"~';\t\n\t\t$replaced = preg_replace_callback($pattern,'self::_gqbReplaceMatches',$page);\n\n\t\tself::$_page->clearHTML();\n\t\tself::$_page->addHTML( $replaced );\n\t}", "public static function anchor($href, $text = null, $attr = array(), $secure = null) {\n\t\tif (is_array($href)) {\n\t\t\t$route_name\t= array_shift($href);\n\t\t\t$href\t\t= Router::get($route_name, $href);\n\t\t}\n\n\t\treturn parent::anchor($href, $text, $attr, $secure);\n\t}", "public function addLink($doc, $tag = null) {\n\t\tif($doc instanceof \\RiakLink) {\n\t\t\t$new_link = $doc;\n\t\t} else if($doc instanceof \\Ripple\\Document) {\n\t\t\t$new_link = new \\RiakLink($doc->bucket()->name, $doc->key(), $tag);\n\t\t}\n\t\t$this->_links[] = $new_link;\n\t\treturn $this;\n\t}", "public function parseHtml($html, $tags = 'h1,h2,h3')\n\t{\n\t\t$tags = ArrayHelper::stringToArray($tags);\n\t\treturn preg_replace_callback('/<('.implode('|', $tags).')([^>]*)>(.+?)<\\/\\1>/', array($this, '_addAnchorToTagMatch'), $html);\n\t}", "public function linkAction() : object\n {\n $title = \"Markdown\";\n $text = file_get_contents(__DIR__ . \"/textfiles/clickable.txt\");\n // $filter = new MyTextFilter();\n\n // Deal with the action and return a response.\n $this->app->page->add(\"textfilter/clickable\", [\n \"text\" => $text,\n \"html\" => $this->filter->parse($text, [\"link\"])\n ], \"main\");\n return $this->app->page->render([ \"title\" => $title ]);\n }", "public function toLink($text = NULL, $rel = 'canonical', array $options = []);", "public static function a(stdClass $data)\n\t\t{\n\t\t\t\n\n\t\t\tif($data->class) {\n\t\t\t\t$class = 'class=\"'.$data->class.'\"';\n\t\t\t}\n\n\t\t\tif($data->href) {\n\t\t\t\t$href = $data->href;\n\t\t\t}else{\n\t\t\t\t$href = \"#\";\n\t\t\t}\n\n\t\t\tif($data->text) {\n\t\t\t\t$text = $data->text;\n\t\t\t}\n\n\t\t\treturn '<a '.$class.' href=\"'.$href.'\">'.$text.'</a>';\n\t\t}", "function get_a_additionaltags($file){\r\n $h1count = preg_match_all('/<(a.*) href=\"(.*?)\"(.*)>(.*)(<\\/a>)/',$file,$patterns);\r\n return $patterns[3];\r\n}", "function auto_link($text)\n{\n\n\n\t$url_re = '@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@';\n\t$url_replacement = \"<a href='$1' target='_blank'>$1</a>\";\n\n\treturn preg_replace($url_re, $url_replacement, $text);\n}", "public static function makeClickableLinks ($text, $addMailto = false, $replaceVisibleUrlWithText = false, $target = '_blank')\r\n\t{\r\n\t\t$delimiter = '!';\r\n\t\t$text = preg_replace ($delimiter . '(((ftp|http|https)://)[-a-zA-Z0-9@:%_\\+.~#?&//=;]+[-a-zA-Z0-9@:%_\\+~#?&//=]+)' . \"{$delimiter}i\", '<a' . ($target ? \" target=\\\"{$target}\\\"\" : '') . ' href=\"$1\">' . ($replaceVisibleUrlWithText ? $replaceVisibleUrlWithText : '$1') . '</a>', $text);\r\n\t\t$text = preg_replace ($delimiter . '([\\s()[{}])(www.[-a-zA-Z0-9@:%_\\+.~#?&//=;]+[-a-zA-Z0-9@:%_\\+~#?&//=]+)' . \"{$delimiter}i\", '$1<a' . ($target ? \" target=\\\"{$target}\\\"\" : '') . ' href=\"http://$2\">' . ($replaceVisibleUrlWithText ? $replaceVisibleUrlWithText : '$2') . '</a>', $text);\r\n\t\tif ($addMailto) {$text = preg_replace ($delimiter . '([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})' . \"{$delimiter}i\", '<a href=\"mailto:$1\">$1</a>', $text);}\r\n\t\treturn $text;\r\n\t}", "public function htmlAnchor($controller, $link_name, $action_method = null, $param = null,$text=null) {\n if (is_null($param) && is_null($action_method)) {\n $href = \"{$controller}\";\n } else if (!is_null($action_method) && is_null($param)) {\n $href = \"{$controller}/{$action_method}\";\n } else {\n $href = \"{$controller}/{$action_method}/{$param}\";\n }\n\n return \"<a href=\\\"\" . DOMAIN_NAME . \"{$href}\\\">{$link_name}{$text}</a>\";\n }", "public function link($content, $href)\n {\n return (new Builder($this))\n ->tag('a')\n ->content($content)\n ->attribute('href', $href);\n }", "function permalink_anchor($mode = 'id')\n {\n }", "public function link($link,$title = null)\r\n {\r\n $title = $title ?? $link;\r\n return $this->element('a',$title)->attribute('href',$link);\r\n }", "function htmlLink($title, $url = null, $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true)\n\t{\n\t\t// This is slightly naughty: we are using a helper in a model when they are only meant for views.\n\t\t// HOWEVER: We need it to put links in validation errors, so don't feel too bad about it :)\n\t\tif(!isset($this->HtmlHelper)) $this->HtmlHelper = new HtmlHelper();\n\t\t\n\t\treturn $this->HtmlHelper->link($title, $url, $htmlAttributes, $confirmMessage, $escapeTitle);\n\t}", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "public function visitHyperlink(IdmlHyperlink $element, $depth = 0)\n {\n $element->attribs['class'] = $this->getCssClassname($element);\n $element->attribs['style'] = $this->getStyleAttrib($element);\n\n $this->verifyElementId($element);\n if (!empty($element->idAttribute))\n {\n $element->attribs['id'] = $element->idAttribute;\n }\n\n $element->attribs['href'] = $this->setHyperlinkHref($element);\n\n $strAttr = $this->getHTMLAttributesString($element, $element->attribs);\n $this->currHyperlink = '<a ' . $strAttr . '>';\n }", "function link_a($dir,$cont){\r\n return \"<a href=\\\"$dir\\\">$cont</a>\";\r\n }", "static function hyperlink($text)\n\t\t{\n\t\t\tif (strpos($text, '<img src=\"http://')===false && strpos($text, '<a href=\"http://')===false)\n\t\t\t{ \n\t\t\t\t$text = preg_replace(\"/([a-zA-Z]+:\\/\\/)([a-z][a-z0-9\\.\\_\\-]*[a-z]{2,6})([a-zA-Z0-9\\/\\*\\-\\?\\&\\%\\=\\#\\_\\;\\,\\(\\)\\.]*)/i\", \"<a href=\\\"$1$2$3\\\" target=\\\"_blank\\\" rel=\\\"nofollow\\\">$2</a> \", $text);\n\t\t\t}\n\t\t\treturn $text;\n\t\t}", "public function & append( $a_tag )\n\t{\n\t\tif($a_tag instanceof ZXmlTag)\n\t\t\t$this->m_document->appendChild($a_tag->node());\n\t\telse if($a_tag instanceof DOMNode)\n\t\t\t$this->m_document->appendChild($a_tag);\n\t\treturn $this;\n\t}", "function caNavLink($po_request, $ps_content, $ps_classname, $ps_module_path, $ps_controller, $ps_action, $pa_other_params=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caNavUrl($po_request, $ps_module_path, $ps_controller, $ps_action, $pa_other_params, $pa_options))) {\n\t\t\t//return \"<strong>Error: no url for navigation</strong>\";\n\t\t\t$vs_url = '/';\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='{$vs_url}' \";\n\t\t\n\t\tif ($ps_classname) { $pa_attributes['class'] = $ps_classname; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\t$vs_tag .= _caHTMLMakeAttributeString($pa_attributes);\n\t\t}\n\t\t\n\t\t$vs_tag .= \">{$ps_content}</a>\";\n\t\t\n\t\treturn $vs_tag;\n\t}", "function edit_tag_link($link = '', $before = '', $after = '', $tag = \\null)\n {\n }", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "function add_class_attachment_link( $html ) {\n\t$postid = get_the_ID();\n\t$html = str_replace( '<a','<a class=\"thumbnail\"',$html );\n\treturn $html;\n}", "function anchor_content_headings($content) {\n // now run the pattern and callback function on content\n // and process it through a function that replaces the title with an id \n $content = preg_replace_callback(\"/\\<h([1|2|3|4])\\>(.*?)\\<\\/h([1|2|3|4])\\>/\", function ($matches) {\n $hTag = $matches[1];\n $title = $matches[2];\n $slug = str_replace(\" \", \"-\", strtolower($title));\n return '<a href=\"#'. $slug .'\"><h'. $hTag .' id=\"' . $slug . '\">' . $title . '</h'. $hTag .'></a>';\n }, $content);\n return $content;\n }", "public function makeLinkButton() {}", "public function htmlAnchor($controller, $link_name, $action_method = null, $param = null) {\n if (is_null($param) && is_null($action_method)) {\n $href = \"{$controller}\";\n } else if (!is_null($action_method) && is_null($param)) {\n $href = \"{$controller}/{$action_method}\";\n } else {\n $href = \"{$controller}/{$action_method}/{$param}\";\n }\n\n return \"<a href=\\\"\" . DOMAIN_NAME . \"/{$href}\\\">{$link_name}</a>\";\n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "function substHREFsInHTML() {\n\t\tif (!is_array($this->theParts['html']['hrefs'])) return;\n\t\tforeach ($this->theParts['html']['hrefs'] as $urlId => $val) {\n\t\t\t\t// Form elements cannot use jumpurl!\n\t\t\tif ($this->jumperURL_prefix && ($val['tag'] != 'form') && ( !strstr( $val['ref'], 'mailto:' ))) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} elseif ( strstr( $val['ref'], 'mailto:' ) && $this->jumperURL_useMailto) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$substVal = $val['absRef'];\n\t\t\t}\n\t\t\t$this->theParts['html']['content'] = str_replace(\n\t\t\t\t$val['subst_str'],\n\t\t\t\t$val['quotes'] . $substVal . $val['quotes'],\n\t\t\t\t$this->theParts['html']['content']);\n\t\t}\n\t}", "protected function replaceAnchors($string)\n\t{\n\t\t// For closures\n\t\t$obj = $this;\n\n\t\t// Reference-style Links\n\t\t$string = preg_replace_callback('/\\[(.*?)\\] ?(?:\\n *)?\\[(.*?)\\]/s', function($match) use ($obj)\n\t\t{\n\t\t\t$refId = strtolower($match[2] ?: $match[1]);\n\t\t\t$text = $match[1];\n\n\t\t\tif (!$obj->hasReference($refId))\n\t\t\t{\n\t\t\t\treturn $match[0];\n\t\t\t}\n\n\t\t\t$reference = $obj->getReference($refId);\n\t\t\t$title = $reference['title'] ? ' title=\"'. $reference['title'] .'\"' : '';\n\n\t\t\treturn '<a href=\"'. $reference['url'] .'\"'. $title .'>'. $text .'</a>';\n\t\t}, $string);\n\n\t\t// Regular Links\n\t\t$string = preg_replace_callback('/\\[(.*?)\\]\\([ \\t]*<?(\\S+?)>?[ \\t]*(([\\'\"])(.*?)\\4[ \\t]*)?\\)/s', function($match)\n\t\t{\n\t\t\t$text = $match[1];\n\t\t\t$url = $match[2];\n\t\t\t$title = $match[5] ? ' title=\"'. $match[5] .'\"' : '';\n\n\t\t\treturn '<a href=\"'. $url .'\"'. $title .'>'. $text .'</a>';\n\t\t}, $string);\n\n\t\t// Auto Links\n\t\t// TODO: Obfuscate email addresses\n\t\t$string = preg_replace('/<((https?|ftp|mailto):[^\\'\">\\s]+)>/i', '<a href=\"$1\">$1</a>', $string);\n\n\t\treturn $string;\n\t}", "function hmenu_href($path, $link, $url)\n\t{\n\t\tif (strlen($url) && !lstring_search($url, \"*\")) return $url;\n\t\telse if (lstring_search($url, \"*\") && $url == \"*noslash\") return hanchor_shref($link, false);\n\t\telse return hanchor_href($path, $link);\n\t}", "public static function link_to(){\n echo call_user_func_array('Laika::link_to', func_get_args() );\n }", "function l($text, $url = '#', $htmlOptions = array()) \n{\n return CHtml::link($text, $url, $htmlOptions);\n}", "static public function linkTo($name, $url = null, $title = null,\n\t\t\t\t$classes = null, $id = null )\n {\n $class = (!empty($classes)) ? 'class=\"'.$classes.'\"' : null;\n \n if ( !empty($title) )\n $title = 'title=\"'.$title.'\"';\n\n if ( !empty($id) )\n $id = 'id=\"'.$id.'\"';\n \n return \"<a $title $class $id href=\\\"\".self::validURL($url).\"\\\">$name</a>\";\n }", "function hyperlink($text)\n{\n\t$text = ereg_replace(\"[a-zA-Z]+://([-]*[.]?[a-zA-Z0-9_/-?&%])*\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $text);\n\t$text = ereg_replace(\"(^| )(www([-]*[.]?[a-zA-Z0-9_/-?&%])*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n\treturn $text;\n}", "function makeLink($text, $link, $section = '', $title = '', $target = '')\n{\n\t// if there's nothing to link, don't link anything\n\tif(!$text)\n\t\treturn '';\n\n\t$ret = '<a href=\"';\n\n\tif($section != 'EXTERIOR')\n\t{\n\t\tif($section == '/')\n\t\t\t$ret .= ARC_WWW_PATH;\n\t\telse if($section)\n\t\t\t$ret .= ARC_WWW_PATH . $section . '/';\n\n\t\t$ret .= '?';\n\t}\n\n\tif($section != 'EXTERIOR' && isset($_GET['sqlprofile']) || isset($_POST['sqlprofile']))\n\t\t$link .= '&sqlprofile';\n\n\t$ret .= str_replace('&', '&amp;', $link) . '\"';\n\n\tif($title)\n\t\t$ret .= ' title=\"' . $title . '\"';\n\n\tif($target)\n\t\t$ret .= ' target=\"' . $target . '\"';\n\n\t$ret .= '>' . $text . '</a>';\n\n\treturn $ret;\n}", "public function testLinkWithAribtraryAttributes() {\n\t\t$this->_useMock();\n\n\t\t$options = array('id' => 'something', 'htmlAttributes' => array('arbitrary' => 'value', 'batman' => 'robin'));\n\t\t$result = $this->Js->link('test link', '/posts/view/1', $options);\n\t\t$expected = array(\n\t\t\t'a' => array('id' => $options['id'], 'href' => '/posts/view/1', 'arbitrary' => 'value',\n\t\t\t\t'batman' => 'robin'),\n\t\t\t'test link',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "function l($text, $url = '#', $htmlOptions = array())\n{\n return CHtml::link($text, $url, $htmlOptions);\n}", "function l($text, $url = '#', $htmlOptions = array())\n{\n return CHtml::link($text, $url, $htmlOptions);\n}", "public static function anchor($uri, $title = FALSE, $attributes = FALSE, $protocol = FALSE)\n\t{\n\t\tif ($uri === '')\n\t\t{\n\t\t\t$site_url = url::base(FALSE);\n\t\t}\n\t\telseif (strpos($uri, '://') === FALSE)\n\t\t{\n\t\t\t$site_url = url::site($uri, $protocol);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$site_url = $uri;\n\t\t}\n\n\t\treturn\n\t\t// Parsed URL\n\t\t'<a href=\"'.html::specialchars($site_url, FALSE).'\"'\n\t\t// Attributes empty? Use an empty string\n\t\t.(empty($attributes) ? '' : html::attributes($attributes)).'>'\n\t\t// Title empty? Use the parsed URL\n\t\t.(empty($title) ? $site_url : $title).'</a>';\n\t}" ]
[ "0.7048786", "0.6548224", "0.6483145", "0.6248656", "0.62374574", "0.61355644", "0.6080457", "0.60681975", "0.5975719", "0.58886385", "0.5886247", "0.5843463", "0.5804454", "0.5783415", "0.5773873", "0.57414365", "0.57133985", "0.5709507", "0.5705729", "0.5649693", "0.5619515", "0.5615243", "0.5613189", "0.5565561", "0.55654323", "0.55205333", "0.55088556", "0.55074364", "0.55019", "0.5501403", "0.5489103", "0.5454363", "0.54498476", "0.5430166", "0.54266906", "0.5422938", "0.5404948", "0.5387903", "0.53870577", "0.53783387", "0.53550786", "0.5342236", "0.5341165", "0.53266877", "0.5324461", "0.531758", "0.5313107", "0.53058094", "0.5303313", "0.5292362", "0.5274318", "0.52545214", "0.5252763", "0.52316403", "0.52242446", "0.52102166", "0.51936257", "0.5187367", "0.51816773", "0.5170421", "0.51694965", "0.5161501", "0.5155906", "0.513665", "0.51335114", "0.51301897", "0.51266253", "0.51181173", "0.51100916", "0.50923145", "0.50813943", "0.50791377", "0.50783074", "0.5071651", "0.5071612", "0.5070373", "0.5069973", "0.5068652", "0.5068008", "0.50635386", "0.50555885", "0.50536346", "0.5045174", "0.5043621", "0.50408953", "0.50396675", "0.503617", "0.5020425", "0.5012426", "0.5009911", "0.5008795", "0.5004717", "0.50037235", "0.5002024", "0.49985772", "0.49943176", "0.4990656", "0.49786633", "0.49769065", "0.49754944" ]
0.77676207
0
Returns an Identity object based on session_id() getIdentity() returns a base Scenario_Identity object with the identity string provided by session_id(). If the session is not yet started, it will throw an error, as when to start the session should be up to the developer.
public function getIdentity(array $params) { $id = session_id(); if ($id == "") { /** * @see Scenario_Exception */ require_once 'Scenario/Exception.php'; throw new Scenario_Exception('Unable to use session_id() as an identity string, are you missing a session_start()?'); } /** * @see Scenario_Identity */ require_once 'Scenario/Identity.php'; return new Scenario_Identity(session_id()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function GetSessionIdentity ();", "public function getSessionID();", "public static function getSessionid();", "public function get_session_id()\n {\n }", "protected function _getId ()\n {\n return session_id();\n }", "protected function getSessionId()\n {\n return \\Session::getId();\n }", "public function getSessionid()\n {\n return $this->sessionid;\n }", "public static function getId(){\n\t\treturn session_id();\n\t}", "public function getSessionID()\n {\n return $this->_session;\n }", "abstract function getSessionById($id);", "public function getSessionID(){\r\n\t\treturn $this->sessionID;\r\n\t}", "public function getIdentity ()\n\t{\n\t\treturn $this->session->get('user');\n\t}", "public function getSessionID()\n {\n return $this->sessionID;\n }", "public abstract function getIdentity();", "public function get($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\treturn $sess;\n\t}", "public function startSession($id){\n\n }", "public function getId(): string\n {\n return session_id();\n }", "public function getSessionId();", "public function getSessionId();", "public function getId() {\n\t\treturn session_id();\n\t}", "public function getSessionID() {\n return $this->sessionID;\n }", "public function getIdentity()\n {\n return $this->session->get('auth-identity');\n }", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "function get_id () {\n\t\treturn $this->session_id ?: false;\n\t}", "public function getId()\n {\n return $this->getValue('session_id');\n }", "public function getIdentity();", "public function getSessionId() {}", "public function getId()\n {\n $this->checkIfStarted();\n\n return $this->sessionId;\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return session_id();\n }", "public function startSession()\r\n {\r\n if (session_id() === '') {\r\n // Attempt to start a session\r\n session_start();\r\n\r\n $this->session_id = session_id() ?: false;\r\n }\r\n\r\n return $this->session_id;\r\n }", "public function getId(): string\n {\n return session()->getId();\n }", "public function getSessionID()\n {\n return $this->getKey('SessionID');\n }", "public function getSessionId()\n {\n return session_id();\n }", "public function getIdentity($identity_name=\"\")\n {\n \t$identity = $this->session->get('auth-i');\n \tif ($identity_name==\"\") {\n return $identity;\n\t\t} else {\n\t\t\tif (isset($identity[$identity_name])) {\n\t\t\t\treturn $identity[$identity_name];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n }", "public function getUserIdFromSessionId($session_id);", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "public function getId()\n {\n return $this->_session->getId();\n }", "public function getId() {\n return $this->sessionId;\n }", "function getSessionId() {\n\t\treturn $this->session_id;\n\t}", "public static function id($id = null){\n\t\t\tif(!empty($id)){\n\t\t\t\tSession::$id = $id;\n\t\t\t\tsession_id($id);\n\t\t\t}\n\t\t\tif($this->session_started()){\n\t\t\t\treturn session_id();\n\t\t\t}else{\n\t\t\t\treturn Session::$id;\n\t\t\t}\n\t\t}", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\n }", "public static function start() {\t\t\t\n\t\t\t// get session id\n $sessionid = Functions::encrypt_decrypt('encrypt', \"Bengalathon\");\n \n //set session name\n\t\t\tini_set('session.name', $sessionid.'_SESID');\n \t\t\t\n //set session name\n\t\t\tini_set('session.name', base64_encode(BASE_PATH).'_SESID');\n \n //set session path\n\t\t\tini_set('session.cookie_path', \"/\");\n\t\t\t \t\t\t\n //set session domain\n ini_set('session.cookie_domain', $_SERVER['HTTP_HOST']);\n \n //set session httponly\n ini_set('session.cookie_httponly', true);\n \n //set session secure https\n ini_set('session.cookie_secure', false);\n \n\t\t\t// start the session\n\t\t\t@session_start();\t\t\n\t\t\t\n\t\t\t// get session token\n\t\t\t$token = self::get('token');\n\t\t\t\n\t\t\t// set session token\n\t\t\tif (empty($token)) {\n\t\t\t\tif (function_exists('mcrypt_create_iv')) {\n\t\t\t\t\tself::set('token', bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)));\n\t\t\t\t} else {\n\t\t\t\t\tself::set('token', bin2hex(openssl_random_pseudo_bytes(32)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// return session id\t\t\t\n\t\t\treturn session_id();\n\t\t}", "public function getSession()\r\n {\r\n return $this->sessionID;\r\n }", "public function startSession()\r\n {\r\n $result = self::makeCall('startSession', array(), 'sessionID', true);\r\n if (empty($result)) {\r\n return $result;\r\n }\r\n $this->sessionID = $result;\r\n return $result;\r\n }", "function sess_id()\n {\n return session_id();\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getId(): ?string\n {\n return $this->isStarted() ? session_id() : null;\n }", "public function getSessionId()\r\n\t{\r\n\t\treturn $this->session;\r\n\t}", "public function getSessionId()\n {\n\t\tif($this->session_id != null){\n\t\t\treturn $this->session_id;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n }", "public static function getSessionId(){\n return self::$sessionId;\n }", "public function createSessionId() {}", "public static function SetSessionIdentity (\\MvcCore\\ISession $sessionIdentity);", "public static function getSessionId() {\n\t\tif(empty($id = session_id())) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $id;\n\t\t\n\t}", "public static function getIdFromSession()\n\t{\n\n\t\treturn $_SESSION[User::SESSION]['iduser'];\t\t\n\n\t}", "public function getIdentityxxxx()\n {\n $this->_userId = $this->getSession()->getValue('user_id', ANONYMOUS);\n\n if ($this->_userId === ANONYMOUS) {\n $this->getSession()->setValue('user_is_logged', FALSE);\n }\n\n return $this->_resource = $this->loadUserDataFromModel($this->_userId);\n }", "function get_id ()\r\n {\r\n return $_SESSION[\"id\"];\r\n }", "public function id(string $newId = null) : string | false\n {\n if ($newId !== null && $this->isActive()) {\n throw new LogicException(\n 'Session ID cannot be changed when a session is active'\n );\n }\n return \\session_id($newId);\n }", "public static function getCurrentID() {\n return Session::get(Privilege::SESSION_NAME_ID);\n }", "public function getSessionId()\n {\n return $this->sessionId;\n }", "public function getCustomerSessionID(){\r\n\t\treturn $this->customerSessionID;\r\n\t}", "public function getSessionID() {\n if(isset($this->data['booking']['session']['id'])) {\n return $this->data['booking']['session']['id'];\n }\n return null;\n\n }", "private static function getFromSession()\n {\n if (empty($_SESSION['current_user'])) {\n // No user in session, create one.\n $entityClassName = static::ENTITIES_CLASS_NAME;\n $user = new $entityClassName(array(\n 'source' => 'cookie',\n ));\n self::setCurrent($user);\n } else {\n Logger::get()->debug('Found user in session.');\n // Regenerate session ID every SESSION_DURATION minutes.\n if (time() > ($_SESSION['timestamp'] + + self::SESSION_DURATION)) {\n Logger::get()->debug('Regenerated session ID.');\n session_regenerate_id();\n }\n }\n\n return $_SESSION['current_user'];\n }", "public function getSessionId()\n {\n $sessionId = $this->getSession();\n\n return $sessionId;\n }", "static function generateSessionID($userid, $start_time) {\n\t\t$new_session_id = md5 ( $userid . $_SERVER ['HTTP_USER_AGENT'] . self::$salt . $_SERVER ['REMOTE_ADDR'] . $start_time );\n\t\treturn $new_session_id;\n\t}", "public function get_identity()\n {\n return $this->identity;\n }", "public function getSessionId(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_SESSION_ID);\n }", "public function load($id)\n {\n return $this->session;\n }", "public static function getId() {\n return (int)$_SESSION['user']['id'];\n }", "protected function getSessionId()\n {\n $id = $this->di->session->get('requestRecorderId');\n\n if ($id == null) {\n $id = time();\n $this->di->session->set('requestRecorderId', $id); // Figure out something better than time()\n }\n\n return $id;\n }", "public function getIdentity() {\n return $this->identity;\n }", "public function getSession()\n {\n return $this->hasOne(Session::className(), ['id' => 'SessionId']);\n }", "public function getSessionId() {\r\n return $this->sessionId;\r\n }", "public function startImpersonating(int $id, Session $session)\n {\n $session->put('impersonate', $id);\n }", "public function id(string $id = null)\n {\n if ($id === null) {\n return $this->session->id();\n }\n\n if (! $this->session->started()) {\n $this->session->id($id);\n }\n }", "function payswarm_get_session($identity_id = null, $return_expired = false) {\n global $_COOKIE;\n $session = false;\n\n // check to see if the payswarm-session cookie exists\n if(array_key_exists('payswarm-session', $_COOKIE)) {\n $session_id = $_COOKIE['payswarm-session'];\n $session = get_transient('ps_sess_' . $session_id);\n if($session !== false) {\n // ensure client IP address and identity ID match\n $ip = $_SERVER['REMOTE_ADDR'];\n if($session['ip'] !== $ip ||\n ($identity_id !== $session['identity_id'] &&\n $identity_id !== null)) {\n $session = false;\n } else {\n // check expiration\n $now = time();\n $expires = isset($session['expires']) ? $session['expires'] : $now;\n if($expires <= $now) {\n $session = $return_expired ? $expires : false;\n }\n }\n }\n\n if($session === false || is_numeric($session)) {\n // invalid session, clear cookie only (not server session)\n payswarm_clear_session_cookie();\n }\n }\n\n return $session;\n}", "public function getSession() \r\n\t{\t\t\t\r\n\t\t$this->url = $this->server . \"/X?op=login_request\" .\r\n\t\t\t\"&user_name=\" . $this->username .\r\n\t\t\t\"&user_password=\" . $this->password;\r\n\r\n\t\t// get login_response from Metalib\r\n\r\n\t\t$this->xml = $this->getResponse($this->url, $this->timeout);\r\n\t\t\r\n\t\t// extract session ID\r\n\t\t\r\n\t\t$objSession = $this->xml->getElementsByTagName(\"session_id\")->item(0);\r\n\t\treturn $objSession->nodeValue;\r\n\t}", "public function getSessionId(): string\n {\n return $this->sessionId;\n }", "public function identity()\r\n {\r\n\t\t$storage = $this->get_storage();\r\n\r\n if ($storage->is_empty()) {\r\n return null;\r\n }\r\n if( is_null(self::$login_user) ){\r\n $u = $storage->read();\r\n\t\t\tself::$login_user = Model_User::instance()->user($u['uid']);\r\n \r\n global $VIEW_AUTH_USERID;\r\n $VIEW_AUTH_USERID = idtourl(self::$login_user['uid']);\r\n }\r\n return self::$login_user; \r\n }", "public function getIdentity() {\n return $this->authenticate()->getIdentity();\n }", "public function sessionId()\n {\n return $this->sessionId;\n }", "protected function _getIdentity($id) {\r\n \tif ($this->_hasIdentity($id)) {\r\n \t\treturn $this->_identityMap[$id];\r\n \t}\r\n }", "function payswarm_create_session($identity_id = null) {\n global $_COOKIE;\n\n // expiration interval\n $timeout = PAYSWARM_SESSION_TIMEOUT;\n\n // try to get existing session\n $session = payswarm_get_session($identity_id);\n $now = time();\n\n // no session exists, create a new one\n if($session === false) {\n // session ID length must be <= 32 to use transient API below\n $now = time();\n $random_value = mt_rand(0, 100000);\n $session = array(\n 'id' => md5(\"$now$random_value\"),\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'identity_id' => $identity_id,\n 'expires' => $now + $timeout,\n 'last_update' => 0);\n }\n\n // only update cookie if a minute has passed since last_update to\n // throttle writes (timeout is 0 for new sessions, so will always write)\n if($now - 60 > $session['last_update']) {\n // update session, auto-clear from DB in 24 hours\n // 24 hours allows time to show \"You've been signed out\" warning\n $expires = $now + $timeout;\n $session['expires'] = $expires;\n $session['last_update'] = $now;\n set_transient('ps_sess_' . $session['id'], $session, $timeout + 24*3600);\n\n // update cookie (client cookie is browser-session based)\n global $_SERVER;\n setcookie('payswarm-session', $session['id'], 0, '/');\n }\n\n return $session;\n}", "public function getIdentity()\n {\n return $this->identity;\n }", "public function getIdentity()\n {\n return $this->identity;\n }", "public function testExistingIdentityCrossSession() {\n\n $sessionFactory = $this->getSampleProjectSessionFactory(true);\n \n $session1 = $sessionFactory->openSession();\n $session2 = $sessionFactory->openSession();\n $session3 = $sessionFactory->openSession();\n \n $bug = $session1->find('sample_Bug')->filterBy('bugId', 521152)->one();\n $project = $session2->find('sample_Project')->filterBy('projectId', 12345)->one();\n $user = $session3->find('sample_User')->filterBy('userId', '55566')->one();\n\n $this->assertTrue($bug->owner !== $project->manager);\n $this->assertTrue($user !== $bug->owner);\n $this->assertTrue($user !== $project->manager);\n \n $sessionFactory2 = $this->getSampleProjectSessionFactory(false);\n $sessionFactory3 = $this->getSampleProjectSessionFactory(false);\n \n $bug = $sessionFactory2->currentSession()->find('sample_Bug')->filterBy('bugId', 521152)->one();\n $user = $sessionFactory3->currentSession()->find('sample_User')->filterBy('userId', '55566')->one();\n $this->assertTrue($user !== $bug->owner);\n \n }", "public function getSessionIdFromCookie();", "public function getId()\n {\n if (!$this->hasIdentity()) {\n $id = 0;\n } else {\n $id = (int)$this->modelSession['id'];\n }\n\n return $id;\n }", "abstract protected function getSession();", "public function getIdentity()\n {\n return $this->_auth->getIdentity();\n }", "public function id(array $headers, ?string $sessionIdentity): UserIdentity\n {\n $id = new UserIdentity(\n $this->getHeader($headers, 'accept'),\n $this->getHeader($headers, 'accept-encoding'),\n $this->getHeader($headers, 'accept-language'),\n $this->getHeader($headers, 'user-agent'),\n $this->getHeader($headers, 'x-forwarded-for')\n );\n\n $this->logger->debug(\n 'Identity of incoming request is {identity}',\n [\n 'identity' => $id,\n 'data' => $id->data,\n ]\n );\n\n // if the identity in the session does not match the identity we just calculated something about this\n // request is probably nefarious, log it.\n if ($sessionIdentity !== null && $sessionIdentity !== $id->hash()) {\n $this->logger->notice(\n 'Identity of incoming request is different to session stored identity',\n [\n 'event_code' => EventCodes::IDENTITY_HASH_CHANGE,\n 'stored_identity' => $sessionIdentity,\n 'calculated_identity' => $id,\n 'data' => $id->data,\n ]\n );\n }\n\n return $id;\n }", "private function readSessionId() {\r\n \r\n if ($this->use_cookie==true) { //cookie enabled\r\n \r\n if (isset($_COOKIE[$this->sid_name])) { //there some jam in the cookie\r\n\r\n $this->sessionId=$_COOKIE[$this->sid_name];\r\n //check if the jam can be eated\r\n if ($this->checkSessionId()) {\r\n\r\n\r\n $num = $this->getSidCount($this->sessionId);\r\n if ($num != 1) {\r\n //there is a sessiod in the cookie and no sessid in the DB\r\n //the only thing to do is to generate a new Sid\r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n\r\n } else {\r\n //ok the jam is good!\r\n if (!$this->overwrite) {\r\n setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true); \r\n }\r\n $this->loadSesionVars();\r\n }\r\n \r\n } else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before .. \r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { \r\n\r\n //Damn, no id ... i create some jam!\r\n \r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n \r\n\r\n }\r\n\r\n } else { //no cookie allowed.. bad thing! search elsewhere\r\n\r\n if (isset($_REQUEST[$this->sid_name])) {//bingo!\r\n\r\n $this->sessionId = $_REQUEST[$this->sid_name];\r\n if ($this->checkSessionId()) {\r\n $this->loadSesionVars();\r\n }else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before ..\r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { // create a new SID\r\n\r\n if (!$this->newSid()) die(\"Unable to save session\");\r\n\r\n }\r\n\r\n }\r\n }", "public static function get_id() {\n self::$_id = $_SESSION['id'];\n return self::$_id;\n }", "public function getIdentity(): ?IdentityInterface;", "public function getIdentity()\n {\n return $this->_identity;\n }", "public function getID()\n {\n // this only works for web users!\n return $this->session->userdata('ID');\n }" ]
[ "0.729675", "0.6675893", "0.65923226", "0.6418689", "0.63862914", "0.6324631", "0.63078356", "0.62673134", "0.62353605", "0.62349796", "0.6232178", "0.62279487", "0.62115616", "0.6198297", "0.61880475", "0.6180125", "0.6169896", "0.6162204", "0.6162204", "0.615711", "0.61369383", "0.6131677", "0.60899824", "0.6077583", "0.60692894", "0.60370135", "0.6031871", "0.5998894", "0.5991374", "0.5985018", "0.5983415", "0.5965779", "0.5959164", "0.5935356", "0.5932297", "0.5921976", "0.59213704", "0.5898991", "0.58856857", "0.58745885", "0.58491015", "0.584853", "0.5835078", "0.5806591", "0.58053726", "0.576682", "0.5766217", "0.5766217", "0.5766217", "0.5766217", "0.5766217", "0.5763037", "0.57421327", "0.5735866", "0.5730605", "0.5713294", "0.56817144", "0.56815714", "0.5674493", "0.56656027", "0.56555647", "0.56461746", "0.5628201", "0.5613721", "0.56114393", "0.55972594", "0.55959684", "0.5589995", "0.5577181", "0.5574352", "0.55647564", "0.55601865", "0.55594814", "0.5557154", "0.55459803", "0.55428505", "0.55375963", "0.5532627", "0.5528317", "0.5523952", "0.5509539", "0.5504464", "0.55006164", "0.5500512", "0.5486735", "0.5486645", "0.5482125", "0.54813015", "0.54813015", "0.5471887", "0.5471291", "0.5464765", "0.54612523", "0.5458504", "0.5455305", "0.5452899", "0.54506785", "0.5432886", "0.54282874", "0.5426288" ]
0.7623249
0
Add an item to the cart
public function add($product, $quantity) { $this->loadItems(); if (isset($this->items[$product->{$this->params['productFieldId']}])) { $this->plus($product->{$this->params['productFieldId']}, $quantity); } else { $this->items[$product->{$this->params['productFieldId']}] = new CartItem($product, $quantity, $this->params); ksort($this->items, SORT_NUMERIC); $this->saveItems(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addItem(Cart $cart, CartItem $item);", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function addItemToCart($account_id, $item_id, $quantity = false);", "public function addItemToCart( $item ){\n $this->cartItems[] = $item;\n Cart::updateTotalPrice();\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function addItem($id){\n \t$product = Product::findOrFail($id);\n \tCart::add($id, $product->product_name, 1, $product->product_price, 550, ['img'=>$product->image, \"stock\" => $product->stock]);\n \treturn back();\n }", "public function add($id)\n {\n \tif(empty($this->items))\n \t{\n \t\t$item = new ShoppingItem($id,1);\n\t\t\t$this->session->push(self::SHOPPINGCART, $item);\n\t\t\t$this->items[] = $item;\n \t}else\n \t{\n \n \t\tif($this->getItem($id))\n \t\t{\n \t\t\t$item = $this->getItem($id);\n \t\t\t$item->quantity += 1;\n \t\t}\n else\n {\n \t\t$item = new ShoppingItem($id,1);\n \t\t$this->session->push(self::SHOPPINGCART,$item);\n \t\t$this->items[] = $item;\n }\n \t} \n \t\n }", "public function addAction()\n {\n /** @var $session */\n $session = $this->get('session');\n\n $cart = $session->get('cart');\n\n $productID = $_POST['product_id'];\n $quantity = $_POST['quantity'];\n\n // First addition to the shopping cart\n if (empty($cart)) {\n $cart[] = array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n } else {\n $existingItem = false;\n\n foreach ($cart as &$cartItem) {\n // If product already exists in cart\n if ($cartItem['product_id'] == $productID) {\n $existingItem= true;\n\n // add to existing quantity\n $cartItem['quantity'] += $quantity;\n }\n }\n\n // if brand new item\n if ($existingItem == false) {\n $cart[]= array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n }\n }\n\n $session->set('cart', $cart);\n\n\n return new RedirectResponse('/cart');\n }", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "public function add_item_cart($item){\r\n\t\t$cart_data = $this->main->connector->get_session('lumise_cart');\r\n\t\tif($cart_data == null)\r\n\t\t\t$cart_data['items'] = array();\r\n\t\t\t\r\n\t\t$cart_data['items'][$item['cart_id']] = $item;\r\n\t\t$this->main->connector->set_session('lumise_cart', $cart_data);\r\n\t}", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "public function actionAddToCart()\n {\n (LoginController::class)::checkLogin();\n $id = App::call()->request->getParams()['id'];\n $cart = (new Sessions())->get('cart');\n if ($id) {\n if (!$cart || !in_array($id, $cart)) {\n (new Sessions())->add('cart', $id);\n $message = 'Item is added!';\n } else {\n $message = 'Item is already in cart!';\n }\n }\n echo $message;\n }", "public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }", "public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }", "public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }", "public function addItem(string $sku, int $qty): Cart;", "public function add() {\n $page = 'basket';\n $id = $_GET['id'];\n\n $product = $this->productManager->findOne($id);\n\n $productInBasket = $this->inBasket($id); //check if the product is in the basket\n\n if(!empty($product) && isset($_SESSION['user']['basket'])) {\n if ($productInBasket)\n $_SESSION['user']['basket'][$id]['quantity']++;\n else\n $_SESSION['user']['basket'][$id] = array(\"product\" => $product, \"quantity\" => 1);\n }\n\n header(\"Location: ./index.php?ctrl=basket&action=consult\");\n require('./View/default.php');\n }", "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }", "public function addSimpleItem($item){\t\t\r\n if( //Check the quantity and the name\r\n !empty($item['quantity']) \r\n && is_numeric($item['quantity']) \r\n && $item['quantity']>0 \r\n && !empty($item['name'])\r\n ){ //And add the item to the cart if it is correct\r\n $items = $this->items;\r\n $items[] = $item;\r\n $this->items = $items;\r\n }\r\n }", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "public function addToCart($userid, $itemid){\n if(isset($userid)&&isset($itemid)){\n $params=array(\n \"user_id\"=>$userid,\n \"item_id\"=>$itemid\n );\n\n //insert data into Cart\n $result=$this->insertIntoCart($params);\n if($result){\n //reload page\n header(\"Location:\".$_SERVER['PHP_SELF']);\n }\n }\n }", "function addToCart($id, $name, $supplier, $price, $amount) {\n foreach ($_SESSION['cart'] as $key => $prod) {\n if ($prod['id'] == $id) { // If item is already in cart add selected amount to cart\n $_SESSION['cart'][$key]['amount'] = $_SESSION['cart'][$key]['amount'] + $amount;\n return getCart();\n }\n }\n // If the cart doesn't have the selected item, add it to the cart\n array_push($_SESSION['cart'], [\"id\"=>$id, \"name\"=>$name, \"supplier\"=>$supplier, \"price\"=>$price, \"amount\"=>$amount]);\n return getCart();\n }", "abstract public function add_item();", "public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }", "public function add_item($item_id)\n\t{\n\t\tif(!isset($this->cart[$item_id]))\n\t\t{\n\t\t\t$this->cart[$item_id] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->cart[$item_id]++;\n\t\t}\n\t\tSession::set('cart', $this->cart);\n\t\treturn true;\n\t}", "private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }", "public function add($item);", "public function add($item);", "function add_item( $params ) {\n\t\textract( $params );\n\n\t\tif( empty( $cart_id ) )\n\t\t\treturn false;\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, sales_price WRITE, stock WRITE\" );\n\n\t\t// In case of quote, no need to look up price in sales_price table, it's already provided\n\n\t\t// There are 3 sort of prices: customer price group, customer price, bodyshop. In cart the first 2 are taken into account.\n\t\t// The latter is to indicate to bodyshop what would be the price when reselling the item. Bodyshop prices are known by\n\t\t// customer_group CHOUT, customer override is by the user_no else customer group.\n\t\tif( !empty( $price ) )\n\t\t\t$prices = array( 'price' => $price, 'charge_out' => 0 );\n\t\telse {\n\t\t\t// Retrieve the unit price of the product based on the user and customer group\n\t\t\t$res = $this->db->query( \"SELECT GROUP_CONCAT(CONCAT(customer_group,';',price) SEPARATOR '|')price FROM sales_price WHERE sku='\".$item_id.\"' AND (customer_group='\".$user_no.\"' OR customer_group IN ('\".$customer_group.\"') OR ('\".$user_no.\"' LIKE '1%' AND customer_group='CHOUT'))\" )->row_array();\n\n\t\t\t$prices = misc::get_available_prices( $res[ 'price' ], $user_no, $vat );\n\t\t}\n\n\t\t$quote_no = empty( $quote_no ) ? '' : $quote_no;\n\t\t// Apply the changes against the database\n\t\t$qry = \"INSERT INTO cart_items SET cart_id='\".$cart_id.\"', sku='\".$item_id.\"', user='\".$user_no.\"', qty='\".$qty.\"', pu=\".$prices[ 'price' ].\", ebay_shipping='\".$ebay_shipping.\"', creation_date=DATE_FORMAT(NOW(),'%Y%m%d'), quote_no='\".$quote_no.\"' ON DUPLICATE KEY UPDATE qty=qty+'\".$qty.\"', ebay_shipping='\".$ebay_shipping.\"'\";\n\n\t\t$this->db->query( $qry );\n\t\n\t\t// Update the qty of the stock\n\t\t// It's only executed when the order is not created from a quote\n\t\tif( $quote_no == '' )\n\t\t\t$this->db->query( \"UPDATE stock SET qty=qty-\".$qty.\" WHERE sku='\".$item_id.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\n\t\treturn $prices;\n\t}", "public function addCart($cart){\n $this->cart_id = $cart; \n }", "public function add($item, $id){\n $storedItem = ['qty' => 0,\n 'price'=>$item->price,\n 'item' => $item]; //servirá para os grupos, para nao tar a adicionar 2 da mesma coisa\n\n if($this->items){ //verificar se ja ha items no array\n if (array_key_exists($id, $this->items)){ //verificar se ja existe o item que eu quero adicionar\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['price'] = $item->price * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->price;\n\n }", "public function add($request)\n {\n\n \\Cart::add(array(\n 'id' => $request->id,\n 'name' => $request->name,\n 'price' => $request->price,\n 'quantity' => $request->quantity,\n 'attributes' => array(\n 'image' => $request->img,\n 'slug' => $request->slug\n )\n ));\n\n return redirect()->route('cart.index')->with('success_msg', 'Item is Added to Cart!');\n\n }", "public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }", "public function add_to_cart() {\n if ( ! is_single() ) {\n return;\n }\n\n global $product;\n\n WC_Gokeep_JS::get_instance()->add_to_cart( $product , '.single_add_to_cart_button' );\n }", "public function addToCart($userid, $itemid){\n if (isset($userid) && isset($itemid)){\n $params = array(\n \"userID\"=>$userid,\n \"itemID\"=>$itemid\n );\n\n //insert data into cart\n $result = $this->insertIntoCart($params);\n if ($result){\n // reload page\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n }\n }", "function addToCart($proID){\n $product = $this->product->getRows($proID);\n \n // Add product to the cart\n $data = array(\n 'id' => $product['pro_id'],\n 'qty' => 1,\n 'price' => $product['price'],\n 'name' => $product[\"name\"],\n 'image' => $product['image']\n );\n $this->cart->insert($data);\n \n // Redirect to the cart page\n redirect(base_url().'index.php/CCart');\n }", "public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }", "function addItemsToCart()\n\t{\n\t\t$order = $_POST['order'];\n\t\tsession_start();\n\t\tif(isset($_SESSION['userName']))\n\t\t{\n\t\t\t$result = addItemsToCartDB($_SESSION['userName'], $order);\n\t\t\tif($result['status'] == 'COMPLETE')\n\t\t\t{\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n # Something went wrong\n\t\t\t\tdie(json_encode($result));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode(errors(417)));\n\t\t}\n\t}", "public function addToCart()\n {\n $inputs = request()->all();\n\n try\n {\n $items = $this->userRepo->addToUserCart(auth()->user(), $inputs, session('area_id'));\n }\n catch(AddToCartException $e)\n {\n return $this->respondWithErrors($e->getMessage());\n }\n\n return $this->respondWithSuccess([\n 'items' => $items\n ]);\n }", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function addToCart ( \\Maven\\Core\\Domain\\OrderItem $item ) {\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/addToCart' );\n\n // Check if it already exists in session\n $order = $this->getOrder();\n\n // If we don't have an order yet, lets create a new one\n if ( !$this->orderExists() ) {\n $this->newOrder();\n }\n\n // Ensure that we are adding an item with quantity\n if ( ( int ) $item->getQuantity() <= 0 ) {\n return Message\\MessageManager::createErrorMessage( 'Item quantity must be greater than 0' );\n }\n\n\n $orderApi = new OrdersApi();\n\n $this->order = $orderApi->addItem( $this->order, $item );\n\n $this->update();\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item added sucessfully', $this->order );\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "public function addItemToCart($id)\n {\n\n //$this->db->query(\"insert into koszyk (id_produktu, id_klienta, ilosc)\");\n\n return $this->getProductById($id);\n }", "function addToCart($id, $format, $finition, $cadre, $prix) {\n $item = [\n 'id' => $id,\n 'format' => $format,\n 'finition' => $finition,\n 'cadre' => $cadre,\n 'prix' => $prix,\n 'quantity' => 1,\n ];\n\n $_SESSION['cart'][] = $item;\n}", "function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('id_menu'), \n\t\t\t'name' => $this->input->post('nama_menu'), \n\t\t\t'price' => $this->input->post('harga'), \n\t\t\t'qty' => $this->input->post('quantity'), \n\t\t);\n\t\t$this->cart->insert($data);\n\t\techo $this->show_cart(); //tampilkan cart setelah added\n\t}", "public function addToCart(Request $request, $menu_item_id)\n {\n $group_ids = array_keys($request->addons ?? []);\n\n /** The addon IDs are contained within arrays under each group id. Flatten them out into a single array */\n $addon_ids = collect($request->addons ?? [])->flatten();\n\n $shopping_item = new ShoppingCartItem($menu_item_id, $group_ids, $addon_ids);\n\n Session::push('cart', $shopping_item);\n\n return redirect()->back();\n }", "public function add(){\n //item data\n $data = array(\n 'id' => $this->input->post('item_number'),\n 'qty' => $this->input->post('qty'),\n 'price' => $this->input->post('price'),\n 'name' => $this->input->post('title')\n );\n\n //insert Cart\n $this->cart->insert($data);\n\n redirect('products');\n}", "function add($product_id)\n\t{\n\t\t$product = $this->database->getProductbyId($product_id);\n\n\t\tif($product)\n\t\t{\n\t\t\t$this->_add_to_cart($product);\n\t\t}\n\t\t\n\t\t$this->_show_add_to_cart_comment($product['add_to_cart_comment']);\n\t\t\n\t\tredirect('cart');\n\t}", "public static function add($product)\n {\n session()->push('cart', $product);\n }", "function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('produk_id'), \n\t\t\t'name' => $this->input->post('produk_nama'), \n\t\t\t'price' => $this->input->post('produk_harga'), \n\t\t\t'qty' => $this->input->post('quantity'), \n\t\t);\n\t\t$this->cart->insert($data);\n echo $this->show_cart(); //tampilkan cart setelah added\n }", "public function actionAddtocart($id,$price,$name, $quantity)\n {\n $session = Yii::$app->session;\n //$session->remove('cart');\n if($session->has('cart')) //if the session is there, we need to add to it\n {\n //t\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n\n\n }\n else //if the session is not there, we need to create it\n {\n\n $session['cart'] = array();\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n }\n //go to the users' cart page\n $this->redirect(['cart/index']);\n }", "function addToCart($itemName, $itemPrice)\n {\n $temp_array = ['name' => $itemName, 'price' => $itemPrice, 'quantity' => 1, 'total' => $itemPrice];\n array_push($_SESSION['cart'], $temp_array);\n }", "public function addToCart($prod_id){\n\t\t$product = Product::find($prod_id);\n $this->cartConstruct();\n $this->add($product);\n Session::put('cart',$this);\n return redirect()->route('cart');\n\t}", "public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }", "public function add($item) {\n $this->items[$item->id()] = $item;\n }", "function insertItem(){\n\t\t$cartDB = new DB();\n\n\t\tif(!empty($_GET[\"cartItem\"])) {\n\t\t\t$cartItem = $this->getItemFromProducts($_GET[\"cartItem\"]);\n\t\t\t$this->insertCart($cartItem[0][\"id\"],$cartItem[0][\"itemName\"],$cartItem[0][\"itemDesc\"], 1, $cartItem[0][\"regularPrice\"]);\n\t\t\t$numberOf = $cartItem[0][\"numberLeft\"];\n\t\t\t$numberOf --;\n\t\t\t$this->updateNumberOf($numberOf);\n\t\t}\t\t\n\t}", "function addToCart()\n{\n\t// make sure the product id is in get, redirect otherwise.\n\tif (isset($_GET['p']) && (int)$_GET['p'] > 0) {\n\t\t$productID = (int)$_GET['p'];\n\t} else {\n\t\theader('Location: ./storeIndex.php');\n\t}\n\t\n\t// check if the product is in the database.\n\t$sql = \"SELECT ItemID, Quantity\n\t FROM Items\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) != 1) {\n\t\t// the product doesn't exist\n\t\theader('Location: ./cart.php');\n\t} else {\n\t\t//Check stock\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$currentStock = $row['Quantity'];\n\n\t\tif ($currentStock == 0) {\n\t\t\t// Out of stock item, show error.\n\t\t\tsetError('The product you requested is no longer in stock');\n\t\t\theader('Location: ./cart.php');\n\t\t\texit;\n\t\t}\n\n\t}\t\t\n\t\n\t//Check if items is already in cart, and if so, update quantity.\n\t$sql = \"SELECT ItemID\n\t FROM Cart\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t// put the product in the cart \n\t\t$sql = \"INSERT INTO Cart (ItemID, Quantity)\n\t\t\t\tVALUES ($productID, 1)\";\n\t\t$result = query($sql);\n\t} else {\n\t\t// update product quantity in the cart\n\t\t$sql = \"UPDATE Cart\n\t\t SET Quantity = Quantity + 1\n\t\t\t\tWHERE ItemID = $productID\";\t\t\n\t\t\t\t\n\t\t$result = query($sql);\t\t\n\t}\t\n\t\t\n\theader('Location: ' . $_SESSION['shop_return_url']);\t\t\t\t\n}", "public function addItemToCart(array $data)\n {\n $item = new Item($data);\n\n $item->user_id = auth()->user()->id;\n $item->household_id = $this->id;\n\n return $item->save();\n }", "public function addItemToCartAction(Request $request)\r\n {\r\n $productId = $request->get('productId');\r\n $unitId = $request->get('unitId');\r\n $sellerId = $request->get('sellerId');\r\n $quantity = $request->get('quantity', 1);\r\n $itemId = $request->get('itemId', 0);\r\n $mode = $request->get('mode', 'cart');\r\n\r\n $tbProductUnit = $this->getDoctrine()->getRepository('YilinkerCoreBundle:ProductUnit');\r\n $unit = $tbProductUnit->findOneBy(array(\r\n 'productUnitId' => $unitId,\r\n 'product' => $productId\r\n ));\r\n\r\n if (!$unit) {\r\n throw new \\Exception('Product Unit does not exist.');\r\n }\r\n\r\n $cart = array();\r\n if ($mode == 'cart') {\r\n $this->cartService->updateCart($productId, $unitId, $quantity, $itemId, $sellerId);\r\n $cart = $this->cartService->getCart();\r\n $html = $this->renderView('YilinkerFrontendBundle:Base:cart.html.twig', compact('cart'));\r\n }\r\n else {\r\n $this->cartService->updateWishlist($productId, $unitId, $quantity, $itemId, $sellerId);\r\n $cart = $this->cartService->getWishlist();\r\n $html = $this->renderView('YilinkerFrontendBundle:Base:wishlist.html.twig', array('wishlist' => $cart));\r\n }\r\n \r\n return new JsonResponse(compact(\r\n 'mode',\r\n 'cart',\r\n 'html'\r\n ));\r\n }", "public function add(Request $request, $id)\n {\n if (Auth::user()) {\n $input = $request->all();\n $item = Product::findOrFail($id);\n $cart = Cart::create([\n 'user_id' => Auth::user()->id,\n 'product_id' => $item->id,\n 'price' => $item->price,\n 'discount' => $item->discount,\n 'quantity' => $input['quantity'],\n 'totalPrice' => ($item->price - $item->price * $item->discount / 100) * $input['quantity']\n ]);\n return view('frontend.message');\n } else {\n return redirect('/login');\n }\n }", "public function addItemToCart( $map) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_CART)->where($params);\r\n\t \t$query = $this->db->get();\r\n\t \t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_CART,$map);\r\n\t\t\t}else {\r\n\t\t\t\t$this->increaseItemQuantity( $map );\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "function add($item);", "public function add()\n {\n if (Request::isMethod('post')) {\n\n $product_id = Request::get('id');\n $product = Product::find($product_id);\n Cart::add(\n [\n 'id' => $product_id,\n 'name' => $product->name,\n 'image' => $product->image,\n 'qty' => 1,\n 'price' => $product->price\n ]\n );\n }\n return redirect('/products');\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "function add()\n {\n $gameId = intval($this->registry->params[0]);\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n\n if (!is_numeric($gameId) || (!empty($_SESSION['cart']) && in_array($gameId, $_SESSION['cart']))) {\n echo \"gameId is niet numeric, geldig of winkelwagen bevat al deze game!\";\n } else {\n $amount = 1;\n (isset($_POST['amount']) ? $amount = intval($_POST['amount']) : '');\n\n $supply = $game->supply;\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n $gameItem = [intval($gameId), $amount];\n $_SESSION['cart'][] = $gameItem;\n }\n header(\"Location: /cart\");\n }", "public function addToCart($id, Request $request)\n {\n $product = DB::table('products')\n ->join('images', 'products.id', '=', 'images.product_id')\n ->select('products.*', 'images.name as imageName')\n ->where('products.id', '=', $id)\n ->groupby('products.id')\n ->get();\n $name = $product[0]->name;\n $price = $product[0]->price * ((100-$product[0]->sale)/100);\n $image = $product[0]->imageName;\n Cart::add(array('id' => $id, 'name' => $name, 'qty' => 1, 'price' => $price, 'options' => array('size' => 'L', 'image' => $image)));\n return redirect('user/cart');\n }", "public function addToCart($id)\n {\n $product = Product::find($id);\n if (!$product) {\n abort(404);\n }\n $cart = session()->get('cart');\n\n // if cart is empty then this the first product\n if (!$cart) {\n $cart = [\n $id => [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ]\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if cart not empty then check if this product exist then increment quantity\n if (isset($cart[$id])) {\n $cart[$id]['quantity']++;\n\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if item not exist in cart then add to cart with quantity = 1\n $cart[$id] = [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }", "public function add(Request $request)\n {\n $product = Product::find($request->id);\n if (isset($_COOKIE['user_ip'])) {\n $ip = $_COOKIE['user_ip'];\n } else {\n $ip = $request->ip();\n setcookie('user_ip', $ip, time() + 1206900);\n }\n $cart = new Cart();\n $cart->user_ip = $ip;\n $cart->product_id = $product->id;\n $cart->user_system_info = $request->server('HTTP_USER_AGENT');\n $cart->quantity = 1;\n $cart->save();\n\n return redirect()->back();\n }", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function addToCart($product, $qty = 1){\n // Create Cart\n // if Product has in Cart, add + qty\n if(isset($_SESSION['cart'][$product->id])){\n $_SESSION['cart'][$product->id]['qty'] += $qty;\n } else { // if not in Cart, create\n $_SESSION['cart'][$product->id] = [\n 'qty' => $qty,\n 'name' => $product->name,\n 'price' => $product->price,\n 'img' => $product->img\n ];\n }\n // Total Qty\n // if isset Qty or if not\n $_SESSION['cart.qty'] = isset( $_SESSION['cart.qty'])\n ? $_SESSION['cart.qty'] + $qty\n : $qty;\n // Total Sum\n $_SESSION['cart.sum'] = isset($_SESSION['cart.sum'])\n ? $_SESSION['cart.sum'] + $qty * $product->price\n : $qty * $product->price;\n\n }", "public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}", "public function add($item, $id = null);", "public function addItemToCart(Request $request)\n {\n return $this->repository->addItemToCart($request);\n }", "public function addItem( $variant_id,\\Shop\\Models\\Products $product, array $post )\r\n {\r\n \r\n $wishlistitem = \\Shop\\Models\\Carts::createItem($variant_id, $product, $post);\r\n \r\n // Is the item already in the wishlist?\r\n // if so, inc quantity\r\n // otherwise add the wishlistitem\r\n $exists = false;\r\n foreach ( $this->items as $key => $item )\r\n {\r\n if ($item['hash'] == $wishlistitem->hash)\r\n {\r\n $exists = true;\r\n $wishlistitem->id = $item['id'];\r\n $wishlistitem->quantity = $wishlistitem->quantity + $item['quantity'];\r\n $this->items[$key] = $wishlistitem->cast();\r\n \r\n break;\r\n }\r\n }\r\n \r\n if (! $exists)\r\n {\r\n $this->items[] = $wishlistitem->cast();\r\n }\r\n \r\n return $this->save();\r\n }", "public function add(){\n\t\t$image = $this->input->post('image');\n\t\t$insert_data = array(\n\t\t\t'id' => $this->input->post('id'),\n\t\t\t'name' => $this->input->post('name'),\n\t\t\t'price' => $this->input->post('price'),\n\t\t\t'image' => $this->input->post('image'),\n\t\t\t'color' => $this->input->post('color'),\n\t\t\t'size' => $this->input->post('size'),\n\t\t\t'qty' => $this->input->post('qty')\n\t\t);\t\t\n\t\t$this->cart->insert($insert_data); //invokes insert() method of Cart class.\n\t\tredirect('cart'); //redirect to the same controller but in index method\n\t}", "public function addSale($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function add($id)\n {\n $cart = $this->session->get('cart', []);\n\n if (!empty($cart[$id])) {\n $cart[$id]++;\n } else {\n $cart[$id] = 1;\n }\n\n $this->session->set('cart', $cart);\n }", "public function addToCart(Request $request, $id){\n if(Auth::user()) {\n $shop = Product::find($request->product);\n if(!$shop) {\n abort(404);\n }\n \n $cart = session()->get('cart'); //verificam daca exista un cos in sesiune\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ]\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n if(isset($cart[$id])) { // daca cart nu este gol at verificam daca produsul exista pt a incrementa cantitate\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n $cart[$id] = [ // daca item nu exista in cos at addaugam la cos cu quantity = 1\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n } else {\n return view('auth.login', ['url' => 'user']);\n }\n \n }", "public function add($id, $num = 1)\n {\n // setup or retrieve cart\n $cart = array();\n if (isset($_SESSION['cart'])) {\n $cart = $_SESSION['cart'];\n }\n\n //check to see if item is already in cart\n if (isset($cart[$id])) {\n\n //if item is in cart\n $cart[$id] = $cart[$id] + $num;\n } else {\n //if item is not in cart\n $cart[$id] = $num;\n }\n $_SESSION['cart'] = $cart;\n }", "public static function add_item($key, $quantity) {\n global $books;\n if ($quantity < 1) return;\n\n // If item already exists in cart, update quantity\n if (isset($_SESSION['bookCart'][$key])) {\n $quantity += $_SESSION['bookCart'][$key]['qty'];\n update_item($key, $quantity);\n return;\n }\n\n // Add item\n $book = BookDB::getBook($key);\n $cost = $book->getPrice();\n $total = $cost * $quantity;\n $item = array(\n 'title' => $book->getTitle(),\n 'author' => $book->getAuthor(),\n 'cost' => $cost,\n 'qty' => $quantity,\n 'total' => $total\n );\n $_SESSION['bookCart'][$key] = $item;\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function addAction(Request $request)\n {\n /* @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface */\n $dispatcher = $this->container->get('event_dispatcher'); \n \n $item = $this->container->get('ir_cart.manager.cart_item')->createCartItem();\n \n $dispatcher->dispatch(IRCartEvents::CART_ITEM_ADD_INITIALIZE, new CartItemEvent($item, $request));\n \n $cart = $this->container->get('ir_cart.provider.cart')->getCart(); \n \n $cart->addItem($item);\n $this->container->get('ir_cart.manager.cart')->updateCart($cart);\n $this->container->get('ir_cart.provider.cart')->setCart($cart);\n \n $dispatcher->dispatch(IRCartEvents::CART_ITEM_ADD_COMPLETED, new CartItemEvent($item, $request)); \n \n return new RedirectResponse($this->container->get('router')->generate('ir_cart_checkout'));\n }", "public function clickAddToCart()\n {\n $this->waitFormToLoad();\n $this->_rootElement->find($this->addToCart)->click();\n }", "public function add($id){\n $product = Product::findOrFail($id);\n\n //goi phuong thức add() từ thư viện Cart\n Cart::add([\n 'id' => $id,\n 'name' => $product->name,\n 'qty' => 1,\n 'price' => $product->discount ?? $product->price,\n 'weight' => $product->weight ?? 0,\n 'options' => [\n 'images' => $product->productImages,\n ],\n ]);\n\n//dung phuong thuc content() de xem DL trong cart\n// dd(Cart::content());\n\n return back();\n }", "public function addItemToCart(Request $request,$id){\n \n //get product\n $product=Product::with('get_images')->findOrFail($id);\n\n\n //check if the quantity entered is null or 0\n\n if($request->quantity==null || $request->quantity==0){\n return back()->withInput($request->input())->withErrors('Min unit needs to be 1');\n }\n //to check if the product exists in cart \n\n $cart_product=Cart::content()->groupBy('id')->get($id);\n\n //if not present check the quantity requested with the entered one. If present then compare with quantity requested and entered.\n\n if($cart_product==null){\n if($request->quantity>$product->quantity){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n }\n else if(($request->quantity+($cart_product->first()->qty))>$product->quantity ){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n if($product->special_price_from && $product->special_price_to){\n $date=date('Y-m-d');\n if($date<=$product->special_price_to && $date>=$product->special_price_from){\n \n $product->price=$product->special_price;\n\n }\n }\n Cart::add(['id'=>$product->id,'name'=>$product->name,'qty'=>$request->quantity,'price'=>$product->price,'options'=>['image'=>$product->get_images->first()->image_name]]);\n session(['cart_total'=>round((float)str_replace(',', '', Cart::total()),2)]);\n\n Session::flash('success','Item added to cart!');\n return back();\n\n }", "public function addCartAction($id, Request $request)\n {\n // Récupère la session\n $session = $request->getSession();\n // Vérifie si la session panier existe déjà\n if (!$session->has('cart')) $session->set('cart', array());\n //\n $cart = $session->get('cart');\n\n $cart[$id] = 1;\n // Vérfie si l'id du produit existe déjà dans notre panier\n if (array_key_exists($id, $cart)) {\n if ($request->query->get('quantity') != null)\n // Affectation nouvelle quantité\n $cart[$id] = $request->query->get('quantity');\n }else {\n if ($request->query->get('quantity') != null)\n // Ajout nouvelle quantité\n $cart[$id] = $request->query->get('quantity');\n else\n // Quantité par défaut\n $cart[$id] = 1;\n }\n\n $session->set('cart', $cart);\n\n return $this->redirectToRoute('wizishop_core_cart');\n }", "function add_cart_item( $cart_item ) {\n\t\t\t\tif (isset($cart_item['addons'])) :\n\t\t\t\t\t\n\t\t\t\t\t$extra_cost = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($cart_item['addons'] as $addon) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($addon['price']>0) $extra_cost += $addon['price'];\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t\t$cart_item['data']->adjust_price( $extra_cost );\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\treturn $cart_item;\n\t\t\t\t\n\t\t\t}", "public function actionAdd()\n {\n $product_id = $this->getRequest('post','product_id');\n $image_id = $this->getRequest('post','image_id');\n $product = \\common\\models\\Products::find()->where(['id' => $product_id])->one();\n $total = $product->price;\n $count = $this->getRequest('post','count');\n $cover_id = $this->getRequest('post','cover_id');\n $color_id = $this->getRequest('post','color_id');\n\n $cart = new OrderCart();\n $cart->product_id = $product_id;\n $cart->image_id = $image_id;\n $cart->total = $total;\n $cart->count = $count;\n $cart->cover_id = $cover_id;\n $cart->user_id =$this->getUserId();\n $cart->user_hash = $this->getFromSession('id');\n $cart->color_id = $color_id;\n $cart->save();\n $allCart = (new CartsUtil())->getSelfCart();\n foreach($allCart as $k=> $v) {\n if($v['id'] == $cart->id) {\n $discont = (new SalesUtil())->detectSale($v);\n $cart->total = $cart->total - (($discont && isset($discont['sale_val']))\n ? $discont['sale_val']\n : 0 );\n break;\n }\n }\n return ($cart->save()) ? 200 : 400;\n }", "public function addToCart(Request $request, $id)\n {\n $product = Product::find($id);\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n $cart->add($product, $product->id);\n\n $request->session()->put('cart', $cart);\n return redirect('shopping');\n }" ]
[ "0.8509984", "0.8310418", "0.8252583", "0.8238454", "0.80710167", "0.8035943", "0.8035943", "0.7972041", "0.79000634", "0.7891097", "0.7842936", "0.7823215", "0.77436554", "0.7737258", "0.77297026", "0.76292753", "0.7625777", "0.75775754", "0.7575046", "0.7574568", "0.75041443", "0.746597", "0.74187154", "0.74072385", "0.7403681", "0.7395688", "0.7394953", "0.7304719", "0.7303058", "0.72979534", "0.72910804", "0.72744757", "0.72692895", "0.72534823", "0.7218555", "0.71961343", "0.71938443", "0.71938443", "0.7187878", "0.7187276", "0.7168297", "0.7157428", "0.7154293", "0.71511614", "0.7137177", "0.7127205", "0.7124625", "0.7120401", "0.71169436", "0.7114593", "0.71063423", "0.71050924", "0.710198", "0.70935845", "0.7079054", "0.7078181", "0.7075105", "0.7072708", "0.706877", "0.70561063", "0.7034417", "0.70267653", "0.7012288", "0.70028406", "0.6988483", "0.6986642", "0.6985406", "0.69622004", "0.69505954", "0.69423187", "0.69336545", "0.69312125", "0.6925728", "0.69239205", "0.6919943", "0.6918631", "0.6915403", "0.6914653", "0.69133776", "0.69068676", "0.6904003", "0.69005513", "0.6899162", "0.6886988", "0.6873416", "0.6854925", "0.6846756", "0.6846459", "0.684152", "0.68388367", "0.6834481", "0.68289167", "0.6823956", "0.68218094", "0.68208426", "0.68099034", "0.68036246", "0.6800183", "0.6799492", "0.679323", "0.67922044" ]
0.0
-1
Load all items from the cart
private function loadItems() { if ($this->items === null) { $this->items = $this->storage->load(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load() {\n if(isset($_SESSION['cart'])) {\n $this->items = $_SESSION['cart'];\n } \n }", "public function loadPreviousItems()\n {\n //first get it out of db.\n if ($orderId = $this->_order->check_cart($this->_auth->id)) {\n $order = $this->_order->get_order($orderId);\n $this->_items = unserialize($order['items']); \n $this->_shipping = array();\n $this->_shippingCost = array();\n $this->_salesTax = array();\n $this->_total = 0;\n $this->persist();\n }\n }", "public function getCartItems($cart_id);", "public function getSessionItems() { global $smarty; \n if(isset($_SESSION['checkout']['items'])) { \n $smarty->assign(\"cart\", $_SESSION['checkout']['items']);\n }\n }", "public function loadData(Cart $cart)\n\t{\n\t\tif (!Validate::isLoadedObject($cart) || ($products = $cart->getProducts()) === array())\n\t\t\treturn;\n\n\t\t$currency = new Currency($cart->id_currency);\n\t\tif (!Validate::isLoadedObject($currency))\n\t\t\treturn;\n\n\t\t// Cart rules are available from prestashop 1.5 onwards.\n\t\tif (_PS_VERSION_ >= '1.5')\n\t\t{\n\t\t\t$cart_rules = (array)$cart->getCartRules(CartRule::FILTER_ACTION_GIFT);\n\n\t\t\t$gift_products = array();\n\t\t\tforeach ($cart_rules as $cart_rule)\n\t\t\t\tif ((int)$cart_rule['gift_product'])\n\t\t\t\t{\n\t\t\t\t\tforeach ($products as $key => &$product)\n\t\t\t\t\t\tif (empty($product['gift'])\n\t\t\t\t\t\t\t&& (int)$product['id_product'] === (int)$cart_rule['gift_product']\n\t\t\t\t\t\t\t&& (int)$product['id_product_attribute'] === (int)$cart_rule['gift_product_attribute'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$product['cart_quantity'] = (int)$product['cart_quantity'];\n\t\t\t\t\t\t\t$product['cart_quantity']--;\n\n\t\t\t\t\t\t\tif (!($product['cart_quantity'] > 0))\n\t\t\t\t\t\t\t\tunset($products[$key]);\n\n\t\t\t\t\t\t\t$gift_product = $product;\n\t\t\t\t\t\t\t$gift_product['cart_quantity'] = 1;\n\t\t\t\t\t\t\t$gift_product['price_wt'] = 0;\n\t\t\t\t\t\t\t$gift_product['gift'] = true;\n\n\t\t\t\t\t\t\t$gift_products[] = $gift_product;\n\n\t\t\t\t\t\t\tbreak; // One gift product per cart rule\n\t\t\t\t\t\t}\n\t\t\t\t\tunset($product);\n\t\t\t\t}\n\n\t\t\t$items = array_merge($products, $gift_products);\n\t\t}\n\t\telse\n\t\t\t$items = $products;\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$name = $item['name'];\n\t\t\tif (isset($item['attributes_small']))\n\t\t\t\t$name .= ' ('.$item['attributes_small'].')';\n\n\t\t\t$this->line_items[] = array(\n\t\t\t\t'product_id' => (int)$item['id_product'],\n\t\t\t\t'quantity' => (int)$item['cart_quantity'],\n\t\t\t\t'name' => (string)$name,\n\t\t\t\t'unit_price' => Tiresias::helper('price')->format($item['price_wt']),\n\t\t\t\t'price_currency_code' => (string)$currency->iso_code,\n\t\t\t);\n\t\t}\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "public function get_cart_items()\n\t{\n\t\t$this->initiate_cart();\n\t\treturn $this->ci->session->cart_items;\n\t}", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function _getItems(Cart $cart)\n {\n $items = $cart->getQuote()->getAllVisibleItems();\n try {\n $data = [];\n $configurableSkus = [];\n foreach ($items as $item) {\n $product = $item->getProduct();\n $_item = [];\n $_item['vars'] = [];\n if ($item->getProduct()->getTypeId() == 'configurable') {\n $_item['isConfiguration'] = 1;\n $parentIds[] = $item->getParentItemId();\n $options = $this->cpModel->getOrderOptions($product);\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(), $configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n if ($_item['id']) {\n $_item['qty'] = (int)$item->getQty();\n $_item['url'] = $item->getProduct()->getProductUrl();\n $_item['image'] = $this->productHelper->getSmallImageUrl($product);\n $current_price = null;\n $reg_price = $product->getPrice();\n $special_price = $product->getSpecialPrice();\n $special_from = $product->getSpecialFromDate();\n $special_to = $product->getSpecialToDate();\n if ($special_price &&\n ($special_from === null || (strtotime($special_from) < strtotime('Today'))) &&\n ($special_to === null || (strtotime($special_to) > strtotime('Today')))) {\n $current_price = $special_price;\n } else {\n $current_price = $reg_price;\n }\n $_item['price'] = $current_price * 100;\n if ($tags = $this->_getTags($product)) {\n $_item['tags'] = $tags;\n }\n $data[] = $_item;\n }\n }\n\n return $data;\n } catch (\\Exception $e) {\n $this->clientManager->getClient()->logger($e);\n\n return false;\n }\n }", "public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}", "public function retrieveItems() {\n $this->all = array();\n $this->_backlog = array();\n $this->_progress = array();\n $this->_done = array();\n $table_name = \"items\";\n $connection = db_connect();\n if ($connection->connect_error) {\n die(\"Connection failed: \" . $connection->connect_error);\n }\n $sql = \"SELECT * FROM $table_name ORDER BY id\";\n $result = @mysqli_query($connection, $sql) or die(mysqli_error($connection));\n while ($row = mysqli_fetch_array($result)) {\n $id = $row['id'];\n $category = $row['category'];\n $text = $row['text'];\n $item = new Item($id, $category, $text);\n array_push($this->all, $item);\n if ($category == 1) {\n array_push($this->_backlog, $item);\n } else if ($category == 2) {\n array_push($this->_progress, $item);\n } else if ($category == 3) {\n array_push($this->_done, $item);\n }\n }\n }", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }", "private function loadAllItems(): array\n {\n /** @var array<WC_Order_Item_Fee|WC_Order_Item_Product|WC_Order_Item_Shipping> $items */\n $items = array_merge(\n $this->object->get_items(),\n $this->object->get_items(\"shipping\"),\n $this->object->get_items(\"fee\")\n );\n\n return $this->items = $items;\n }", "protected function get_items_from_cart() {\n\t\t$this->items = array();\n\n\t\tforeach ( $this->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t$item = $this->get_default_item_props();\n\t\t\t$item->key = $cart_item_key;\n\t\t\t$item->object = $cart_item;\n\t\t\t$item->tax_class = $cart_item['data']->get_tax_class();\n\t\t\t$item->taxable = 'taxable' === $cart_item['data']->get_tax_status();\n\t\t\t$item->price_includes_tax = wc_prices_include_tax();\n\t\t\t$item->quantity = $cart_item['quantity'];\n\t\t\t$item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] );\n\t\t\t$item->product = $cart_item['data'];\n\t\t\t$item->tax_rates = $this->get_item_tax_rates( $item );\n\t\t\t$this->items[ $cart_item_key ] = $item;\n\t\t}\n\t}", "private static function loadItems()\n\t{\n\t\tself::$_items=array();\t\t\t\t\t\t//FIXME Сделать критерию с селект где не будет лишних полей\n\t\t$models=self::model()->findAll();\n\t\tforeach($models as $model)\n\t\t\tself::$_items[$model->code]=$model->value;\n\t}", "public function reloadItems();", "function carts()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must login to view saved carts.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t// Create an SQL WHERE clause to list all previously saved cart data for a specific user.\n\t\t\t// This examples also prevents cart session data from confirmed orders being loaded, by checking the readonly status is set at '0'.\n\t\t\t$sql_where = array(\n\t\t\t\t$this->flexi_cart->db_column('db_cart_data', 'user') => $this->data['user']->id,\n\t\t\t\t$this->flexi_cart->db_column('db_cart_data', 'readonly_status') => 0\n\t\t\t);\n\t\t\t// Get a list of all saved carts that match the SQL WHERE statement.\n\t\t\t$this->data['saved_cart_data'] = $this->flexi_cart_admin->get_db_cart_data_query(FALSE, $sql_where)->result_array();\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/carts_view', $this->data);\n\t\t}", "public function load_cart($table){\n\t\t\t$this ->empty_cart();\n\t\t\t//Recupera numero de mesa\n\t\t\t$mesa = \"table\".$table;\n\t\t\t//Asigna lo guardado en esa mesa al carro actual\n\t\t\t$_SESSION['cart'] = $_SESSION[$mesa];\n\n\t\t\t//Actualiza la informacion de que el carrito actual pertenece a esa mesa\n\t\t\t$_SESSION['current'] = $mesa;\n\n\t\t\t//Actualiza el carro para mostrar cambios\n \t\t$this->update_cart();\n\n\t\t}", "public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function get_items(){\n\t \t//Si no esta vacio empieza a imprimirlos\n\t \tif(!empty($this->cart)){\n\t \t\t\n\t\t \tforeach ($this->cart as $linea) {\n\t\t \t\t\n\t\t \t\t?>\n\t\t\t <tr class=\"filaTicket\">\n\t\t\t\t <td height=\"20\"><?=$linea['code']?></td>\n\t\t\t\t <td><?=$linea['product']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['price'], 2, ',','.')?></td>\n\t\t\t\t <td align=\"right\"><?=$linea['iva']?></td>\n\t\t\t\t <td align=\"right\"><?= $linea['amount']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['subtotal'], 2, ',','.') ?></td>\n\n\t\t\t\t \n\t\t\t\t <td>\n\t\t\t\t <button onClick=\"borrarProducto(<?=$linea['code']?>);\">Borrar</button>\n\n\t\t\t\t </td>\n\n\t\t\t </tr>\n\t\t \t\t\t<?php\n\n\t \t}\n\n\t \t}\n\t \t\n\t }", "function _loadItems()\n\t{\n\t\tjimport('joomla.filesystem.folder');\n\n\t\t/* Get a database connector */\n\t\t$db =& JFactory::getDBO();\n\n\t\t$query = 'SELECT *' .\n\t\t\t\t' FROM #__extensions' .\n\t\t\t\t' WHERE state = -1' .\n\t\t\t\t' ORDER BY type, client_id, folder, name';\n\t\t$db->setQuery($query);\n\t\t$rows = $db->loadObjectList();\n\n\t\t$apps =& JApplicationHelper::getClientInfo();\n\n\t\t$numRows = count($rows);\n\t\tfor($i=0;$i < $numRows; $i++)\n\t\t{\n\t\t\t$row =& $rows[$i];\n\t\t\tif (strlen($row->manifest_cache)) {\n\t\t\t\t$data = unserialize($row->manifest_cache);\n\t\t\t\tif ($data) {\n\t\t\t\t\tforeach($data as $key => $value) {\n\t\t\t\t\t\t$row->$key = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row->jname = JString::strtolower(str_replace(\" \", \"_\", $row->name));\n\t\t\tif (isset($apps[$row->client_id])) {\n\t\t\t\t$row->client = ucfirst($apps[$row->client_id]->name);\n\t\t\t} else {\n\t\t\t\t$row->client = $row->client_id;\n\t\t\t}\n\t\t}\n\t\t$this->setState('pagination.total', $numRows);\n\t\tif ($this->_state->get('pagination.limit') > 0) {\n\t\t\t$this->_items = array_slice($rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit'));\n\t\t} else {\n\t\t\t$this->_items = $rows;\n\t\t}\n\t}", "public function getItems(): array\n {\n return $_SESSION['cart'] ?? [];\n }", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function getCart();", "public function ajax_load_available_items()\n {\n }", "public function loadOrderItems($orderId)\n { \n \n $this->_items = $this->_order->get_order_items($orderId); \n \n $this->_shipping = array();\n $this->_shippingCost = array();\n $this->_salesTax = array();\n $this->_total = 0;\n\n $this->persist();\n }", "private function initiate_cart()\n\t{\n\t\tif (!($this->ci->session->has_userdata('cart_items'))) {\n\t\t\t$cart_items = array('cart_items' => array());\n\t\t\t$this->ci->session->set_userdata($cart_items);\n\t\t}\n\t}", "public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }", "public function get_sess_cart_items()\n {\n $cart = array();\n $new_cart = array();\n $this->cart_product_ids = array();\n if (!empty($this->session->userdata('mds_shopping_cart'))) {\n $cart = $this->session->userdata('mds_shopping_cart');\n }\n foreach ($cart as $cart_item) {\n $product = $this->product_model->get_available_product($cart_item->product_id);\n if (!empty($product)) {\n //if purchase type is bidding\n if ($cart_item->purchase_type == 'bidding') {\n $this->load->model('bidding_model');\n $quote_request = $this->bidding_model->get_quote_request($cart_item->quote_request_id);\n if (!empty($quote_request) && $quote_request->status == 'pending_payment') {\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $quote_request->price_offered / $quote_request->product_quantity;\n $item->total_price = $quote_request->price_offered;\n $item->discount_rate = 0;\n $item->currency = $product->currency;\n $item->product_vat = 0;\n $item->shipping_cost = $quote_request->shipping_cost;\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = 1;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n } else {\n $object = $this->get_product_price_and_stock($product, $cart_item->product_title, $cart_item->options_array);\n $price = calculate_product_price($product->price, $product->discount_rate);\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $object->price_calculated;\n $item->total_price = $object->price_calculated * $cart_item->quantity;\n $item->discount_rate = $object->discount_rate;\n $item->currency = $product->currency;\n $item->product_vat = $this->calculate_total_vat($object->price_calculated, $product->vat_rate, $cart_item->quantity);\n $item->shipping_cost = $this->get_product_shipping_cost($product, $cart_item->quantity);\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = $object->is_stock_available;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $new_cart);\n return $new_cart;\n }", "public function getCartItemCollection()\n {\n return $this->items;\n }", "public function readItems() {\r\n include('connect.php');\r\n\r\n $query = \"SELECT *\r\n FROM Items\r\n WHERE CharItem_id = ?\";\r\n $myquery = $db->prepare($query);\r\n $myquery->bindValue(1, $this->charStats->Char_id);\r\n $myquery->execute();\r\n while ($result = $myquery->fetchObject()) {\r\n $this->items[] = new Item($result->Item_id, $result->ItemName, $result->ItemWeight, $result->ItemValue, $result->ItemType);\r\n }\r\n }", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "function fetchProductsFromCart () {\r\n if (checkCart()) {\r\n $sql = \"SELECT * FROM stockitems WHERE StockItemID IN (\" . arrayToSQLString(array_keys($_SESSION['cart'])) . \")\";\r\n return runQuery($sql);\r\n }\r\n}", "public function action_item_load(Request $request, Response $response)\n\t{\n\t\t$values = $request->query();\n\n\t\t$restock = ORM::factory('Store_Restock', $values['restock_id']);\n\n\t\tif(!$restock->loaded())\n\t\t{\n\t\t\tRD::set(RD::ERROR, 'No restock record found.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tRD::set(RD::SUCCESS, 'Item loaded', null, array_merge($restock->as_array(), ['item_name' => $restock->item->name]));\n\t\t}\n\t}", "public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}", "public function cartItems() {\n return $this->hasMany(CartItem::class);\n }", "public function getFullCart()\n {\n $completeCart = [];\n\n if ($this->get())\n {\n foreach ($this->get() as $id => $quantity)\n {\n $product = $this->em->getRepository(Product::class)->findOneById($id);\n\n if (!$product)\n {\n $this->delete($id);\n continue;\n }\n\n $completeCart[] = [\n 'product' => $product,\n 'quantity' => $quantity,\n ];\n }\n }\n\n return $completeCart;\n }", "public function index()\n\t{\n\t\t$items = \\Cart::getContent();\n\t\t$this->data['items'] = $items;\n\n\t\treturn $this->load_theme('carts.index', $this->data);\n\t}", "function view_items() {\n $items = \\Model\\Item::all();\n \n $this->SC->CP->load_view('stock/view_items',array('items'=>$items));\n }", "function getItems();", "function getItems();", "function Cart() {\n\t\t$order = self::get_current_order();\n\t\t$order->Items();\n\t\t$order->Total;\n\n\t\t//HTTP::set_cache_age(0);\n\t\treturn $order;\n\t}", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "public function getActiveCartProducts();", "function items( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the list of items or not? If $zcarriage='NO' exclude the zcarriage from the return result\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND ci.sku<>'zcarriage'\" : '';\n\n\t\t$qry = \"SELECT ci.*, product, product_image, model_type FROM cart ct INNER JOIN cart_items ci ON ct.id=ci.cart_id LEFT OUTER JOIN catalog c ON c.sku=ci.sku WHERE ct.id='\".$cart_id.\"' AND user='\".$user_no.\"' \".$zcarriage.\" AND ci.qty>0 GROUP BY ci.sku\";\n\t\treturn $this->db->query( $qry )->result_array();\n\t}", "abstract protected function _getItems();", "public function testGetItems()\n {\n $cart = new Cart();\n $this->assertEquals([], $cart->getItems());\n\n $cart = new Cart([1, 2, 3]);\n $this->assertEquals([1, 2, 3], $cart->getItems());\n }", "abstract public function loadAll();", "protected function updateItems()\n {\n $this->log(\"Loading items...\");\n\n /** @var Item[] $items */\n $items = Item::find()->all();\n\n foreach ($items as $item) {\n if (!$this->hasItemSavedValue($item->id)) {\n $this->saveItemValue($item->id, $item->getDefaultNAValue(), $item->type, false);\n }\n }\n\n $this->log(\"Done\");\n }", "public function getItemFromCart( $map ) {\r\n\t\t \t$params = array('a.session_cookie'=>$map['cart_session'],'a.restid'=>$map['restid'],'a.itemid'=>$map['itemid']);\r\n\t\t \t$this->db->select('a.itemid,a.restid,a.quantity,b.catid,b.name,b.price,(a.quantity * b.price) as total,(a.quantity *b.packaging) as packaging,b.sub_cat', FALSE)\r\n\t\t \t\t\t ->from(TABLES::$ORDER_CART.' AS a')\r\n\t\t \t\t\t ->join(TABLES::$MENU_ITEM_TABLE.' AS b','a.itemid = b.id','inner')\r\n\t\t \t\t\t ->where($params)->order_by('b.name','asc');\r\n\t\t \t$query = $this->db->get();\r\n\t \t$result = $query->result_array();\r\n\t \treturn $result;\r\n\t\t}", "public function getProductsFromShopingCart(){\n global $book;\n\n if( isset( $_SESSION['shopingCart'] )){\n\n $testArray = [];\n \n foreach( $_SESSION['shopingCart'] as $key => $quantity ){\n \n \n $keyArray = explode(\"_\", $key);\n \n $bookId = $keyArray[1]; \n \n \n \n $getBook = $book->getBookById( $bookId );\n $getBook->quantity = $quantity;\n \n array_push( $testArray,$getBook ); \n }\n \n $_SESSION['shopingCartProducts'] = $testArray;\n\n return $_SESSION['shopingCartProducts'];\n }\n }", "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "public function load_stocks() {\n\t\t\t$res = $this->Restaurant_model->loading_stocks();\n\t\t\techo $res;\n\t\t}", "public function load()\n {\n $data = $this->storage->load();\n $this->collection->load($data);\n\n $this->refresh();\n }", "public function clearCart(){\r\n\t\t$this->cart_items = array();\r\n\t\t$this->latestItemId = 1;\t\t\r\n\t}", "function getCartContent()\n{\n\t$cartContent = array();\n\n\t$sql = \"SELECT ct.ItemID, ct.Quantity, Name, Price, ImageURL, i.Weight\n\t\t\tFROM Cart ct, Items i\n\t\t\tWHERE ct.ItemID = i.ItemID\";\n\t\n\t$result = query($sql);\n\t\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t\tif (!$row['ImageURL']) {\n\t\t\t$row['ImageURL'] = '../images/No-Image-Thumbnail.png';\n\t\t}\n\t\t$cartContent[] = $row;\n\t}\n\t\n\treturn $cartContent;\n}", "public function index() \n\t{\n $this->initModel('Cart_model');\n\n\t\tif(!empty($_SESSION['cart']->getProdList()))\n\t\t{\n //We instansiate cartItems method where we save the new array from session\n\t\t$data = $this->modelObj->showCart();\n $this->reqView('Cart', $data);\n\n\t\t} else {\n\t\t\t$this->reqView('Cart');\n\t\t}\n //This will be shown on our cart page\n\t}", "public function getAllShoppingItems()\n {\n $query = $this->db->prepare('SELECT `id`, `name`, `bought`, `deleted` FROM `shopping_items`;');\n $query->execute();\n $results = $query->fetchAll();\n return $results;\n }", "protected function _getItems(){\n\n\t\t// get parent\n\t\t$model = new Default_Model_ProjectImages();\n\t\t$parentModel = new Default_Model_Projects();\n\t\t$parent = $parentModel->findById($this->_session->id);\n\n\n\t\t// get the item list\n\t\t$model = new $this->_primaryModel;\n\t\t$items = $model->fetchNotTrashedByParentId($this->_session->id);\n\n\t\t// assign specific vars to the view\n\t\t$this->view->assign(array (\n\t\t\t'items' => $items,\n\t\t\t'parent' => $parent,\n//\t\t\t'title' => $items->getRow(0)->title\n\t\t\t'title' => \"TITLE\"\n\t\t));\n\t}", "public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}", "public function getItems()\n {\n }", "public static function reloadInventories (): void {\n\t\tglobal $DB;\n\t\t$res = $DB->query('SELECT IID, name, description FROM id_inventories');\n\t\twhile ($r = $res->fetch_assoc())\n\t\t\tself::$inventories[$r['IID']] = new Inventory($r['IID'], $r['name'], $r['description']);\n\t}", "public function cart()\n {\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n $items = array();\n foreach ($this->_session->offsetGet('products') as $key => $value)\n {\n $items[$key] = array(\n 'id' \t\t=> \t$value['id'],\n 'qty' \t\t=> \t$value['qty'],\n 'price' \t=> \t$value['price'],\n 'name' \t\t=> \t$value['name'],\n 'sub_total'\t=> \t$this->_formatNumber($value['price'] * $value['qty']),\n \t'options' \t=> \t$value['options'],\n 'date' \t\t=> \t$value['date'],\n 'vat' => $value['vat']\n );\n }\n return $items;\n }\n }", "public function index() //localhost:8000/cart\n {\n //Session::forget(\"cart\");\n // dd(Session::get(\"cart\"));\n // use the session cart to get the details for the items.\n $details_of_items_in_cart =[];\n $total = 0;\n if(Session::exists(\"cart\") || Session::get(\"cart\") != null){\n foreach (Session::get(\"cart\") as $item_id => $quantity) {\n \n // Because session cart has keys(item_id) and values (quantity)\n //Find the item\n $product = Product::find($item_id);\n //Get the details needed (add properties not in the original item)\n $product->quantity = $quantity;\n $product->subtotal = $product->cost * $quantity;\n // Note : these properties (quantity and subtoptal Are Not part of the Product Stored in the database, they are only for $product)\n //Push to array containing the details\n //google how to push data in an array\n //Syntax: array_push(target array, data to be pushed)\n array_push($details_of_items_in_cart, $product);\n $total += $product->subtotal;\n //total = total + subtotal\n }\n //send the array to the view\n //dd($details_of_items_in_cart);\n }\n return view(\"products.cart\", compact(\"details_of_items_in_cart\",\n \"total\"));\n }", "public function getCartData()\n {\n $data = array();\n $session= Mage::getSingleton('checkout/session');\n $items = $session->getQuote()->getAllVisibleItems();\n if($items) {\n foreach ($items as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n }", "public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }", "function getCart() {\n\t\t$cartData = array();\n\t\t\tif($stmt = $this->connection->prepare(\"select * FROM cart;\")) {\n\t\t\t\t$stmt -> execute();\n\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($id, $itemName, $itemDesc, $numberOf, $price);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$cartData[] = array(\n\t\t\t\t\t\t\t'id' =>$id,\n\t\t\t\t\t\t\t'productName' => $itemName,\n\t\t\t\t\t\t\t'productDescription' => $itemDesc,\n\t\t\t\t\t\t\t'numberOf' => $numberOf,\n\t\t\t\t\t\t\t'price' => $price\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn $cartData;\n\t}", "public function getCart(){\n $session_id = Session::get('session_id');\n $userCart = Cart::where('session_id', $session_id)->get();\n $totalPrice = 0;\n if($userCart->count() > 0){\n foreach($userCart as $key => $cart){\n // Kiểm tra nếu sản phẩm có status == 0 thì xóa khỏi giỏ hàng\n if($cart->products->status == 0){\n $cart->delete();\n unset($userCart[$key]);\n }\n // Kiểm tra nếu kho = 0\n if($cart->attributes->stock == 0){\n $cart->quantity = 0;\n $cart->save();\n }\n // Kiểm tra nếu kho < quantity\n if($cart->attributes->stock < $cart->quantity){\n $cart->quantity = $cart->attributes->stock;\n $cart->save();\n }\n $totalPrice += $cart->attributes->price*$cart->quantity;\n }\n $totalItems = $userCart->sum('quantity');\n \n }else{\n $totalItems = 0;\n }\n \n return view('frontend.cart_page')->withUserCart($userCart)->withTotalItems($totalItems)->withTotalPrice($totalPrice);\n }", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "public function cart()\n {\n if(Auth::check()) {\n $user_email = Auth::user()->email;\n $userCart = DB::table('cart')->where('user_email', $user_email)->get();\n } else {\n $session_id = Session::get('session_id');\n $userCart = DB::table('cart')->where('session_id', $session_id)->get();\n }\n \n // Get images for cart items\n foreach($userCart as $key => $product){\n $product = Product::where('id', $product->product_id)->first();\n $userCart[$key]->image = $product->image;\n }\n $meta_title = \"Shopping Cart - E-com Website\";\n $meta_description = \"View Shopping Cart of E-com Website\";\n $meta_keywords = \"Shopping Cart - E-com Website\";\n return view('products.cart', compact('userCart', 'meta_title','meta_description', 'meta_keywords'));\n }", "public function update_cart(){\n\t\t\tself::__construct();\n\t\t}", "public function index()\n {\n return $cart=cart::all();\n }", "public function getAllItems()\n\t{\n\n\t\t// Get the all the parent category\n\t\t$parentCategory = Category::where('parent_id','=', NULL)->get(); \n\t\n\t\t// Get all items with paginate \n\t\t$items = Item::orderBy('created_at', 'DESC')->normal()->paginate(12);\n\t\t$trigger = TRUE;\n\n\t\tforeach($items as $item)\n\t\t{\n\t\t\t// Add the newest price to the item array\n\t\t\t$priceArray = Item::find($item->id)->prices->first(); \n\t\t\t$newestPrice = $priceArray['price'];\n\t\t\tarray_add($item, 'price',$newestPrice);\n\n\t\t\t// Add the main picture to the item array;\n\t\t\t$itemPicture = Item::find($item->id)->pictures()->where('status','=','1')->first();\n\t\t\t$pictureName = $itemPicture['picture_name'];\n\t\t\tarray_add($item, \"picture_name\", $pictureName);\n\n\n\n\t\t\t// Add the parent_category_id to the item array;\n\t\t\t$category = Item::find($item->id)->category()->first(); \n\t\t\twhile($category->parent_id != NULL)\n\t\t\t{\n\t\t\t\t// Get the current category collection\n\t\t\t\t$category = Category::find($category->parent_id);\t\t\t\t\n\t\t\t}\n\n\t\t\tarray_add($item, 'parent_category_id', $category->id);\n\t\t}\n\n\n\t\t// Check the if ajax request\n\t\tif(Request::ajax()) {\n\t\t\treturn Response::json(View::make('ajax/item-ajax', compact('items', 'parentCategory', 'trigger'))->render());\n\t\t}\n\n\n\n\n\n\n\t\treturn View::make('frontend/item/view-item-list', compact('items', 'parentCategory', 'trigger'));\t\n\t}", "public function items()\n {\n \n }", "public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' => serialize($this->_items)\n );\n //udpate order table\n if ($order_id) {\n $order_data['date_modified'] = date(\"Y-m-d H:i:s\");\n $this->_order->update($order_data, $order_id);\n } else {\n $order_data['date_added'] = date(\"Y-m-d H:i:s\");\n $order_id = $this->_order->save($order_data);\n }\n // echo $order_id; \n }", "public function all()\n {\n $item = new Item;\n $items = $item->all();\n View::renderJson($items);\n }", "public function items ()\n {\n }", "public function index()\n\t{\n# \\Cart::destroy();return;\n $contents = \\Cart::content()->paginate(5);\n// foreach ($contents as $row) {\n//// echo 'You have ' . $row->qty . ' items of ' . $row->product->name . ' with description: \"' . $row->product->description . '\" in your cart.';\n// }\n\n $total = number_format(\\Cart::total(), 2);\n $this->view('shopcart.index', compact('contents', 'total'));\n\n\t}", "public function prepare_items() {\n\t\t$per_page = $this->get_items_per_page( 'cert_dashboards_per_page', 1 );\n\t\t$this->items = self::get_cert_dashboards( $per_page );\n\t}", "public function index()\n\t{\n\t\t// $this->load->model('Product');\n\t\t// $queryRecords = $this->Product->list_product();\n\t\t// $data['products'] = $queryRecords; \n\t\t$data['cart_list'] = $this->cart->contents();\n\n\t\t$this->load->view('cart',$data);\n\t}", "public function __construct(){\r\n\t\t$this->clearCart();\r\n\t}", "public static function getItems()\n {\n $items = Catalog::item()\n ->select('catalog_items.*, catalog_categories.name AS category')\n ->leftJoin('catalog_categories', 'catalog_categories.id', '=', 'catalog_items.category_id')\n ->orderBy('catalog_categories.weight')\n ->orderBy('catalog_categories.name')\n ->orderBy('catalog_items.name')\n ->all();\n\n if($items)\n $items = self::getItemData($items);\n\n return $items;\n }" ]
[ "0.7864368", "0.70897734", "0.675945", "0.67422634", "0.65406716", "0.6492334", "0.64723665", "0.6472274", "0.6456924", "0.63853735", "0.63778657", "0.63772964", "0.63579094", "0.6341696", "0.63258237", "0.62854457", "0.6269724", "0.61998665", "0.61774546", "0.6154933", "0.6131463", "0.61149144", "0.6112809", "0.6112274", "0.6065976", "0.6057056", "0.6053385", "0.6051609", "0.6051427", "0.6048313", "0.60445845", "0.60135716", "0.6005329", "0.5959606", "0.59551847", "0.5949401", "0.59217614", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.59216225", "0.5913704", "0.5912037", "0.59032667", "0.59002924", "0.58973056", "0.5889334", "0.58445275", "0.5842306", "0.5842306", "0.58404833", "0.5838341", "0.58224875", "0.5801506", "0.5790558", "0.57904077", "0.57876253", "0.57769746", "0.5769895", "0.57698727", "0.57652926", "0.57588905", "0.57574475", "0.5751055", "0.57432353", "0.574129", "0.5709568", "0.5707882", "0.5691017", "0.56907177", "0.56886506", "0.5686823", "0.5678839", "0.56663805", "0.565747", "0.5630005", "0.56189734", "0.5616019", "0.56092185", "0.5600485", "0.55996376", "0.5597544", "0.5588239", "0.55865103", "0.5582804", "0.5562337", "0.5561934", "0.5557873", "0.55561984", "0.5556153", "0.5556028" ]
0.7335535
1
Adding item quantity in the cart
public function plus($id, $quantity) { $this->loadItems(); if (isset($this->items[$id])) { $this->items[$id]->setQuantity($quantity + $this->items[$id]->getQuantity()); } $this->saveItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }", "public function updateQuantity() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'][$count]['quantity'] = $this->quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function updateCartQuantity()\n {\n if(isset($_GET[\"quantity\"]) && $_GET[\"quantity\"] > 0) {\n $_SESSION[\"products\"][$_GET[\"update_quantity\"]][\"product_qty\"] = $_GET[\"quantity\"];\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(['products' => $total_product]));\n }", "public function addItemToCart($account_id, $item_id, $quantity = false);", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "public function addItem(string $sku, int $qty): Cart;", "function updateItemQty(){\n $update = 0;\n // Get cart item info\n $rowid = $this->input->get('rowid');\n $qty = $this->input->get('qty');\n\n // Update item in the cart\n if(!empty($rowid) && !empty($qty)){\n $data = array(\n 'rowid' => $rowid,\n 'qty' => $qty\n );\n $update = $this->cart->update($data);\n }\n\n // Return response\n echo $update?'ok':'err';\n }", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "public function add_order()\n {\n if (isset($_SESSION['cart'])) {\n $total_cost = 0;\n $quantity = 0;\n $quaty = \"\";\n foreach ($_SESSION['cart'] as $id => $quaty) {\n $product = Data::find_by_id($id);\n $cost = $product->price * $quaty; // $quaty is quantity.\n $quantity += $quaty;\n $total_cost = $total_cost + $cost;\n }\n if ($quaty > 0) {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> $quantity </p>\";\n }\n } else {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> Empty</p>\";\n }\n }", "public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "public function incrementCartItem()\n {\n cart()->incrementQuantityAt(request('id'));\n\n\n return redirect()->route('cart');;\n }", "public function updateItemQuantity( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->where($params);\r\n\t\t\t$qty = array('quantity'=>$map['quantity']);\r\n\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t}", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }", "private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }", "public function single_product_quantity_ajax_cart() {\n\n\t\t\t$woo_header_cart_click_action = astra_get_option( 'woo-header-cart-click-action' );\n\n\t\t\tadd_filter(\n\t\t\t\t'woocommerce_widget_cart_item_quantity',\n\t\t\t\tarray( $this, 'astra_addon_add_offcanvas_quantity_fields' ),\n\t\t\t\t10,\n\t\t\t\t3\n\t\t\t);\n\t\t}", "public function addToCart(Request $request){\n $dish_id = $request->id;\n\n $dish = Dish::find($dish_id);\n\n $product = [\n 'id' => $dish->id,\n 'title'=> $dish->title,\n 'photo' => $dish->photo,\n 'quantity'=> 1,\n 'price' => $dish->price,\n 'total' => $dish->price\n ];\n\n $items = session('cart.items');\n $existing = false;\n $grand_total = 0;\n\n if($items && count($items)> 0) {\n\n foreach($items as $index => $item) {\n if($item['id'] == $dish_id) {\n $items[$index]['quantity'] = $item['quantity'] + $product['quantity'];\n $items[$index]['total'] = $items[$index]['quantity'] * $dish->price;\n $existing = true;\n $grand_total += $items[$index]['total'];\n } else {\n $grand_total += $item['total'];\n }\n }\n\n } \n\n if(!$existing){\n session()->push('cart.items', $product);\n $grand_total += $product['total'];\n } else {\n session(['cart.items'=> $items]);\n }\n\n session(['cart.total' => $grand_total]);\n\n return session('cart');\n \n }", "function set_quantity( $cart_item_key, $quantity = 1 ) {\n\t\t\tif ($quantity==0 || $quantity<0) :\n\t\t\t\tunset($this->cart_contents[$cart_item_key]);\n\t\t\telse :\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t}", "public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }", "public function astra_addon_add_offcanvas_quantity_fields( $html, $cart_item, $cart_item_key ) {\n\n\t\t\t$_product = apply_filters(\n\t\t\t\t'woocommerce_cart_item_product',\n\t\t\t\t$cart_item['data'],\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\t\t\t$product_price = apply_filters(\n\t\t\t\t'woocommerce_cart_item_price',\n\t\t\t\tWC()->cart->get_product_price( $cart_item['data'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$product_subtotal = apply_filters(\n\t\t\t\t'woocommerce_cart_item_subtotal',\n\t\t\t\tWC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\tif ( $_product->is_sold_individually() ) {\n\t\t\t\t$product_quantity = sprintf( '1 <input type=\"hidden\" name=\"cart[%s][qty]\" value=\"1\" />', $cart_item_key );\n\t\t\t} else {\n\t\t\t\t$product_quantity = trim(\n\t\t\t\t\twoocommerce_quantity_input(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'input_name' => \"cart[{$cart_item_key}][qty]\",\n\t\t\t\t\t\t\t'input_value' => $cart_item['quantity'],\n\t\t\t\t\t\t\t'max_value' => $_product->get_max_purchase_quantity(),\n\t\t\t\t\t\t\t'min_value' => '0',\n\t\t\t\t\t\t\t'product_name' => $_product->get_name(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$_product,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $product_quantity . '<div class=\"ast-mini-cart-price-wrap\">' . $product_subtotal . '</div>';\n\t\t}", "function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}", "public function addAction()\n {\n /** @var $session */\n $session = $this->get('session');\n\n $cart = $session->get('cart');\n\n $productID = $_POST['product_id'];\n $quantity = $_POST['quantity'];\n\n // First addition to the shopping cart\n if (empty($cart)) {\n $cart[] = array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n } else {\n $existingItem = false;\n\n foreach ($cart as &$cartItem) {\n // If product already exists in cart\n if ($cartItem['product_id'] == $productID) {\n $existingItem= true;\n\n // add to existing quantity\n $cartItem['quantity'] += $quantity;\n }\n }\n\n // if brand new item\n if ($existingItem == false) {\n $cart[]= array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n }\n }\n\n $session->set('cart', $cart);\n\n\n return new RedirectResponse('/cart');\n }", "public function add($data, $quantity = 1)\n {\n if (array_key_exists(\"Key\", $data)) {\n $added = false;\n $item_key = $data['Key'];\n\n // Check if object already in the cart and update quantity\n foreach ($this->items as $item) {\n if ($item->Key == $item_key) {\n $this->update($item->Key, ($item->Quantity + $quantity));\n $added = true;\n }\n }\n\n // If no update was sucessfull then add to cart items\n if (!$added) {\n $cart_item = self::config()->item_class;\n $cart_item = $cart_item::create();\n \n foreach ($data as $key => $value) {\n $cart_item->$key = $value;\n }\n\n // If we need to track stock, do it now\n if ($cart_item->Stocked || $this->config()->check_stock_levels) {\n $cart_item->checkStockLevel($quantity);\n }\n \n $cart_item->Key = $item_key;\n $cart_item->Quantity = $quantity;\n \n $this->extend(\"onBeforeAdd\", $cart_item);\n\n $this->items->add($cart_item);\n $this->save();\n }\n }\n }", "public function addItemToCart(Request $request,$id){\n \n //get product\n $product=Product::with('get_images')->findOrFail($id);\n\n\n //check if the quantity entered is null or 0\n\n if($request->quantity==null || $request->quantity==0){\n return back()->withInput($request->input())->withErrors('Min unit needs to be 1');\n }\n //to check if the product exists in cart \n\n $cart_product=Cart::content()->groupBy('id')->get($id);\n\n //if not present check the quantity requested with the entered one. If present then compare with quantity requested and entered.\n\n if($cart_product==null){\n if($request->quantity>$product->quantity){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n }\n else if(($request->quantity+($cart_product->first()->qty))>$product->quantity ){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n if($product->special_price_from && $product->special_price_to){\n $date=date('Y-m-d');\n if($date<=$product->special_price_to && $date>=$product->special_price_from){\n \n $product->price=$product->special_price;\n\n }\n }\n Cart::add(['id'=>$product->id,'name'=>$product->name,'qty'=>$request->quantity,'price'=>$product->price,'options'=>['image'=>$product->get_images->first()->image_name]]);\n session(['cart_total'=>round((float)str_replace(',', '', Cart::total()),2)]);\n\n Session::flash('success','Item added to cart!');\n return back();\n\n }", "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "private function addProductCount($product_id, $quantity)\n {\n $this->cart[$product_id]['quantity'] += $quantity;\n }", "public function increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }", "public function addCart()\n\t{\t\n\t\t$id \t\t\t= isset($_POST['id'])\t\t? abs((int)$_POST['id']) : 0;\n\t\t$filter_item_id\t= isset($_POST['size'])\t\t? abs((int)$_POST['size']) : 0;\n\t\t$type \t\t\t= isset($_POST['type'])\t\t? abs((int)$_POST['type']) : 0;\n\t\t$quantity \t\t= isset($_POST['quantity'])\t? abs((int)$_POST['quantity']) : 1;\n\t\n\t\t$quantity = $quantity <= 0 ? 1 : $quantity;\n\t\t\n\t\t# есть ли такой товар\n\t\t$product = $this->productModel->getProduct($id);\n\n\t\tif ( ! $product){return 1;}\n\n\t\t# аня попросила внести категорию в заказ\n\t\t$product->parent = $this->categoryModel->getCategory($product->parent);\n\t\t\n\t\t# если есть цена-размер\n\t\tif ($product->prices){\n\t\t\t# если неверный размер(кто-то балуется)\n\t\t\tif ( ! isset($product->prices[$filter_item_id])) return;\n\t\t\t\n\t\t\tif ($type == 0){\n\t\t\t\t$price = $product->prices[$filter_item_id]->roz;\n\t\t\t}elseif($type == 1){\n\t\t\t\t$price = $product->prices[$filter_item_id]->opt;\n\t\t\t}else{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\t$price = $product->price;\n\t\t}\n\t\t\n\t\t# если цена равна нулю - выходим\n\t\tif ( ! $price) return;\n\t\t\n\t\t# опции\n\t\t$options = array(\n\t\t\t'type'=>$type,\n\t\t\t'size'=>$filter_item_id \n\t\t);\n\n\t\t$data = array(\n\t\t\t'id'\t\t\t\t=> $product->id,\n\t\t\t'qty'\t\t\t\t=> $quantity,\n\t\t\t'price'\t\t\t\t=> $price,\n\t\t\t'options'\t\t\t=> $options,\n\t\t\t\n\t\t\t'discount'\t\t\t=> $product->discount*1 ? $product->discount : (isset($product->prices[$filter_item_id]) ? $product->prices[$filter_item_id]->discount : 0),\n\t\t\t'prices'\t\t\t=> isset($product->prices[$filter_item_id]) ? (array)$product->prices[$filter_item_id] : '',\n\t\t\t\n\t\t\t'parent'\t\t\t=> $product->parent,\n\t\t\t'manufacturer'\t\t=> isset($product->manufacturer->name) ? $product->manufacturer->name : '&mdash;',\n\t\t\t'manufacturer_id'\t=> $product->manufacturer_id,\n\t\t\t'name'\t\t\t\t=> $product->name,\n\t\t\t'image'\t\t\t\t=> $product->image,\n\t\t\t'url'\t\t\t\t=> $product->url,\n\t\t\t'_url'\t\t\t\t=> $product->_url\n\t\t);\n\t\t\n\t\t$this->cart->insert($data);\n\t}", "public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}", "public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}", "public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "function add_item_to_cart( $prodId = null ) {\n if ( null != $prodId && is_numeric( $prodId ) ) {\n\n // Probably should sql check database to see\n // if product exisits.\n\n if( $_SESSION[\"cart\"][$prodId] ) {\n $_SESSION[\"cart\"][$prodId]++;\n }\n else {\n $_SESSION[\"cart\"][$prodId] = 1;\n }\n }\n}", "function cart(){\n\n\tif(isset($_GET['add_cart'])){\n\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp();\n\t\t//t($ip);\n\t\t$pro_id = $_GET['add_cart'];\n $pro_stock=sqlsel1('products','product_id',$pro_id,'stock');\n //$pro_qty=sqlsel1('cart','p_id',$pro_id,'qty');\n //t($pro_stock);\n if(isloggedin()){\n $c_id=$_SESSION['cid'];\n\t\t\t$check_pro = \"select * from cart where customer_id='$c_id' AND p_id='$pro_id'\";\n\t\t}\n else{\n $check_pro = \"select * from cart where ip_add='$ip' AND customer_id='0' AND p_id='$pro_id'\";\n\t\t}\n \n\t\t$run_check = mysqli_query($con, $check_pro); \n\t\twhile($items=mysqli_fetch_array($run_check)){\n\t\t $pro_qty=$items['qty'];\n\t\t}\n\t\tif(mysqli_num_rows($run_check)!=0){\n\t\t\t\n\t\t\t\t\n\t\t if(isset($_GET['add_cart_count'])){\n\t\t $count=$_GET['add_cart_count'];\n\t\t \n\t\t\t}\n\t\t else{\n\t\t $count=1;\n\t\t }\n\t\t\t//$new_count=$pro_qty+$count;\n\t\t\tif($count>$pro_stock){\n\t\t\t print_text('Μή αρκετό απόθεμα!','error');\n\t\t\t exit();\n\t\t\t}\n\t\t\telse if($count<-1){\n\t\t\t exit();\n\t\t\t}\n\t\t\t\n\t\t\tif(isloggedin()){\n\t\t\t //$c_id=$_SESSION['cid'];\n\t\t\t \n\t\t\t $update_pro =\"update cart set qty=qty+$count where customer_id='$c_id' AND p_id='$pro_id' \";\n\t\t\t mysqli_query($con,$update_pro);\n\t\t\t}\n\t \telse{\n\t\t\t $update_pro =\"update cart set qty=qty+$count where ip_add='$ip' AND customer_id='0' AND p_id='$pro_id' \";\n\t\t\t mysqli_query($con,$update_pro);\n\t\t\t}\n\t \n\t $update_stock=\"update products set stock=stock-$count where product_id='$pro_id' \";\n\t\t mysqli_query($con,$update_stock);\n\t\t \n\t\t\techo \"<script>window.open('cart.php','_self')</script>\";\n\t\t}\n\t\t\t\n\t\t\t//echo \"<script>alert('$a $b $c')</script>\";\n\t\t\n \telse {\n \t if($pro_stock<=0){\n print_text('Μη αρκετό απόθεμα!','error');\n exit();\n }\n \n \t\tif(isloggedin()){\n \t\t $c_id=$_SESSION['cid'];\n \t\t $insert_pro = \"insert into cart (p_id,ip_add,qty,customer_id) values ('$pro_id','$ip','1','$c_id')\";\n \t\t $run_pro = mysqli_query($con, $insert_pro); \n \t\t \n \t\t}\n \t\telse{\n \t\t $insert_pro = \"insert into cart (p_id,ip_add,qty,customer_id) values ('$pro_id','$ip','1','0')\";\n \t\t $run_pro = mysqli_query($con, $insert_pro); \n \t\t \n \t\t}\n \t\t\n\t $update_stock=\"update products set stock=stock-1 where product_id='$pro_id' \";\n\t\t mysqli_query($con,$update_stock);\n\t\t \n \t\techo \"<script>window.open('eshop.php','_self')</script>\";\n \t}\n \n \n \n \t\n\t}\t\n \n}", "function totalItems() {\n if(isset($_GET['add_cart'])) {\n\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\");\n\n $count_items = mysqli_num_rows($run_items);\n\n } else {\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\") or die(mysqli_error($con));\n\n $count_items = mysqli_num_rows($run_items);\n\n while($get_items = mysqli_fetch_array($run_items)) {\n\n $pro_qty = $get_items['qty'];\n if($pro_qty > 1) {\n $count_items = $count_items + $pro_qty - 1;\n }\n }\n }\n\n echo $count_items;\n\n }", "public function getQty();", "public function getQty();", "public function addProduct(Product $product, $quantity);", "public function updateQuantity(int $quantity)\n {\n $newQuantity = $quantity - $this->quantity();\n $item = $this->items->first();\n $item->quantity = $item->quantity + $newQuantity;\n $item->save();\n }", "public function addtocartAction()\n\t{\n\t\trequire_once './app/Mage.php';\n\t\tMage::app('default');\n\n $params = array();\n\t\t$uid = $this->getRequest()->getPost('uid');\n $pid = $this->getRequest()->getPost('pid');\n\t\t$pqty = $this->getRequest()->getPost('qty');\n $size = $this->getRequest()->getPost('size');\n $params['cptions']['size_clothes'] = $size;\n\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n $entity_id = $rowArray['entity_id'];\n\n $select = $connectionRead->select()\n ->from('sales_flat_quote_item', array('*'))\n ->where('quote_id=?', $entity_id)\n ->where('product_id=?', $pid);\n\n $rowItems = $connectionRead->fetchAll($select);\n\n $qtycount = 0;\n $items = array();\n foreach ($rowItems as $item) {\n if ($item['price'] != 0) {\n $qty2 = number_format($item['qty'],0);\n $qtycount += $qty2;\n }\n }\n\n $_product = Mage::getModel('catalog/product')->load($pid);\n\n $qty = 0;\n $min = (float)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getNotifyStockQty();\n\n if ($_product->isSaleable()) {\n if ($_product->getTypeId() == \"configurable\") {\n $associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();\n foreach ($associated_products as $assoc){\n $assocProduct = Mage::getModel('catalog/product')->load($assoc->getId());\n $qty += (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($assocProduct)->getQty();\n }\n } elseif ($_product->getTypeId() == 'grouped') {\n $qty = $min + 1;\n } elseif ($_product->getTypeId() == 'bundle') {\n $associated_products = $_product->getTypeInstance(true)->getSelectionsCollection(\n $_product->getTypeInstance(true)->getOptionsIds($_product), $_product);\n foreach($associated_products as $assoc) {\n $qty += Mage::getModel('cataloginventory/stock_item')->loadByProduct($assoc)->getQty();\n }\n } else {\n $qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();\n }\n }\n\n $response = array();\n\n $checkqty = $qtycount + $pqty;\n\n /*if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }*/\n\n $params['product_id'] = $pid;\n $params['qty'] = $pqty;\n\n if ($_product->getTypeId() == \"configurable\" && isset($params['cptions'])) {\n\n // Get configurable options\n $productAttributeOptions = $_product->getTypeInstance(true)\n ->getConfigurableAttributesAsArray($_product);\n\n foreach ($productAttributeOptions as $productAttribute) {\n $attributeCode = $productAttribute['attribute_code'];\n\n if (isset($params['cptions'][$attributeCode])) {\n $optionValue = $params['cptions'][$attributeCode];\n\n foreach ($productAttribute['values'] as $attribute) {\n if ($optionValue == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n //$params['options'][$productAttribute['attribute_id']] = $attribute['value_index'];\n }\n }\n }\n else{\n foreach ($productAttribute['values'] as $attribute) {\n if (trim($size) == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n }\n }\n }\n }\n }\n\n unset($params['cptions']);\n\n //$childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes(151, $_product);\n\n try {\n\n $customerData = Mage::getModel('customer/customer')->load($uid)->getData();\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n if(!empty($rowArray))\n {\n $entity_id = $rowArray['entity_id'];\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuerys = \"SELECT * FROM sales_flat_quote_item WHERE quote_id =\".$rowArray['entity_id'].\" AND product_id = \".$pid.\" ORDER BY item_id DESC\";\n $rowArrays = $db_write->fetchRow($sqlQuerys);\n\n if(!empty($rowArrays))\n {\n if($rowArrays['product_type'] == 'configurable')\n {\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE parent_item_id =\".$rowArrays['item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n //check Quantity count\n //$sqlQuantity = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n //$rowArrayqnt = $db_write->fetchRow($sqlQuantity);\n\n $checkqty = number_format($rowArrays['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrayss['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n\n if($rowArrays['product_type'] == 'simple')\n {\n if($rowArrays['parent_item_id'] != NULL)\n {\n //check Quantity count\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n $checkqty = number_format($rowArrayss['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrays['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='simple'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n\n }\n }\n else\n {\n if($_product->getTypeId() == \"configurable\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWri->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$sname.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`='0',`base_price`='0',`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`='0',`base_row_total`='0',`row_total_with_discount`='0',`row_weight`='0.0000',`product_type`='simple',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`='',`base_price_incl_tax`='',`row_total_incl_tax`='',`base_row_total_incl_tax`='',`hidden_tax_amount`='',`base_hidden_tax_amount`='',`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n if($_product->getTypeId() == \"simple\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','simple',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n $cart = Mage::getModel('checkout/cart');\n $cart->init();\n $cart->addProduct($_product, $params);\n $cart->save();\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuery = \"SELECT quote_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArray = $db_write->fetchRow($sqlQuery);\n $entity_id = $rowArray['quote_id'];\n\n $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n //Update customer Id\n $date = date('Y-m-d h:i:s');\n $connectionWrite->query(\"update sales_flat_quote set customer_id = '\".$uid.\"', customer_email = '\".$customerData['email'].\"',customer_firstname = '\".$customerData['firstname'].\"',customer_lastname = '\".$customerData['lastname'].\"',customer_gender = '\".$customerData['gender'].\"', updated_at = '\".$date.\"' WHERE entity_id = \".$entity_id);\n }\n\n $connectionWrites = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $connectionWrites->query(\"update sales_flat_quote_address set customer_id = '\".$uid.\"', email = '\".$customerData['email'].\"',firstname = '\".$customerData['firstname'].\"',lastname = '\".$customerData['lastname'].\"' WHERE quote_id = \".$entity_id);\n\n $response['msg'] = 'Product added in cart';\n $response['status'] = 1;\n }\n catch (Exception $e) {\n\n $response['msg'] = $e->getMessage();\n $response['status'] = 0;\n }\n\n\n\t\techo json_encode($response);\n\t}", "public function add() {\n $page = 'basket';\n $id = $_GET['id'];\n\n $product = $this->productManager->findOne($id);\n\n $productInBasket = $this->inBasket($id); //check if the product is in the basket\n\n if(!empty($product) && isset($_SESSION['user']['basket'])) {\n if ($productInBasket)\n $_SESSION['user']['basket'][$id]['quantity']++;\n else\n $_SESSION['user']['basket'][$id] = array(\"product\" => $product, \"quantity\" => 1);\n }\n\n header(\"Location: ./index.php?ctrl=basket&action=consult\");\n require('./View/default.php');\n }", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "public function astra_add_cart_single_product_quantity() {\n\n\t\t\tcheck_ajax_referer( 'single_product_qty_ajax_nonce', 'qtyNonce' );\n\n\t\t\t$cart_item_key = sanitize_text_field( $_POST['hash'] );\n\n\t\t\t$threeball_product_values = WC()->cart->get_cart_item( $cart_item_key );\n\n\t\t\t$threeball_product_quantity = apply_filters(\n\t\t\t\t'woocommerce_stock_amount_cart_item',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'woocommerce_stock_amount',\n\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t'/[^0-9\\.]/',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tfilter_var( $_POST['quantity'], FILTER_SANITIZE_NUMBER_INT )\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$passed_validation = apply_filters(\n\t\t\t\t'woocommerce_update_cart_validation',\n\t\t\t\ttrue,\n\t\t\t\t$cart_item_key,\n\t\t\t\t$threeball_product_values,\n\t\t\t\t$threeball_product_quantity\n\t\t\t);\n\n\t\t\tif ( $passed_validation ) {\n\t\t\t\tWC()->cart->set_quantity(\n\t\t\t\t\t$cart_item_key,\n\t\t\t\t\t$threeball_product_quantity,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdie();\n\t\t}", "public function addItem(Cart $cart, CartItem $item);", "function updateItemQuantity($index, $amount)\n {\n $_SESSION['cart'][$index]['quantity'] += $amount;\n $_SESSION['cart'][$index]['total'] += $_SESSION['cart'][$index]['price'] * $amount;\n if ($_SESSION['cart'][$index]['quantity'] == 0) {\n unset($_SESSION['cart'][$index]);\n $_SESSION['cart'] = array_values($_SESSION['cart']);\n }\n }", "public function add_item(Request $request)\n {\n $user = $request->user();\n $cart = $user->cart()->first();\n\n $validatedData = $request->validate([\n 'id' => 'required|integer',\n 'qty' => 'required|integer',\n ]);\n\n $product = Product::find($validatedData['id']);\n\n if (!$cart) {\n $cart = Cart::create([\n 'user_id' => $user->id,\n ]);\n $cart->items()->create([\n 'product_id' => $product->id,\n 'qty' => $validatedData['qty'],\n 'item_sub_total' => $product->price * $validatedData['qty'],\n ]);\n $cart->cart_sub_total = Cart::total($cart->items()->get()->toArray());\n $cart->save();\n $response = [\n 'items' => CartItemCollection::collection(CartItem::where('cart_id', $cart->id)->get()),\n 'total' => $cart->cart_sub_total,\n ];\n return response()->json($response);\n }\n\n $items = $cart->items()->get();\n\n if (in_array($validatedData['id'], array_column($items->toArray(), 'product_id'))) {\n $key = array_search($validatedData['id'], array_column($items->toArray(), 'product_id'));\n $obj = $cart->items()->find($items[$key]['id']);\n $obj->qty += $validatedData['qty'];\n $obj->item_sub_total = $product->price * $obj->qty;\n $obj->save();\n } else {\n $cart->items()->create([\n 'product_id' => $product->id,\n 'qty' => $validatedData['qty'],\n 'item_sub_total' => $product->price * $validatedData['qty'],\n ]);\n }\n\n $cart->cart_sub_total = Cart::total(CartItem::where('cart_id', $cart->id)->get()->toArray());\n\n $cart->save();\n\n $response = [\n 'items' => CartItemCollection::collection(CartItem::where('cart_id', $cart->id)->get()),\n 'total' => $cart->cart_sub_total,\n ];\n\n return response()->json($response);\n }", "public function updateQuantity(Request $request)\n {\n $cart = $request->session()->get('pos.cart', collect([]));\n $cart = $cart->map(function ($object, $key) use ($request) {\n if($key == $request->key){\n $product = \\App\\Product::find($object['id']);\n $product_stock = $product->stocks->where('id', $object['stock_id'])->first();\n\n if($product_stock->qty >= $request->quantity){\n $object['quantity'] = $request->quantity;\n }else{\n return array('success' => 0, 'message' => translate(\"This product doesn't have more stock.\"), 'view' => view('pos.cart')->render());\n }\n }\n return $object;\n });\n $request->session()->put('pos.cart', $cart);\n\n return array('success' => 1, 'message' => '', 'view' => view('pos.cart')->render());\n }", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "public function calculateQtyToShip();", "public function addToCart(Request $req)\n {\n if($req->session()->has('user'))\n { \n \n $user_id = Session::get('user')['id'];\n $cartId = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('id')->first();\n \n \n\n if(isset($cartId))\n {\n\n $cartdetail = new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = $req->weight;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n \n $tot_cost = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('total_cost')->first();\n \n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n \n \n // echo \"<pre>\";\n // print_r($qty);\n // die();\n\n Cart::where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->update(['total_cost' => ($qty * $req->price) + $tot_cost]);\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n \n // echo \"<pre>\";\n // print_r($qty_before);\n // die();\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n else\n {\n $cart= new Cart;\n $cart->user_id = $user_id;\n $cart->save();\n $cartId=$cart->id;\n\n \n $cartdetail= new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = 5;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n\n $cart->total_cost = $req->quantity * $req->price;\n \n $cart->save();\n\n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n return redirect ('/cart');\n\n }\n else\n { \n\n return redirect ('/home');\n }\n }", "public function addToCart($product, $qty = 1){\n // Create Cart\n // if Product has in Cart, add + qty\n if(isset($_SESSION['cart'][$product->id])){\n $_SESSION['cart'][$product->id]['qty'] += $qty;\n } else { // if not in Cart, create\n $_SESSION['cart'][$product->id] = [\n 'qty' => $qty,\n 'name' => $product->name,\n 'price' => $product->price,\n 'img' => $product->img\n ];\n }\n // Total Qty\n // if isset Qty or if not\n $_SESSION['cart.qty'] = isset( $_SESSION['cart.qty'])\n ? $_SESSION['cart.qty'] + $qty\n : $qty;\n // Total Sum\n $_SESSION['cart.sum'] = isset($_SESSION['cart.sum'])\n ? $_SESSION['cart.sum'] + $qty * $product->price\n : $qty * $product->price;\n\n }", "public function addItemToCart( $map) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id']);\r\n\t\t\t$this->db->select('COUNT(*) as count')->from(TABLES::$ORDER_CART)->where($params);\r\n\t \t$query = $this->db->get();\r\n\t \t$result = $query->result_array();\r\n\t\t\tif($result[0]['count'] <=0 ) {\r\n\t\t\t\t$this->db->insert(TABLES::$ORDER_CART,$map);\r\n\t\t\t}else {\r\n\t\t\t\t$this->increaseItemQuantity( $map );\r\n\t\t\t}\r\n\t\t\treturn $map;\r\n\t\t}", "public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }", "function item_add_to_cart_table($conx, $uid, $stock, $p, $q)\n{\n\t//if it is on cart update the quantity\n\t//else add a new record to cart table\n\n\t$product_cart_check_result = mysqli_query($conx, \"SELECT * FROM cart WHERE cart_user='$uid' && cart_product='$p'\");\n\n\t//if already exist\n\tif(mysqli_num_rows($product_cart_check_result)>0)\n\t{\n\t\t$cart_data = mysqli_fetch_array($product_cart_check_result);\n\t\t$cart_id = $cart_data[\"cart_id\"];\n\t\t$cart_quantity = $cart_data[\"cart_quantity\"];\n\t\t$qo = intval($cart_quantity);\n\n\t\t$qt = $qo + $q;\n\t\tif($qt>$stock)\n\t\t{\n\t\t\t$msg = \"fail: Can't Add $q Items into cart $qo elements already in cart only have $stock elements in stock\";\n\t\t\techo $msg;\n\t\t\treturn $msg;\n\t\t}else\n\t\t{\n\t\t\t$pro_cart_update_query = \"UPDATE cart SET cart_quantity='$qt' WHERE cart_id='$cart_id'\";\n\t\t\t$pro_cart_update_result = mysqli_query($conx, $pro_cart_update_query);\n\t\t\tif(mysqli_affected_rows($conx)>0)\n\t\t\t{\n\t\t\t\t$msg = \"success: $q Items added to cart\";\n\t\t\t\techo $msg;\n\t\t\t\treturn $msg;\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$msg = \"fail: cant't update the cart\";\n\t\t\t\techo $msg;\n\t\t\t\treturn $msg;\n\t\t\t}\n\t\t}\n\n\t}else//if not exist\n\t{\n\t\t//set stock level and quantity\n\t\tif($stock>=$q)\n\t\t{\n\t\t\t$pro_cart_insert_query = \"\n INSERT INTO\n `ecommerce`.`cart` (\n\t `cart_id`,\n `cart_user`,\n `cart_product`, \n `cart_quantity`\n )\n VALUES \n\t (\n NULL,\n '$uid',\n '$p',\n '$q')\n \";\n\t\t\t$pro_cart_insert_result = mysqli_query($conx, $pro_cart_insert_query);\n\t\t\tif(mysqli_affected_rows($conx)>0)\n\t\t\t{\n\t\t\t\t$msg = \"success: $q Items added to cart\";\n\t\t\t\techo $msg;\n\t\t\t\treturn $msg;\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$msg = \"fail: Can't Add $q Items into cart because only have $stock products in stock\";\n\t\t\techo $msg;\n\t\t\treturn $msg;\n\t\t}\n\t}\n}", "public function cartIncrement($id,$qty){\n Cart::update($id,$qty+1);\n return redirect()->back()->with('info','One Product in added in cart');\n }", "function json_add_post() {\n\n\n $status = 0;\n $message = \"Product not processed successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n $json_qty = $this->post('json_qty');\n $json_encode_array = json_decode($json_qty, true);\n $flag = false;\n $processed_items = 0;\n foreach ($json_encode_array as $key => $value) {\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $key);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $flag = true;\n $processed_items++;\n }\n } else {\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $flag = true;\n $processed_items++;\n }\n }\n }\n\n\n\n\n\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n if ($flag) {\n $status = 1;\n $message = $processed_items . \" Items Processed Successfully\";\n }\n\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "public function addquantity(UpdateQuantityRequest $request){\n $array=$request->only('id');\n $product=Product::find($array['id']);\n $array=$request->only('quantity');\n $product->quantity+=$array['quantity'];\n $product->save();\n return back()->with('msg','Add quantity is successful for '.$product->name)->with('attribute','success');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'quantity'=>['required','numeric','min:1','max:10']\n ]);\n\n $input=$request->all();\n $id= $input['mealId'];\n $data=Meal::find($id);\n\n $data['quantity']=$input['quantity'];\n \n \n \n $add=Cart::add([\n 'id'=>$id,\n 'name'=>$data['title'],\n 'price'=>$data['price'],\n 'quantity'=>$data['quantity'], \n 'attributes' =>array(\n 'totalprice' =>$input['quantity']*$data['price'],\n 'image' =>$data['image'])]);\n \n return redirect(route('Shoping.index'));\n \n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public static function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['bookCart'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['bookCart'][$key]);\n } else {\n $_SESSION['bookCart'][$key]['qty'] = $quantity;\n $total = $_SESSION['bookCart'][$key]['cost'] *\n $_SESSION['bookCart'][$key]['qty'];\n $_SESSION['bookCart'][$key]['total'] = $total;\n }\n }\n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public function getTotalQtyOrdered();", "public function addCart($id, Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n //dd($carts);\n // trùng product\n $quantity = $request->quantity;\n if (!empty($carts)) {\n foreach ($carts as $cart) {\n if($cart['id'] == $id){\n $newQuantity = $cart['quantity'];\n $quantity += $newQuantity;\n }\n }\n }\n else{\n $quantity = $request->quantity;\n }\n // dd( $quantityNew);\n\n //// get quantity from Form Request\n // $quantity = $request->quantity;\n\n // get quantity from data\n $product = Product::findOrFail($id);\n $quantityDB = $product->quantity;\n\n if ($quantity <= $quantityDB) {\n $Product = [\n 'id' => $id,\n 'quantity' => $quantity,\n 'price_id' => $request->price_id,\n 'promotion_id' => $request->promotion_id\n ];\n\n $carts[$id] = $Product;\n // set data for SESSION\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->route('cart.cart-info')\n ->with('success', 'Add Product to Cart successful!');\n\n }else{\n return redirect()->back()->with('error','Please re-enter the quantity!');\n }\n }", "public function add($fruit) {\r\n \r\n // We get the number of $fruit in the basket\r\n // +1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty + 1;\r\n }", "public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function cart_add($pk_watch_id){\n\t\t if(isset($_SESSION['cart'][$pk_watch_id])){\n\t\t //nếu đã có sp trong giỏ hàng thì số lượng lên 1\n\t\t $_SESSION['cart'][$pk_watch_id]['number']++;\n\t\t } else {\n\t\t //lấy thông tin sản phẩm từ CSDL và lưu vào giỏ hàng\n\t\t $watch = model::get_a_record(\"select * from product_watch where pk_watch_id=$pk_watch_id\");\n\t\t \n\t\t $_SESSION['cart'][$pk_watch_id] = array(\n\t\t 'pk_watch_id' => $pk_watch_id,\n\t\t 'name_watch' => $watch->name_watch,\n\t\t 'img_watch' => $watch->img_watch,\n\t\t 'number' => 1,\n\t\t 'price_watch' => $watch->price_watch,\n\t\t );\n\t\t }\n\t\t}", "public function add(Article $article, $quantity);", "public function getQuantity(): int\n {\n return $this->quantity;\n }", "function cart(){\n\tif(isset($_GET['add_cart'])){\n\t\tglobal $connection;\n\t\t$ip=getIp();\n\t\t$product_id\t= $_GET['add_cart'];\n\t\t\t $quantity = 0;\n\t\t$check_product = \"select * from cart where ip_address='$ip' AND product_id='$product_id'\";\n\t\t$run_check = mysqli_query($connection,$check_product);\n\t\t\n\t\tif(mysqli_num_rows($run_check)>0){\n\t\t\techo \"\";\n\t\t\t\n\t\t}else{\n\t\t\t$insert_product = \"insert into cart (product_id,ip_address,quantity) values ('$product_id','$ip','$quantity')\";\n\t\t\t$run_product = mysqli_query($connection,$insert_product);\n\t\t\techo\"<script>window.open('index.php','_self')</script>\";\n\t\t}\n\t}\n}", "function addToCart()\n{\n\t// make sure the product id is in get, redirect otherwise.\n\tif (isset($_GET['p']) && (int)$_GET['p'] > 0) {\n\t\t$productID = (int)$_GET['p'];\n\t} else {\n\t\theader('Location: ./storeIndex.php');\n\t}\n\t\n\t// check if the product is in the database.\n\t$sql = \"SELECT ItemID, Quantity\n\t FROM Items\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) != 1) {\n\t\t// the product doesn't exist\n\t\theader('Location: ./cart.php');\n\t} else {\n\t\t//Check stock\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$currentStock = $row['Quantity'];\n\n\t\tif ($currentStock == 0) {\n\t\t\t// Out of stock item, show error.\n\t\t\tsetError('The product you requested is no longer in stock');\n\t\t\theader('Location: ./cart.php');\n\t\t\texit;\n\t\t}\n\n\t}\t\t\n\t\n\t//Check if items is already in cart, and if so, update quantity.\n\t$sql = \"SELECT ItemID\n\t FROM Cart\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t// put the product in the cart \n\t\t$sql = \"INSERT INTO Cart (ItemID, Quantity)\n\t\t\t\tVALUES ($productID, 1)\";\n\t\t$result = query($sql);\n\t} else {\n\t\t// update product quantity in the cart\n\t\t$sql = \"UPDATE Cart\n\t\t SET Quantity = Quantity + 1\n\t\t\t\tWHERE ItemID = $productID\";\t\t\n\t\t\t\t\n\t\t$result = query($sql);\t\t\n\t}\t\n\t\t\n\theader('Location: ' . $_SESSION['shop_return_url']);\t\t\t\t\n}", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function add($product, $quantity = 1)\n\t{\n\t\t$item = [\n\t\t\t'id' => $product->id,\n\t\t\t'name' => $product->name,\n\t\t\t'price' => ($product->promotionprice != 0) ? $product->promotionprice : $product->unitprice,\n\t\t\t'image' => $product->image,\n\t\t\t'quantity' => $quantity,\n\t\t];\n\n\t\tif(isset($this->items[$product->id])){\n\t\t\t$this->items[$product->id]['quantity'] += $quantity;\n\t\t}else{\n\t\t\t$this->items[$product->id] = $item;\n\t\t}\n\t\t\n\t\tsession(['cart' => $this->items]);\n\t\t//dd($this->items);\n\t}", "public function addItemToCart( $item ){\n $this->cartItems[] = $item;\n Cart::updateTotalPrice();\n }", "public function changeQuantityItemToCart(Request $request)\n {\n return $this->repository->changeQuantityItemToCart($request);\n }", "public function setQty($qty);", "public function add($id)\n {\n \tif(empty($this->items))\n \t{\n \t\t$item = new ShoppingItem($id,1);\n\t\t\t$this->session->push(self::SHOPPINGCART, $item);\n\t\t\t$this->items[] = $item;\n \t}else\n \t{\n \n \t\tif($this->getItem($id))\n \t\t{\n \t\t\t$item = $this->getItem($id);\n \t\t\t$item->quantity += 1;\n \t\t}\n else\n {\n \t\t$item = new ShoppingItem($id,1);\n \t\t$this->session->push(self::SHOPPINGCART,$item);\n \t\t$this->items[] = $item;\n }\n \t} \n \t\n }", "public function addCart(Request $req){\n $id = $req->id;\n $num = $req->num;\n $product = Product::find($id);\n\n $add = array(\n 'num'=>$num,'product'=>$product\n );\n $list_pro = Session::get('product');\n $c = 0;\n if($list_pro != null){\n foreach ($list_pro as $key => $value) {\n if($id == $value['product']->id){\n $c++;\n $list_pro[$key]['num'] = $num;\n }\n }\n }\n if($c == 0 ){\n Session::push('product',$add);\n }else{\n Session::set('product',$list_pro);\n }\n\n $list_pro = Session::get('product');\n if(sizeof($product)){\n $total = 0;\n foreach ($list_pro as $key => $item) {\n # code...\n $price = $item['product']->price;\n if($item['product']->price_sale){\n $price = $item['product']->price_sale;\n }\n $price = $price;\n $total += $price * $item['num'];\n }\n $text = number_format((int)$total,0,'','.').\"đ\";\n $view = view('frontend.ajax.addCart',['product'=>$product,'num'=>$num,'list_pro'=>$list_pro]);\n\n return json_encode(array('status'=>true,'product'=>$product,'session'=>$list_pro,'total'=>$text,'html'=>$view.\"\"));\n }\n return json_encode(array('status'=>true,'product'=>null));\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function add() {\n\t\t$this->load->language('checkout/cart');\n\n\t\t$json = array();\n\n\t\tif (isset($this->request->post['product_id'])) {\n\t\t\t$product_id = (int)$this->request->post['product_id'];\n\t\t} else {\n\t\t\t$product_id = 0;\n\t\t}\n\n\t\t$this->load->model('catalog/product');\n\n\t\t$product_info = $this->model_catalog_product->getProduct($product_id);\n\n\t\tif ($product_info) {\n\t\t\tif (isset($this->request->post['quantity']) && ((int)$this->request->post['quantity'] >= $product_info['minimum'])) {\n\t\t\t\t$quantity = (int)$this->request->post['quantity'];\n\t\t\t} else {\n\t\t\t\t$quantity = $product_info['minimum'] ? $product_info['minimum'] : 1;\n\t\t\t}\n\t\t\tif (isset($this->request->post['option'])) {\n\t\t\t\t$option = array_filter($this->request->post['option']);\n\t\t\t} else {\n\t\t\t\t$option = array();\n\t\t\t}\n\n\t\t\t$product_options = $this->model_catalog_product->getProductOptions($this->request->post['product_id']);\n\n\t\t\tforeach ($product_options as $product_option) {\n\t\t\t\tif ($product_option['required'] && empty($option[$product_option['product_option_id']])) {\n\t\t\t\t\t$json['error']['option'][$product_option['product_option_id']] = sprintf($this->language->get('error_required'), $product_option['name']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($this->request->post['recurring_id'])) {\n\t\t\t\t$recurring_id = $this->request->post['recurring_id'];\n\t\t\t} else {\n\t\t\t\t$recurring_id = 0;\n\t\t\t}\n\n\t\t\t$recurrings = $this->model_catalog_product->getProfiles($product_info['product_id']);\n\n\t\t\tif ($recurrings) {\n\t\t\t\t$recurring_ids = array();\n\n\t\t\t\tforeach ($recurrings as $recurring) {\n\t\t\t\t\t$recurring_ids[] = $recurring['recurring_id'];\n\t\t\t\t}\n\n\t\t\t\tif (!in_array($recurring_id, $recurring_ids)) {\n\t\t\t\t\t$json['error']['recurring'] = $this->language->get('error_recurring_required');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$json) {\n\t\t\t\tif(isset($this->session->data['cart'])) {\n$oldCart = $this->session->data['cart']; \n}\n$this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);\n\t\t\t\t/*\n\t\t\t\t // BOF - Betaout Opencart mod\n $this->load->model('tool/betaout');\n //$this->model_tool_betaout->track();\n $this->model_tool_betaout->trackEcommerceCartUpdate();\n // EOF - Betaout Opencart mod\n\t\t\t\t*/\n\n\t\t\t\t$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'));\n\n$this->load->model('setting/setting');\n$giftTeaser = $this->model_setting_setting->getSetting('giftteaser', $this->config->get('config_store_id'));\nif (empty($giftTeaser['giftteaser']['Enabled']) || $giftTeaser['giftteaser']['Enabled'] == 'no') { } else {\n$this->load->language('extension/module/giftteaser');\n$addition = '';\nforeach ($this->cart->getProducts() as $key => $val) {\nif (!empty($val['gift_teaser']) && $val['gift_teaser']==true ) {\nif (!isset($this->session->data['success_addition'])) {\n$addition = $this->language->get('gift_added_to_cart');\n}\n}\n}\t\n$json['success'] .= $addition;\t\n}\n\n$this->register_abandonedCarts();\n\t\t\t\t// Unset all shipping and payment methods\n\t\t\t\tunset($this->session->data['shipping_method']);\n\t\t\t\tunset($this->session->data['shipping_methods']);\n\t\t\t\tunset($this->session->data['payment_method']);\n\t\t\t\tunset($this->session->data['payment_methods']);\n\n\t\t\t\t// Totals\n\t\t\t\t$this->load->model('extension/extension');\n\n\t\t\t\t$totals = array();\n\t\t\t\t$taxes = $this->cart->getTaxes();\n\t\t\t\t$total = 0;\n\t\t\n\t\t\t\t// Because __call can not keep var references so we put them into an array. \t\t\t\n\t\t\t\t$total_data = array(\n\t\t\t\t\t'totals' => &$totals,\n\t\t\t\t\t'taxes' => &$taxes,\n\t\t\t\t\t'total' => &$total\n\t\t\t\t);\n\n\t\t\t\t// Display prices\n\t\t\t\tif ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\t$results = $this->model_extension_extension->getExtensions('total');\n\n\t\t\t\t\tforeach ($results as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $this->config->get($value['code'] . '_sort_order');\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $results);\n\n\t\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\t\tif ($this->config->get($result['code'] . '_status')) {\n\t\t\t\t\t\t\t$this->load->model('extension/total/' . $result['code']);\n\n\t\t\t\t\t\t\t// We have to put the totals in an array so that they pass by reference.\n\t\t\t\t\t\t\t$this->{'model_extension_total_' . $result['code']}->getTotal($total_data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\tforeach ($totals as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $value['sort_order'];\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $totals);\n\t\t\t\t}\n\n\t\t\t\t$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total, $this->session->data['currency']));\n\t\t\t} else {\n\t\t\t\t$json['redirect'] = str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));\n\t\t\t}\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function getQuantity(){\n return $this->quantity;\n }", "public function productquantity() {\n\n $this->checkPlugin();\n\n if ($_SERVER['REQUEST_METHOD'] === 'PUT') {\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProductsQuantity($requestjson);\n } else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n } else {\n $json['success'] = false;\n $json['error'] = \"Invalid request method, use PUT method.\";\n $this->sendResponse($json);\n }\n }", "public function calculateItemQuantity($data){\n\t\textract($data);\n\t\tif ($mode == 'order' || $mode == 'pull') {\n\t\t\t$sell_qty = $this->Item->OrderItem->field('sell_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $sell_qty);\n\t\t} elseif ($mode == 'replenishment') {\n\t\t\t// we need the quantity per unit for this replenishment item\n\t\t\t$po_qty = $this->Item->ReplenishmentItem->field('po_quantity', array('id' => $rowId));\n\t\t\treturn $this->itemRecord['Item']['quantity'] + ($pullQty * $po_qty);\n\t\t}\n }", "public function update_cart_product_quantity($product_id, $cart_item_id, $quantity)\n {\n $cart = $this->session_cart_items;\n if (!empty($cart)) {\n foreach ($cart as $item) {\n if ($item->cart_item_id == $cart_item_id) {\n $item->quantity = $quantity;\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $cart);\n }", "public static function add_item($key, $quantity) {\n global $books;\n if ($quantity < 1) return;\n\n // If item already exists in cart, update quantity\n if (isset($_SESSION['bookCart'][$key])) {\n $quantity += $_SESSION['bookCart'][$key]['qty'];\n update_item($key, $quantity);\n return;\n }\n\n // Add item\n $book = BookDB::getBook($key);\n $cost = $book->getPrice();\n $total = $cost * $quantity;\n $item = array(\n 'title' => $book->getTitle(),\n 'author' => $book->getAuthor(),\n 'cost' => $cost,\n 'qty' => $quantity,\n 'total' => $total\n );\n $_SESSION['bookCart'][$key] = $item;\n }", "public function addItem(Item $item, $quantity = 1) {\n if(array_key_exists($item->getId(), $this->quantities)){\n $this->quantities[$item->getId()] += $quantity;\n }else{\n $this->quantities[$item->getId()] = $quantity;\n $this->items[] = $item;\n }\n }", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }", "public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }" ]
[ "0.7687511", "0.76343036", "0.75463665", "0.7534838", "0.7481758", "0.74796563", "0.74199957", "0.73658645", "0.73004246", "0.7198177", "0.7168723", "0.71537024", "0.70653754", "0.7063997", "0.70073694", "0.69964516", "0.6990444", "0.6987328", "0.6980304", "0.6980304", "0.6960298", "0.6954684", "0.69475603", "0.6944464", "0.6936798", "0.6933195", "0.69124234", "0.68669516", "0.6858448", "0.685266", "0.6834582", "0.6834582", "0.6834582", "0.6828029", "0.6827016", "0.6815669", "0.68139434", "0.68067676", "0.68066394", "0.6805269", "0.6801368", "0.6770544", "0.6759915", "0.6759736", "0.6757253", "0.6751205", "0.67508924", "0.67508924", "0.6748877", "0.67433006", "0.6742855", "0.6737096", "0.6734859", "0.671914", "0.67191", "0.6711231", "0.6702009", "0.6699126", "0.6698618", "0.6696497", "0.66900486", "0.66884834", "0.66837764", "0.6676911", "0.6674332", "0.666595", "0.6659536", "0.6642521", "0.66411364", "0.6638281", "0.6632043", "0.6630278", "0.66299933", "0.66291565", "0.6607709", "0.66062415", "0.6585127", "0.6581188", "0.65789586", "0.65736425", "0.65691286", "0.65669614", "0.6566083", "0.6559705", "0.6555407", "0.65551007", "0.65527016", "0.65363", "0.6528461", "0.6523223", "0.6508361", "0.6504367", "0.6497889", "0.6497852", "0.64975524", "0.64949363", "0.649222", "0.6491801", "0.64844584", "0.6484082", "0.64783657" ]
0.0
-1
Save all items to the cart
private function saveItems() { $this->storage->save($this->items); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function save(): void\n {\n if ($this->connection == 'database') {\n $this->cart->each(\n function ($item) {\n if ($cart = $this->storage->has($item['id'])) {\n $cart->update(\n [\n 'rowId' => $item['id'],\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n } else {\n $this->storage->create(\n [\n 'rowId' => $item['id'],\n 'user_id' => $this->user->id,\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n }\n }\n );\n } elseif ($this->sessionStatus) {\n $this->storage->put([$this->instanceName => $this->cart]);\n }\n }", "public function save() {\n $_SESSION['cart'] = $this->items;\n\n }", "public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' => serialize($this->_items)\n );\n //udpate order table\n if ($order_id) {\n $order_data['date_modified'] = date(\"Y-m-d H:i:s\");\n $this->_order->update($order_data, $order_id);\n } else {\n $order_data['date_added'] = date(\"Y-m-d H:i:s\");\n $order_id = $this->_order->save($order_data);\n }\n // echo $order_id; \n }", "public function save(): void\n {\n $this->session?->put('shop.cart', $this->toArray());\n }", "public function save()\n {\n $this->_user->setAttribute(\n 'cart_items',\n $this->_items,\n timpanyCart::SESSION_NS\n );\n }", "abstract protected function saveItems();", "public function save()\n {\n /** @var \\Illuminate\\Http\\Request $request */\n $request = App::make('request');\n $request->session()->put($this->collection->cart_name, $this->collection);\n }", "public function save()\n {\n Session::clear(\"Checkout.PostageID\");\n \n // Extend our save operation\n $this->extend(\"onBeforeSave\");\n\n // Save cart items\n Session::set(\n \"Checkout.ShoppingCart.Items\",\n serialize($this->items)\n );\n\n // Save cart discounts\n Session::set(\n \"Checkout.ShoppingCart.Discount\",\n serialize($this->discount)\n );\n\n // Update available postage\n if ($data = Session::get(\"Form.Form_PostageForm.data\")) {\n $country = $data[\"Country\"];\n $code = $data[\"ZipCode\"];\n $this->setAvailablePostage($country, $code);\n }\n }", "private function saveCart()\n\t{\n\t\t$totalPrice = $this->cart->calculateTotalPriceGross();\n\t\t$companyDetails = \\App\\User::getUser()->get('companyDetails');\n\t\tif (!empty($companyDetails) && isset($companyDetails['creditlimit']) && $totalPrice > ($companyDetails['creditlimit'] - $companyDetails['sum_open_orders'])) {\n\t\t\t$result = [\n\t\t\t\t'error' => \\App\\Language::translate('LBL_MERCHANT_LIMIT_EXCEEDED', 'Products'),\n\t\t\t];\n\t\t} else {\n\t\t\t$this->cart->save();\n\t\t\t$result = [\n\t\t\t\t'numberOfItems' => $this->cart->count(),\n\t\t\t\t'totalPriceNetto' => \\App\\Fields\\Currency::formatToDisplay($this->cart->calculateTotalPriceNetto()),\n\t\t\t\t'totalPriceGross' => \\App\\Fields\\Currency::formatToDisplay($totalPrice),\n\t\t\t\t'shippingPrice' => \\App\\Fields\\Currency::formatToDisplay($this->cart->getShippingPrice()),\n\t\t\t];\n\t\t}\n\n\t\t$response = new \\App\\Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}", "public function save(Cart $cart);", "public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }", "public function save() {\n $page = 'basket';\n $newbasket = $_POST;\n\n for($i = 0; $i<sizeof($newbasket['id']); $i++) {\n if ($newbasket['quantity'][$i] <= 0)\n unset($_SESSION['user']['basket'][$newbasket['id'][$i]]);\n else\n $_SESSION['user']['basket'][$newbasket['id'][$i]]['quantity'] = $newbasket['quantity'][$i];\n }\n\n //if the user wants to pay\n if($_POST['pay']) {\n $this->pay();\n header(\"Location: ./index.php?ctrl=basket&action=pay\");\n }\n else\n header(\"Location: ./index.php?ctrl=basket&action=consult\");\n\n require('./View/default.php');\n }", "public function update_all()\n\t{\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 update_all method of model to update all products info of cart\n\t\t$model->update_all($post);\n\t\t$this->_carthelper->cartFinalCalculation();\n\t\t$this->_carthelper->carttodb();\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}", "protected function save_cart(){\n $this->cart_contents['total_items'] = $this->cart_contents['cart_total'] = 0;\n foreach ($this->cart_contents as $key => $val){\n if(!is_array($val) OR !isset($val['precio'], $val['qty'])){\n continue;\n }\n $this->cart_contents['cart_total'] += ($val['precio'] * $val['qty']);\n $this->cart_contents['total_items'] += $val['qty'];\n $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['precio'] * $this->cart_contents[$key]['qty']);\n }\n \n // si el carrito está vacío, lo elimíno de la sesión\n if(count($this->cart_contents) <= 2){\n unset($_SESSION['cart_contents']);\n return FALSE;\n }else{\n $_SESSION['cart_contents'] = $this->cart_contents;\n return TRUE;\n }\n }", "public function save(array $items)\n {\n }", "public function store(StoreCartItemRequest $request)\n {\n//dd($request->all());\n $request->session()->put('seats_data', $request->seats_data);\n $data = isset($_POST) ? $_POST : '';\n $q = Cart::store($request->product_id, $request->qty, $request->options ?? [], $data);\n\n // echo \"<pre>\"; print_r($q->seats_data); exit('check');\n\n return back()->withSuccess(trans('cart::messages.added'));\n }", "function save(&$item_kit_items_data, $item_kit_id) {\n //Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n $this->delete($item_kit_id);\n \n foreach ($item_kit_items_data as $row) {\n $row['paket_id'] = $item_kit_id;\n $this->db->insert('paket_sofa_items', $row);\t\t\n }\n \n $this->db->trans_complete();\n return true;\n}", "public function submitCartAction()\n {\n $user = $this->getUser();\n $cart = $this->getDoctrine()\n ->getRepository('ArtSpaceShopBundle:CartItem')\n ->findByUser($user);\n \n // Transfere le caddie dans les commandes passées (PastOrder)\n $em = $this->getDoctrine()->getManager(); \n foreach($cart as $cartItem){\n $pastOrder = new PastOrder;\n $pastOrder->setProduct($cartItem->getProduct());\n $pastOrder->setUser($cartItem->getUser());\n $pastOrder->setQuantity($cartItem->getQuantity());\n $pastOrder->setDate(new \\DateTime);\n \n $em->persist($pastOrder);\n $em->remove($cartItem);\n }\n $em->flush();\n \n return $this->redirect($this->generateUrl('art_space_shop_cart'));\n }", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function action_purchaseCartItems()\n {\n $cartItems = $this->request->post('itemList');\n\n if(!is_null($cartItems))\n {\n $cartIds = explode(\"_\", $cartItems);\n $modelCartItems = new Model_CartItemInfo();\n try\n {\n for($i = 0; $i<count($cartIds)-1; $i++)\n $modelCartItems->purchaseItem($cartIds[$i]);\n }\n catch (Exception $e)\n {\n $this->request->status = 400;\n $this->request->response = View::factory('errors/400');\n }\n }\n else\n {\n $this->request->status = 406;\n $this->request->response = View::factory('errors/406');\n }\n\n //Need to redirect to print ticket page\n $authManager = new Manager_AuthManager();\n $authManager->addValueToSession('cartItemIds',$cartIds);\n $this->redirect('ticket/print');\n }", "public function insertUpdateStoreProductsInCart() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $store_id = func_get_arg(1);\n $product_id = func_get_arg(2);\n $quantity = func_get_arg(3);\n $allCartDetail = array();\n $success = null;\n $i = 0;\n $this->getAdapter()->beginTransaction();\n\n try {\n\n foreach ($product_id as $key => $value) {\n $cartId = $this->select()\n ->from($this, array('id'))\n ->where('user_id = ?', $user_id)\n ->where('store_id = ?', $store_id)\n ->where('product_id = ?', $value);\n\n $cartId = $this->getAdapter()->fetchRow($cartId);\n\n $data = null;\n\n if ($cartId) {\n\n $where['id = ?'] = $cartId['id'];\n $data1 = array('quantity' => 0);\n $data2 = array('quantity' => $quantity[$key]);\n $updateQuantity1 = $this->update($data1, $where);\n $updateQuantity2 = $this->update($data2, $where);\n\n if ($updateQuantity1 && $updateQuantity2) {\n\n $allCartDetail[$i]['cartId'] = $cartId['id'];\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n } else {\n\n $data = array(\n 'product_id' => $value,\n 'user_id' => $user_id,\n 'quantity' => $quantity[$key],\n 'store_id' => $store_id,\n );\n\n $insertedCartId = $this->insert($data);\n\n if ($insertedCartId) {\n $allCartDetail[$i]['cartId'] = $insertedCartId;\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n }\n\n $i++;\n }\n\n if ($success) {\n $this->getAdapter()->commit();\n return $allCartDetail;\n } else {\n $this->getAdapter()->rollBack();\n return 'fail';\n }\n } catch (Exception $ex) {\n $this->getAdapter()->rollBack();\n throw new Exception(\"Error : \" . $ex);\n }\n } else {\n throw new Exception(\"Argument has not passed\");\n }\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'item_id'=>'required',\n ]);\n\n $data=$request->all();\n $data['user_id']=auth()->user()->id;\n $item=Item::findOrFail($request->item_id);\n $data['price']=$item->price_per;\n $data['quantity']=$request->quantity;\n $data['item']=$item->name;\n \n $cart =new Cart($data);\n $cart->save();\n return redirect()->route('cart.index')->with('sucess','Added in Cart');\n \n }", "private function saveCart($request)\n {\n \t$request->session()->put('cart', $this->cart);\n }", "public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name' => ['required','string'],\n 'phone' => ['required'],\n 'email' => ['required','string'],\n 'address' => ['required','string'],\n ]);\n\n $carts = Cart::where('customer_id',Auth::guard('customer')->user()->id)->get();\n\n\n foreach ($carts as $cart)\n {\n\n $product = Product::find($cart->product_id);\n $product->quantity -= $cart->quantity;\n $product->save();\n\n Order::create([\n 'customer_id' => Auth::guard('customer')->user()->id,\n 'name' => $request['name'],\n 'phone' => $request['phone'],\n 'email' => $request['email'],\n 'country' => $request['country'],\n 'government' => $request['government'],\n 'city' => $request['city'],\n 'address' => $request['address'],\n 'product_name' => $product->name,\n 'product_price' => $product->price,\n 'image1' => $product->image1,\n 'quantity' => $cart->quantity,\n 'amount' => $cart->quantity * $product->price,\n ]);\n\n Cart::where('id',$cart->id)->delete();\n }\n\n return redirect('/');\n\n\n }", "public function saveForLater($item)\n {\n $cart=Cart::get($item);\n Cart::instance('default')->remove($item);\n\n\n $item=Cart::instance('saveForLater')->search(function ($cartItem, $rowId) use($cart){\n return $cartItem->id === $cart->id;\n });\n\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','This item is already added in your cart!');\n }\n Cart::instance('saveForLater')->add($cart->id,$cart->name,$cart->qty,$cart->price)\n ->associate('App\\Models\\Product');\n\n return back()->with('success_message','Item has been saved for Later!');\n }", "public function saveItems(array $items)\n {\n foreach ($items as $item) {\n $this->em->persist($item);\n }\n }", "function save_cart_data() \n\t\t{\n\t\t\tif (!$this->data['user'])\n\t\t\t{\n\t\t\t\t// Users that are not logged in cannot save cart data.\n\t\t\t\t$this->flexi_cart->set_error_message('You must be logged in to save your cart.', 'public');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t\t$this->load->library('flexi_cart_admin');\n\t\t\t\n\t\t\t\t// Save the cart data to the database.\n\t\t\t\t$this->flexi_cart_admin->save_cart_data($this->data['user']->id);\n\t\t\t}\n\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\n\t\t\tredirect('cart');\n\t\t}", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function store(Request $request)\n {\n $itemids = $request->id;\n foreach ($itemids as $itemid) {\n $transaction = new Transaction;\n $transaction->owner_id = Auth::user()->id;\n $transaction->order_id = $request->get('order_id');\n $transaction->item_id = $itemid;\n $transaction->item_name = $request->item_name[$itemid];\n $transaction->item_price = $request->item_price[$itemid];\n $transaction->quantity = $request->quantity[$itemid];\n $transaction->save();\n }\n $this->sendMessage();\n return redirect('order/' . $request->order_id . '/index');\n }", "public function save_cart($table){\n\t\t\t//Asigna el carrito a la mesa correspondiente\n\t\t\t$_SESSION[$table] = $_SESSION['cart'];\n\n\t\t}", "public function saveAction()\n {\n $items = $this->getRequest()->getPost('results');\n $action = $this->getRequest()->getPost('action');\n\n $msg = Mage::getModel('barcodescanner/save')->saveProducts($items, $action);\n\n $this->getResponse()->setBody(json_encode($msg));\n }", "public function Save($item)\n {\n $item->Save();\n }", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function store(Request $request)\n {\n try{\n $cart = Cart::where('table_id',$request->table_id)->where('item_id',$request->item_id)->first();\n $item = AppItems::find($request->item_id);\n if($item){\n $request->merge(['amount'=>$item->amount*$request->qty]);\n }\n if($cart){\n $cart->qty = $request->qty;\n $cart->save();\n if($request->qty == '0'){\n $cart->delete();\n }\n }else{\n $cart = Cart::create($request->except('_token'));\n }\n $cart->items;\n $data['data'] = $cart;\n $data['message'] = 'created';\n return $this->apiResponse($data,200);\n }catch(\\Exception $e){\n $data['message'] = $e->getMessage();\n return $this->apiResponse($data,404);\n }\n }", "public function store(ItemRequest $request)\n\t{\n\t\t $items = new Item;\n //$items->upc_ean_isbn = Input::get('upc_ean_isbn');\n $items->item_code = Input::get('item_code');\n $items->item_name = Input::get('item_name');\n $items->size = Input::get('size');\n $items->description = Input::get('description');\n $items->cost_price = Input::get('cost_price');\n $items->selling_price = Input::get('selling_price');\n //$items->quantity = Input::get('quantity');\n $tempTotalQuantity=0;\n if($items->save()){\n\t\t\t\t$batch_arr = Input::get('batch_arr');\n\t\t\t\t$count = count($batch_arr['batch_no']);\n\t // process inventory\n\t if($count != 0)\n\t\t\t\t{\n\t\t\t\t\tfor ($i=0; $i < $count ; $i++) { \n\t\t\t\t\t\t$inventories = new Inventory;\n\t\t\t\t\t\t$inventories->item_id = $items->id;\n\t\t\t\t\t\t$inventories->user_id = Auth::user()->id;\n\t\t\t\t\t\t$inventories->in_out_qty = $batch_arr['quantity'][$i];\n\t\t\t\t\t\t$tempTotalQuantity += $batch_arr['quantity'][$i];\n\t\t\t\t\t\t$inventories->batch_no = $batch_arr['batch_no'][$i];\n\t\t\t\t\t\t$inventories->expiry_date = $batch_arr['expiry'][$i];\n\t\t\t\t\t\t$inventories->remarks = 'Manual Edit of Quantity';\n\t\t\t\t\t\t$inventories->save();\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n // process avatar\n $image = $request->file('avatar');\n\t\t\tif(!empty($image))\n\t\t\t{\n\t\t\t\t$avatarName = 'item' . $items->id . '.' . \n\t\t\t\t$request->file('avatar')->getClientOriginalExtension();\n\n\t\t\t\t$request->file('avatar')->move(\n\t\t\t\tbase_path() . '/public/images/items/', $avatarName\n\t\t\t\t);\n\t\t\t\t$img = Image::make(base_path() . '/public/images/items/' . $avatarName);\n\t\t\t\t$img->resize(100, null, function ($constraint) {\n\t\t\t\t\t$constraint->aspectRatio();\n\t\t\t\t});\n\t\t\t\t$img->save();\n\t\t\t\t$itemAvatar = Item::find($items->id);\n\t\t\t\t$itemAvatar->avatar = $avatarName;\n\t $itemAvatar->save();\n \t}\n \t$itemQuantity = Item::find($items->id);\n\t\t\t$itemQuantity->quantity = $tempTotalQuantity;\n \t$itemQuantity->save();\n Session::flash('message', 'You have successfully added item');\n return Redirect::to('items/create');\n\t}", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function placeItemsInCart($cartId, array $items, $isReplace = false);", "public function store(Request $request){\n //dd($request);\n //$cart[$request->item_id] = $request->quantity;\n //ways to create an array\n //$cart = array(values);\n //$cart = [value1, value2, etc];\n //$cart[key/index] = value;\n //What happens when an item is added to cart, it will assign the quantity\n // to index number equal to the item_id.\n //Session::put(\"cart\", $cart); // adds a session variable called cart with the content from $cart\n //dd(Session::get(\"cart\"));\n // This is only halfway done, why? Because the Session::put overwrites the original content. Fina a way to prevent it from overwriting. (Ie. revamp the entire logic)\n \n // Check if there is already a cart\n //1a. If there is no cart, create a new one\n //1b. If there is already a cart, call the cart and update the content.\n //2b. Save the updated cart in the session.\n\n $cart = []; //empty cart\n if(Session::exists(\"cart\")){ // if there is a cart in our session, pull it.\n $cart = Session::get(\"cart\");\n }\n $cart[$request->item_id]= $request->quantity;// update the cart\n Session::put(\"cart\", $cart); \n //dd(Session::get(\"cart\"));\n Session::flash(\"message\", $request->quantity . \"items added to cart\");\n // dd(Session::get(\"cart\"));\n // push it back to the session cart\n \n //Syntax: put into $cart into a session variable called \"cart\".\n \n return redirect(\"/products\"); //return to the catalog page.\n }", "public function insert($items = array())\n {\n if ($this->_checkCartInsert($items) === TRUE)\n {\n\n $isNew = true;\n $shouldUpdate = $this->_config['on_insert_update_existing_item'];\n\n //check if should update existing product\n if($shouldUpdate){\n $products = is_array($this->_session['products']) ? $this->_session['products'] : array();\n foreach ($products as $token => $existing_item) {\n if($existing_item['id'] === $items['id']){\n //fount same product already on cart\n $isNew = false;\n $items = array('token'=>$token, 'qty'=> $existing_item['qty']+$items['qty']);\n break;\n }\n }\n }\n\n if($isNew){\n $token = sha1($items['id'].$items['qty'].time());\n\n if (is_array($this->_session['products']))\n {\n $this->_session['products'][$token] = $this->_cart($items);\n } else {\n //creo il carrello in sessione\n $this->_session['products'] = array();\n $this->_session->cartId = $this->_session->getManager()->getId();\n $this->getEventManager()->trigger(CartEvent::EVENT_CREATE_CART_POST, $this, array('cart_id'=>$this->_session->cartId));\n //aggiungo elemento\n $this->_session['products'][$token] = $this->_cart($items);\n }\n //evento per elemento aggiunto\n $this->trigger(CartEvent::EVENT_ADD_ITEM_POST, $token, $this->_session['products'][$token], $this);\n }else{\n //update existing product\n $this->update($items);\n }\n\n }\n }", "function validate_update_cart_item(){\n\t\t$total = count($this->cart->contents());\n\t\t \n\t\t// Retrieve the posted information\n\t\t$item = $this->input->post('rowid');\n\t\t$qty = $this->input->post('qty');\n\t \n\t\t// Cycle true all items and update them\n\t\tfor($i=0;$i < $total;$i++)\n\t\t{\n\t\t\t// Create an array with the products rowid's and quantities. \n\t\t\t$data = array(\n\t\t\t 'rowid' => $item[$i],\n\t\t\t 'qty' => $qty[$i]\n\t\t\t);\n\t\t\t \n\t\t\t// Update the cart with the new information\n\t\t\t$this->cart->update($data);\n\t\t}\n\t \n\t}", "public function save()\n {\n\t\t\tforeach($this->items as $index=>$data)\n\t\t\t{\n\t \t//if exists, update\n\t\t\t\tif($data[\"object\"])\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]->update(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$data[\"producttype\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]=MyModel::create(\"Product\",array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$data[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$this->main->producttypedata->items[$data[\"producttypename\"]][\"object\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\n\t\t\t}\n }", "function addItemsToCart()\n\t{\n\t\t$order = $_POST['order'];\n\t\tsession_start();\n\t\tif(isset($_SESSION['userName']))\n\t\t{\n\t\t\t$result = addItemsToCartDB($_SESSION['userName'], $order);\n\t\t\tif($result['status'] == 'COMPLETE')\n\t\t\t{\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n # Something went wrong\n\t\t\t\tdie(json_encode($result));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode(errors(417)));\n\t\t}\n\t}", "public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }", "function save_cart()\n\t{\n\t\tunset($this->_tour_cart_contents['tour_cart_total']);\n\t\tunset($this->_tour_cart_contents['total_itineraries']);\n\t\t$delete_itineraries = $this->_tour_cart_contents['delete_itineraries'];\n\t\tunset($this->_tour_cart_contents['delete_itineraries']);\n\t\t$estimate = $this->_tour_cart_contents['estimate']; // echo \"<pre>\";print_r($estimate);echo \"</pre>\";exit;\n\t\tunset($this->_tour_cart_contents['estimate']);\n\n\t\t// Is our cart empty? If so we delete it from the session\n\t\tif (count($this->_tour_cart_contents) <= 0)\n\t\t{\n\t\t\t$this->CI->session->unset_userdata('tour_cart_contents');\n\n\t\t\t// Nothing more to do... coffee time!\n\t\t\treturn FALSE;\n\t\t}\n\t\t$total_itinerary = 0; \n\t\tforeach($this->_tour_cart_contents as $cart_itinerary){\n\t\t\t$total_itinerary++;\n\t\t\t\n\t\t}\n\t\t$this->_tour_cart_contents['total_itineraries'] = $total_itinerary;\n\t\t$this->_tour_cart_contents['delete_itineraries'] = $delete_itineraries;\n\t\t$this->_tour_cart_contents['estimate'] = $estimate;\n\t\t\n\t\t$this->CI->session->set_userdata(array('tour_cart_contents' => $this->_tour_cart_contents));\n\t\t//echo \"<pre>\";print_r($this->CI->session->userdata(\"tour_cart_contents\"));echo \"</pre>\";exit;\n\t\t\n\t\t// Woot!\n\t\treturn TRUE;\n\t}", "public function store(Request $request)\n {\n $validated = $request->validate([\n 'nama_item'=>'required',\n 'satuan'=>'required',\n 'current_stock'=>'required',\n 'minimal_stock'=>'required',\n 'kode_item'=>'required',\n ]);\n $item = new Item;\n $item->nama_item = $request->nama_item;\n $item->satuan = $request->satuan;\n $item->keterangan = $request->keterangan;\n $item->current_stock = $request->current_stock;\n $item->minimal_stock = $request->minimal_stock;\n $item->kode_item = $request->kode_item;\n $item->save();\n\n \n foreach($request->unit_id as $id_unit){\n $item_unit = new ItemUnit;\n $item_unit->item_id = $item->id;\n $item_unit->unit_id = $id_unit;\n $item_unit->save();\n }\n\n foreach($request->jenis_mesin_id as $id_mesin){\n $item_jenis = new ItemJenis;\n $item_jenis->item_id = $item->id;\n $item_jenis->jenis_mesin_id = $id_mesin;\n $item_jenis->save();\n }\n\n return redirect('/admin/item')->with('success', 'Berhasil Menambahkan Barang!');\n }", "protected function callAPISaveCart()\n {\n $session = $this->currentSession->getCurrentSessionId();\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH . 'saveCart?session='.$session.'',\n 'httpMethod' => RestRequest::HTTP_METHOD_POST,\n ]\n ];\n\n $itemId = mt_rand(10000000000000, 100000000000000);\n\n $requestData = [\n \"quote_id\" => \"\",\n \"store_id\" => \"1\",\n \"customer_id\" => \"\",\n \"currency_id\" => \"USD\",\n \"till_id\" => \"\",\n \"items\" => [\n [\n \"id\" => 6,\n \"item_id\" => $itemId,\n \"qty\" => 1,\n \"qty_to_ship\" => 0,\n \"use_discount\" => 1,\n \"extension_data\" => [\n [\n \"key\" => \"row_total\",\n \"value\" => 59\n ],\n [\n \"key\" => \"base_row_total\",\n \"value\" => 59\n ],\n [\n \"key\" => \"row_total_incl_tax\",\n \"value\" => 59\n ],\n [\n \"key\" => \"base_row_total_incl_tax\",\n \"value\" => 59\n ],\n [\n \"key\" => \"price\",\n \"value\" => 59\n ],\n [\n \"key\" => \"base_price\",\n \"value\" => 59\n ],\n [\n \"key\" => \"price_incl_tax\",\n \"value\" => 59\n ],\n [\n \"key\" => \"base_price_incl_tax\",\n \"value\" => 59\n ],\n [\n \"key\" => \"discount_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"base_discount_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"tax_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"base_tax_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"custom_tax_class_id\",\n \"value\" => 2\n ],\n [\n \"key\" => \"discount_tax_compensation_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"base_discount_tax_compensation_amount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"customercredit_discount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"base_customercredit_discount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"rewardpoints_earn\",\n \"value\" => 0\n ],\n [\n \"key\" => \"rewardpoints_spent\",\n \"value\" => 0\n ],\n [\n \"key\" => \"rewardpoints_discount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"rewardpoints_base_discount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"gift_voucher_discount\",\n \"value\" => 0\n ],\n [\n \"key\" => \"base_gift_voucher_discount\",\n \"value\" => 0\n ]\n ],\n \"amount\" => 59,\n \"credit_price_amount\" => 'null',\n \"options\" => [\n [\n \"code\" => \"credit_price_amount\",\n \"value\" => 'null'\n ],\n [\n \"code\" => \"amount\",\n \"value\" => 59\n ],\n [\n \"code\" => \"amount\",\n \"value\" => 59\n ],\n [\n \"code\" => \"giftcard_template_image\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"giftcard_template_id\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"message\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"recipient_name\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"send_friend\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"recipient_ship\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"recipient_email\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"day_to_send\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"timezone_to_send\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"recipient_address\",\n \"value\" => \"\"\n ],\n [\n \"code\" => \"notify_success\",\n \"value\" => \"\"\n ]\n ],\n \"giftcard_template_id\" => \"\",\n \"giftcard_template_image\" => \"\",\n \"message\" => \"\",\n \"recipient_name\" => \"\",\n \"send_friend\" => \"\",\n \"recipient_ship\" => \"\",\n \"recipient_email\" => \"\",\n \"day_to_send\" => \"\",\n \"timezone_to_send\" => \"\",\n \"recipient_address\" => \"\",\n \"notify_success\" => \"\"\n ]\n ],\n \"customer\" => [\n \"customer_id\" => \"\",\n \"billing_address\" => [\n \"country_id\" => \"US\",\n \"postcode\" => \"90034\",\n \"region\" => [\n \"region\" => \"California\",\n \"region_id\" => 12,\n \"region_code\" => \"CA\"\n ],\n \"region_id\" => 12,\n \"city\" => \"Guest City\",\n \"email\" => \"[email protected]\",\n \"firstname\" => \"Guest\",\n \"lastname\" => \"POS\",\n \"street\" => [\n \"Street\"\n ],\n \"telephone\" => \"12345678\"\n ],\n \"shipping_address\" => [\n \"country_id\" => \"US\",\n \"postcode\" => \"90034\",\n \"region\" => [\n \"region\" => \"California\",\n \"region_id\" => 12,\n \"region_code\" => \"CA\"\n ],\n \"region_id\" => 12,\n \"city\" => \"Guest City\",\n \"email\" => \"[email protected]\",\n \"firstname\" => \"Guest\",\n \"lastname\" => \"POS\",\n \"street\" => [\n \"Street\"\n ],\n \"telephone\" => \"12345678\"\n ]\n ]\n ];\n\n $results = $this->_webApiCall($serviceInfo, $requestData);\n // Dump the result to check \"How does it look like?\"\n // \\Zend_Debug::dump($results);\n return $results;\n }", "public function saveAll(iterable $post): void;", "function add_post() {\n\n\n $status = 0;\n $message = \"Product not added to Cart successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n\n\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $item);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $qty;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $status = 1;\n $message = \"Cart updated Successfully\";\n }\n } else {\n $data[\"product_count\"] = $qty;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $status = 1;\n $message = \"Product added to cart successfully.\";\n }\n }\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "public function saveAll() {\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->saveAll();\n }\n }\n }\n }\n $this->save();\n }", "public function store(Request $request)\n {\n\n $items = \\Cart::getContent();\n\n $venta = new venta($request->all());\n $venta->fecha = \\Carbon\\Carbon::Now()->toDateTimeString();;\n $venta->save();\n\n $detalle=new detalle();\n $detalle->venta_id = $venta->id;\n $detalle->total = \\Cart::getSubTotal();;\n $detalle->save();\n\n foreach ($items as $item) {\n $arItems = $item->id;\n $detalleProductos=new detallesProductos();\n $detalleProductos->detalle_id = $detalle->id;\n $detalleProductos->producto_id = $item->id;\n $detalleProductos->cantidad = $item->quantity;\n $detalleProductos->save();\n }\n\n \\Cart::clear();\n\n return redirect()->route('venta.index');\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public static function saveToCart($cart_products,$order, $total_price,$currency,$ses_id){\n $error = array();\n foreach($cart_products as $product){\n $prod = Product::productById($product['product_id']);\n //$latest_products_info[$product['product_id']] = $prod; \n if($product['cart_quantity'] > $prod['quantity']){ \n $error['error'] .= \"{$product['name']} , Quantity: {$product['cart_quantity']} not Available, \\n\";\n }\n }\n if(!empty($error)){ $error['success'] = false; echo json_encode($error); die; }\n\n\n if(!isset($order['shipping_address_id']) || !isset($order['billing_address_id']) || !isset($order['payment_method']) || !isset($order['shipping_method'])){\n $error['success'] = false;\n $error['error'] = 'Fill Order Steps';\n //pr($order);\n echo json_encode($error);\n die; \n }\n \n \n $sessUserId = (isset($_SESSION['sess_user_id']) ? $_SESSION['sess_user_id'] : 0);\n if($sessUserId!=$order['customer_id']){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user'; \n }\n \n \n \n //$store = Store::loadById(2);\n $store = Store::load($start = 1, $limit = 1);\n $store = $store[0];\n if(empty($store)){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user';\n echo json_encode($error);\n die; \n }\n $customer = Customer::loadById($order['customer_id']);\n $store_url = BASE_URL.\"admins/store/index.php?id=1\"; \n\n $paddress = CustomerAddress::loadById($order['billing_address_id']);\n $shipaddress = CustomerAddress::loadById($order['shipping_address_id']);\n $payment_country_name = Country::loadById( $paddress->getCountryId() );\n $ship_country_name = Country::loadById( $shipaddress->getCountryId() );\n $payment_zone_name = Zone::loadById($paddress->getZoneId());\n $ship_zone_name = Zone::loadById($shipaddress->getZoneId());\n $PaymentMethod = PaymentMethod::loadByCode($order['payment_method']);\n $shippingMethod = DeliveryMethod::loadByCode($order['shipping_method']);\n $date_added = date('Y-m-d H:i:s', time());\n\n if(empty($PaymentMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Payment method';\n echo json_encode($error);\n die; \n }\n\n \n if(empty($shippingMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Shipping method';\n echo json_encode($error);\n die; \n }\n\n \n \n \n $objOrderList = new OrderList(); \n $objOrderList->setInvoiceNo(0);\n $objOrderList->setInvoicePrefix(\"INV-\".date(\"Y-m\"));\n $objOrderList->setStoreId(0);\n $objOrderList->setStoreName($store->getName());\n $objOrderList->setStoreUrl($store_url);\n $objOrderList->setCustomerId($customer->getCustomerId());\n $objOrderList->setCustomerGroupId($customer->getCustomerGroupId());\n $objOrderList->setFirstname($customer->getFirstname());\n $objOrderList->setLastname($customer->getLastname());\n $objOrderList->setEmail($customer->getEmail());\n $objOrderList->setTelephone($customer->getTelephone());\n $objOrderList->setFax($customer->getFax());\n $objOrderList->setPaymentFirstname($paddress->getFirstname());\n $objOrderList->setPaymentLastname($paddress->getLastname());\n $objOrderList->setPaymentCompany($paddress->getCompany());\n $objOrderList->setPaymentCompanyId($paddress->getCompanyId());\n $objOrderList->setPaymentTaxId($paddress->getTaxId());\n $objOrderList->setPaymentAddress1($paddress->getAddress1());\n $objOrderList->setPaymentAddress2($paddress->getAddress2());\n $objOrderList->setPaymentCity($paddress->getCity());\n $objOrderList->setPaymentPostcode($paddress->getPostcode());\n $objOrderList->setPaymentCountry($payment_country_name->getName());\n $objOrderList->setPaymentCountryId($paddress->getCountryId());\n $objOrderList->setPaymentZone($payment_zone_name->getName()); \n $objOrderList->setPaymentZoneId($paddress->getZoneId());\n $objOrderList->setPaymentAddressFormat('');\n $objOrderList->setPaymentMethod($PaymentMethod->getName()); \n $objOrderList->setPaymentCode($order['payment_method']);\n $objOrderList->setPaymentComment($order[\"payment_comment\"]);\n $objOrderList->setBankName($order[\"bank_name\"]);\n $objOrderList->setBankAcountNo($order[\"bank_acount_no\"]);\n $objOrderList->setShippingFirstname($shipaddress->getFirstname());\n $objOrderList->setShippingLastname($shipaddress->getLastname());\n $objOrderList->setShippingCompany($shipaddress->getCompany());\n $objOrderList->setShippingAddress1($shipaddress->getAddress1());\n $objOrderList->setShippingAddress2($shipaddress->getAddress2());\n $objOrderList->setShippingCity($shipaddress->getCity()); \n $objOrderList->setShippingPostcode($shipaddress->getPostcode());\n $objOrderList->setShippingCountry($ship_country_name->getName());\n $objOrderList->setShippingCountryId($shipaddress->getCountryId());\n $objOrderList->setShippingZone($ship_zone_name->getName());\n $objOrderList->setShippingZoneId($shipaddress->getZoneId());\n $objOrderList->setShippingAddressFormat('');\n $objOrderList->setShippingMethod($shippingMethod->getMethodName());\n $objOrderList->setShippingCode($order['shipping_method']);\n $objOrderList->setComment($order['shipping_comment']); //$order['shipping_comment']\n $objOrderList->setTotal($total_price);\n $objOrderList->setOrderStatusId(1);\n $objOrderList->setAffiliateId(0);\n $objOrderList->setCommission(0);\n $objOrderList->setLanguageId(1);\n $objOrderList->setCurrencyId($currency[\"currency_id\"]);\n $objOrderList->setCurrencyCode($currency[\"code\"]);\n $objOrderList->setCurrencyValue($currency[\"value\"]);\n $objOrderList->setIp($_SERVER['REMOTE_ADDR']);\n $objOrderList->setForwardedIp('');\n $objOrderList->setUserAgent($_SERVER[\"HTTP_USER_AGENT\"]);\n $objOrderList->setAcceptLanguage($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n $objOrderList->setDateAdded($date_added);\n $objOrderList->setDateModified($date_added);\n $objOrderList->setCbaFreeShipping(0);\n \n\n \n $result = $objOrderList->save(); \n $order_id = $objOrderList->getOrderId();\n \n if($result['success']){ \n $customer_reward = $cart_total_price = 0;\n\n // order Product insertion\n if(!empty($cart_products))\n foreach($cart_products as $k=>$product){\n $cart_product_price_total = $price= 0;\n $objOrderProduct = new OrderProduct();\n //$objOrderProduct->setOrderProductId($resultRow[\"order_product_id\"]);\n $objOrderProduct->setOrderId($order_id);\n $objOrderProduct->setProductId($product[\"product_id\"]);\n $objOrderProduct->setName($product[\"name\"]);\n $objOrderProduct->setModel($product[\"manufacture_name\"]);\n $objOrderProduct->setQuantity($product[\"cart_quantity\"]);\n $objOrderProduct->setSize($product[\"product_size\"]);\n if($product['product_discount_id']!=NULL)\n $price = ($product[\"discount_price\"]*$currency['value']);\n else \n $price = ($product[\"price\"]*$currency['value']);\n \n $objOrderProduct->setPrice($price);\n $cart_product_price_total = $price*$product[\"cart_quantity\"];\n $cart_total_price +=$cart_product_price_total;\n $objOrderProduct->setTotal($cart_product_price_total);\n $objOrderProduct->setTax(0);\n $objOrderProduct->setReward(($product[\"points\"]*$product[\"cart_quantity\"]));\n $customer_reward += intval($product[\"points\"]); \n $result_prod = $objOrderProduct->save();\n $objOrderProduct->getOrderProductId();\n\n $order_products[] = \"{$product[\"name\"]} - {$product[\"cart_quantity\"]} - {$currency['code']}{$price} \";\n } \n\n // order Reward insertion\n if($customer_reward>0){\n $custrewardinfo = CustomerReward::fetchByCustomerId($customer->getCustomerId());\n $objCustomerReward = new CustomerReward();\n if(!empty($custrewardinfo) && $custrewardinfo->getCustomerRewardId()>0)\n $objCustomerReward->setCustomerRewardId($custrewardinfo->getCustomerRewardId());\n $objCustomerReward->setCustomerId($customer->getCustomerId());\n $objCustomerReward->setOrderId(1);\n $objCustomerReward->setDescription(\"Reward point\");\n $objCustomerReward->setPoints($customer_reward);\n $objCustomerReward->setDateAdded($date_added);\n $objCustomerReward->save();\n }\n\n // order Total insertion only shipping implement\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('sub_total');\n $objOrderTotal->setTitle('Sub-Total');\n $objOrderTotal->setText($cart_total_price);\n $objOrderTotal->setValue($cart_total_price);\n $objOrderTotal->setSortOrder(1);\n $objOrderTotal->save();\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode($shippingMethod->getDeliveryMethodCode());\n $objOrderTotal->setTitle($shippingMethod->getMethodName());\n $objOrderTotal->setText($shippingMethod->getMethodName());\n $ship_rate = $shippingMethod->getCost()*$currency['value'];\n $objOrderTotal->setValue($ship_rate);\n $objOrderTotal->setSortOrder(2);\n $result = $objOrderTotal->save();\n\n $objOrderTotal = new OrderTotal();\n //$objOrderTotal->setOrderTotalId($resultRow[\"order_total_id\"]);\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('total');\n $objOrderTotal->setTitle('Total');\n $objOrderTotal->setText(($cart_total_price+$ship_rate));\n $objOrderTotal->setValue(($cart_total_price+$ship_rate));\n $objOrderTotal->setSortOrder(3);\n $result = $objOrderTotal->save();\n \n // Order Hisory Entry\n $objOrderHistory = new OrderHistory(); \n $objOrderHistory->setOrderId($order_id);\n $objOrderHistory->setOrderStatusId(1);\n $objOrderHistory->setNotify(1);\n $objOrderHistory->setComment($order['payment_comment']);\n $objOrderHistory->setDateAdded($date_added);\n $result = $objOrderHistory->save(); \n unset($_SESSION[$ses_id]['Order']);\n unset($_SESSION[$ses_id]['Products']);\n unset($_SESSION[$ses_id]['Cart_Total_Price']);\n $customerinfo = Customer::loadById($customer->getCustomerId());\n $result = Customer::saveCart($customer->getCustomerId(), serialize(array()));\n $result['result'] = \"Succes submit\";\n\n $order_products_str = implode(\", \\n\", $order_products);\n\n /*$mailObj = new Mailer();\n $from = $customer->getEmail(); \n $fromname = $customer->getFirstname(). \" \".$customer->getLastname();\n \n $subject = sprintf(CART_CHECKOUT_SUBJECT,$order_id);\n $body = sprintf(CART_CHECKOUT_BODY,$order_products_str);\n $mailObj->setMailAddress($from, $fromname);\n $mailObj->setMailSubject($subject);\n $mailObj->setMailBody(sprintf(CART_CHECKOUT_BODY,$order_products_str));\n //pr($mailObj); die(\"d\"); \n //if(!$mailObj->MailSend($from,$fromname,$subject,$body)){\n if(!$mailObj->MailSend()){\n $result['error'] = \"Mail can\\'t send ! Order Submit. \\n Check your Account Order history\";\n $result['success']=false;\n echo json_encode($result);\n die;\n }*/\n\n $result['order_id'] = $order_id;\n $result['success']=true;\n \n echo json_encode($result);\n die;\n\n \n }\n\n\n }", "public function save() \r\n\t{\r\n\t\t$this->saveNewProducts();\r\n\t\t$this->saveUpdateProducts();\r\n\t\t$this->saveRemoveProducts();\t\t\t\r\n\t\t$this->destroyCache(); \r\n\t}", "public function setToCart()\n\t{\n\t\t$this->cart->set($this->request->getInteger('record'), $this->request->getInteger('amount', 1), [\n\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t]);\n\t\t$this->saveCart();\n\t}", "protected function saveOrderItems($items, $order_id, $currency_rate) {\n foreach ($items as $id => $item) {\n $order_items = new OrderItems(); // creating OrderItems() object inside foreach, because we need...\n $order_items->order_id = $order_id; // ...to insert several records into order_items table - single record for each item\n $order_items->product_id = $id;\n $order_items->name = $item['name'];\n $order_items->price = round($item['price'] * $currency_rate, 2);\n $order_items->qty_item = $item['qty'];\n $order_items->sum_item = round($item['qty'] * $item['price'] * $currency_rate, 2);\n $order_items->save();\n }\n }", "public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}", "public function add(){\n //item data\n $data = array(\n 'id' => $this->input->post('item_number'),\n 'qty' => $this->input->post('qty'),\n 'price' => $this->input->post('price'),\n 'name' => $this->input->post('title')\n );\n\n //insert Cart\n $this->cart->insert($data);\n\n redirect('products');\n}", "function json_add_post() {\n\n\n $status = 0;\n $message = \"Product not processed successfully.\";\n $dealer = $this->post('sellerid');\n $user = $this->post('user');\n $item = $this->post('item');\n $role = $this->post('role');\n $dt = date(\"Y-m-d H:i:s\");\n $qty = $this->post('qty');\n $json_qty = $this->post('json_qty');\n $json_encode_array = json_decode($json_qty, true);\n $flag = false;\n $processed_items = 0;\n foreach ($json_encode_array as $key => $value) {\n $data = array(\"dealer\" => $dealer, \"branch_price_id\" => $key);\n $cart_qry = $this->model_all->getTableData(\"seller_cart_items\", $data);\n if ($cart_qry->num_rows() > 0) {\n $cart_rs = $cart_qry->row_array();\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $aff_rows = $this->model_all->update($data, array(\"id\" => $cart_rs[\"id\"]), \"seller_cart_items\");\n if ($aff_rows) {\n $flag = true;\n $processed_items++;\n }\n } else {\n $data[\"product_count\"] = $value;\n $data[\"modifiedon\"] = $dt;\n $data[\"added_by\"] = $user;\n $data[\"added_role\"] = $role;\n $id = $this->model_all->save($data, \"seller_cart_items\");\n if ($id > 0) {\n $flag = true;\n $processed_items++;\n }\n }\n }\n\n\n\n\n\n\n $items_count_qry = $this->model_all->getTableData(\"seller_cart_items\", array(\"dealer\" => $dealer));\n if ($flag) {\n $status = 1;\n $message = $processed_items . \" Items Processed Successfully\";\n }\n\n\n $result[\"status\"] = $status;\n $result[\"message\"] = $message;\n $result[\"items_count\"] = $items_count_qry->num_rows();\n\n $this->response($result, 200);\n\n exit;\n }", "function save(&$items_taxes_data, $item_id)\n\t{\n\t\t//Run these queries as a transaction, we want to make sure we do all or nothing\n\t\t$this->con->trans_start();\n\n\t\t$this->delete($item_id);\n\n\t\tforeach ($items_taxes_data as $row)\n\t\t{\n\t\t\t$row['item_id'] = $item_id;\n\t\t\t$this->con->insert('items_taxes',$row);\n\t\t}\n\n\t\t$this->con->trans_complete();\n\t\treturn true;\n\t}", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function store(CartItemPostRequest $request)\n {\n $size = $request->post('size');\n $color_id = $request->post('color');\n $product_id = $request->post('product');\n $amount = $request->post('amount');\n\n $productDesign = ProductDesign::where('size', $size)\n ->where('color_id', $color_id)\n ->where('product_id', $product_id)->first();\n\n // save cart item in DB for logged in user\n if(Auth::check()){\n\n // get cart if already exists, else create one\n $cart = Cart::firstOrCreate([\n 'user_id' => Auth::user()->id,\n ]);\n\n // create cart item and save it\n CartItem::create([\n 'product_design_id' => $productDesign->id,\n 'amount' => $amount,\n 'cart_id' => $cart->id,\n ]);\n }\n\n // save cart item in session for guest\n else {\n // get cart items from session\n $cartItems = session()->get('cartItems');\n\n // if guest hasn't add anything to cart yet, create cartItems array\n if(!$cartItems) {\n session()->put('cartItems', []);\n }\n\n // create cart item\n $cartItem = new CartItem([\n 'product_design_id' => $productDesign->id,\n 'amount' => $amount,\n ]);\n\n // add cart item to cartItems array in session\n session()->push('cartItems', ($cartItem));\n }\n\n return response()->json([\n 'success' => 'Produkt bol pridaný do košíka',\n ], 200);\n\n }", "public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }", "public function clear() {\n\t\t$this->load->library('cart');\n\t\tforeach($this->cart->contents() as $item) {\n\t\t\t\t$item['qty'] = 0;\n\t\t\t\t$this->cart->update($item);\n\t\t}\n\t\t$this->json->output(array(\"status\"=>\"success\", \"msg\"=>\"Your cart has been cleared.\"));\n\t}", "public function store(Request $request)\n {\n $items = Item::all();\n\n $stock = new AddStock;\n $stock->nama_sbu = $request->nama_sbu;\n $stock->as_date = $request->as_date;\n $stock->as_number = $request->as_number;\n $stock->description = $request->description;\n $stock->save();\n foreach ($items as $i) {\n $id_item = $i->id;\n $detailStock = new AddStockDetail;\n $detailStock->id_item = $id_item;\n $detailStock->as_number = $request->as_number;\n $detailStock->add_stock = $request->$id_item;\n $detailStock->save();\n }\n return redirect('add-stock');\n }", "public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Cart::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCart::create($data);\n\n\t\treturn Redirect::route('carts.index')->with('message', 'Cart created.');\n\t}", "public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}", "public function save_order() {\n$customer = array(\n'nama' => $this->input->post('nama'),\n'email' => $this->input->post('email'),\n);\n// And store user information in database.\n$cust_id = $this->Shop_model->insert_customer($customer);\n\n$order = array(\n'pelanggan' => $cust_id\n);\n\n$ord_id = $this->Shop_model->insert_order($order);\n\n\nforeach ($this->cart->contents() as $item):\n$order_detail = array(\n'order_id' => $ord_id,\n'produk' => $item['id'],\n'qty' => $item['qty'],\n'harga' => $item['price']\n);\n\n// Insert product imformation with order detail, store in cart also store in database.\n\n$cust_id = $this->Shop_model->insert_order_detail($order_detail);\nendforeach;\n\n\nredirect('shop');\n\n }", "protected function update_cart()\n\t{\n\t\t//\n\t\t//\n\t\tarray_set($this->cart_contents, $this->cart_name . '.total_items', 0);\n\t\tarray_set($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\n\t\t// Loop through the cart items.\n\t\t//\n\t\tforeach (array_get($this->cart_contents, $this->cart_name) as $rowid => $item)\n\t\t{\n\t\t\t// Make sure the array contains the proper indexes.\n\t\t\t//\n\t\t\tif ( ! is_array($item) or ! isset($item['price']) or ! isset($item['qty']))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Calculations...\n\t\t\t//\n\t\t\t$this->cart_contents[ $this->cart_name ]['cart_total'] += ($item['price'] * $item['qty']);\n\t\t\t$this->cart_contents[ $this->cart_name ]['total_items'] += $item['qty'];\n\n\t\t\t// Calculate the item subtotal.\n\t\t\t//\n\t\t\t$subtotal = (array_get($this->cart_contents, $this->cart_name . '.' . $rowid . '.price') * array_get($this->cart_contents, $this->cart_name . '.' . $rowid . '.qty'));\n\n\t\t\t// Set the subtotal of this item.\n\t\t\t//\n\t\t\tarray_set($this->cart_contents, $this->cart_name . '.' . $rowid . '.subtotal', $subtotal);\n\t\t}\n\n\t\t// Is our cart empty?\n\t\t//\n\t\tif (count(array_get($this->cart_contents, $this->cart_name)) <= 2)\n\t\t{\n\t\t\t// If so we delete it from the session.\n\t\t\t//\n\t\t\t$this->destroy();\n\n\t\t\t// Nothing more to do here...\n\t\t\t//\n\t\t\treturn false;\n\t\t}\n\n\t\t// Update the cart session data.\n\t\t//\n\t\tSession::put($this->cart_name, array_get($this->cart_contents, $this->cart_name));\n\n\t\t// Success.\n\t\t//\n\t\treturn true;\n\t}", "public function save() {\n foreach($this->getMenuItems() as $item){\n $item->setMenu($this);\n $item->save();\n }\n parent::save();\n }", "public function store()\n {\n $idProductos = Session::get('cart');\n $total = 0;\n foreach ($idProductos as $value) {\n $total = $total + ($value['quantity'] * $value['price']);\n };\n\n $sale = new Sale();\n $sale->transaction_key = Session::getId();\n $sale->payment_data = 'MercadoPago';\n $sale->total = $total;\n $sale->status = 'Pendiente';\n $sale->user_id = Auth::user()->id;\n\n $sale->save();\n\n $idVenta = $sale->id;\n\n foreach ($idProductos as $value) {\n $saleDetail = new SalesDetail();\n $saleDetail->user_id = Auth::user()->id;\n $saleDetail->sale_id = $idVenta;\n $saleDetail->product_id = $value['id'];\n $saleDetail->unit_price = $value['price'];\n $saleDetail->quantity = $value['quantity'];\n $saleDetail->save();\n\n $restaStock = ($value['stock'] - $value['quantity']);\n $stock = Product::find($value['id'])->update(['stock' => $restaStock]);\n };\n\n Session::forget('cart');\n\n return view('shopcartPay', compact('total'));\n }", "public function store(CheckoutRequest $request)\n {\n $membeli = $request->get('product');\n $save = count($membeli);\n\n for($i=0; $i<$save; $i++){\n $pay = new payment();\n $pay->membeli = $membeli[$i];\n $pay->email = $request['email'];\n $pay->nama = $request['name'];\n $pay->alamat = $request['address'];\n $pay->telepon = $request['telepon'];\n $pay->kode_pos = $request['kode'];\n $pay->kode_trans = time();\n $pay->jumlah_brg = $request->qty[$i];\n $pay->harga = $request->harga[$i];\n $pay->total = $request['total'];\n $pay->save();\n }\n\n for ($u=0; $u<count($request->update); $u++) {\n $product = product::find($request->update[$u]);\n $qty = $request->qty[$u];\n $dqty = $product->stock;\n $sisa = $dqty-$qty;\n DB::table('product')\n ->where('id',$request->update[$u])\n ->update([\n 'stock' => $sisa,\n \n ]);\n \n } \n Cart::destroy();\n $penjualan = payment::where('email', '=', $request->email)->orderBy('id', 'DESC')->first();\n return redirect()->to('success/'.$penjualan->kode_trans);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'customer' => 'required',\n 'total' => 'required',\n 'itemdetail.*' => 'required',\n 'qty.*' => 'required',\n ]);\n\n $order = $this->model->create([\n 'user_id' => auth()->user()->id,\n 'customer' => $request->customer,\n 'total' => $request->total,\n ]);\n\n for ($i = 0; $i < count($request->itemdetail); $i++) {\n $order->orderDetails()->create([\n 'item_detail_id' => $request->itemdetail[$i],\n 'qty' => $request->qty[$i],\n 'sub_total' => $request->subtotal[$i],\n ]);\n $detail = ItemDetail::with('ingredients')->find($request->itemdetail[$i]);\n foreach ($detail->ingredients as $key => $ingredient) {\n $usedIngredient = Ingredient::find($ingredient->id);\n $stock = $ingredient->stock;\n $used = $ingredient->pivot->amount_ingredient * $request->qty[$i];\n $nowStock = $stock - $used;\n $usedIngredient->update(['stock' => $nowStock]);\n // dd($ingredient->stock);\n };\n // dd($detail->ingredients->first()->id);\n };\n\n return redirect($this->redirect);\n }", "public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}", "public function saveCart($user,$cart_title,$cart_id){\n // First time?\n if(!$this->redis->keys(md5($user))){$this->firstTimer($user);}\n if($this->exists(md5($user), $cart_title, \":saved_carts\")){\n $data['error']=true;\n $data['content'] = $cart_title.\" already exists. Please choose another name.\";\n return data;\n };\n // Get current cart count and next count\n $curcart = $this->redis->hGet(md5($user),\"cart_count\");\n $nextcartid = $curcart++;\n // Add cart to carts array\n if($this->redis->hSet(md5($user).\":saved_carts\", $nextcartid, \"$cart_title\") !== false){\n // Get values stored in temp cart\n $vals = $this->redis->hGetAll(md5($user).\":cart_0\");\n //save the vals and reindex cart as perm\n if($this->redis->hMSet(md5($user).\":cart_\".$nextcartid,$vals)!==false){\n //clear temp cart\n if($this->redis->hIncrBy(md5($user),\"cart_count\",1)!=false){\n $this->redis->delete(md5($user).\":cart_0\");\n // return updated carts\n $data['error']=false;\n $data['content'] = $this->redis->hGetAll(md5($user).\":saved_carts\");\n return $data;\n }\n return \"failed to increment\";\n }\n }\n $data['error']=true;\n $data['content']=\"Failed to save\";\n return $data;\n }", "public function store(Request $request)\n {\n // return($request);\n $myid = Auth::user()->id;\n $sellerid = UserTree::where('child_id',$myid)->get('parent_id');\n $current_timestamp = Carbon::now()->timestamp;\n $current_date_time = Carbon::now()->toDateTimeString();\n $date = Carbon::createFromFormat('Y-m-d H:i:s', $current_date_time)->year;\n $year = $date+543;\n\n $itemcount = Cart::where('user_id',$myid)->count();\n for($i = 0 ; $i < $itemcount ; $i++){\n if($request->totalprice[$i] == 0){\n $del_cart_item = Cart::find($request->itemid[$i]);\n $del_cart_item->delete();\n // return($request->totalprice);\n }\n }\n $itemcount2 = Cart::where('user_id',$myid)->count();\n\n if($itemcount2 == 0){\n return redirect()->back()->with('failerror', 'สินค้าในตระกร้าถูกลบออกเนื่องจากจำนวนสินค้าเกินเรทราคาที่กำหนด');\n }\n\n $cart = Cart::where('user_id',$myid)->get();\n\n\n // สร้างบิล\n $PurchaseOrder = new PurchaseOrder();\n $PurchaseOrder->purchase_no = $current_timestamp;\n $PurchaseOrder->year = $year;\n $PurchaseOrder->buyer_id = $myid;\n foreach($sellerid as $seller_row){\n $PurchaseOrder->seller_id = $seller_row->parent_id;\n }\n $PurchaseOrder->save();\n\n // สร้าง order ของบิล\n foreach($cart as $key=>$cart_row){\n $stockitem = Stock::where('id',$request->stock_id[$key])->first();\n $order = new Order();\n $order->purchase_order_id = $PurchaseOrder->id;\n $order->stock_id = $request->stock_id[$key];\n $order->amount = $request->amount[$key];\n $order->received_priceunit = $stockitem->received_price;\n $order->received_price = $stockitem->received_price * $request->amount[$key];\n $order->price = $request->priceperunit[$key] * $request->amount[$key];\n $order->save();\n $cart_row->delete();\n }\n\n // foreach($cart as $key=>$cart_row){\n // $order = new Order();\n // $order->purchase_order_id = $PurchaseOrder->id;\n // $order->stock_id = $cart_row->stock_id;\n // $order->amount = $cart_row->amount;\n // $order->price = $request->itemprice[$key];\n // $order->save();\n // $cart_row->delete();\n // }\n\n\n\n\n return redirect()->action('paymentController@indexbuy')->with('error', 'สร้างรายการสั่งซื้อสำเร็จ!');\n }", "public function store(Request $request, $id)\n {\n $produk = produk::where('id', $id)->first();\n if($request->qty > $produk->stok)\n {\n return redirect('detail/'.$id)->with('status', 'The order exceeds the existing stock limit');\n }\n\n $subtotal = $produk->harga * $request->qty;\n $cek_cart = Cart::where('id_produk', Session::get('id_produk'))->first();\n if(empty($cek_cart)){\n\n $itemcart = Cart::create($request->all());\n $itemcart-> id_user = $request->id_user;\n $itemcart-> id_produk = $request->id_produk;\n $itemcart-> qty = $request->qty;\n $itemcart->save();\n } else {\n \n }\n\n\n\n return redirect('/cart')->with('status', 'Successfully create a new product!');\n\n }", "public function MoveToCart($item){\n\n $cart=Cart::instance('saveForLater')->get($item);\n\n Cart::instance('saveForLater')->remove($item);\n\n\n $item=Cart::instance('default')->search(function ($cartItem, $rowId) use($cart){\n return $cartItem->id === $cart->id;\n });\n\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','This item is already added in your cart!');\n }\n Cart::instance('default')->add($cart->id,$cart->name,$cart->qty,$cart->price)\n ->associate('App\\Models\\Product');\n\n return back()->with('success_message','Item has been Moved to your Cart!');\n }", "public function saveItems(array $items): bool;", "function expireReturnProduct($cart_id,$user_name,$db){\n $paid = 0;\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n $cartQ = $db->query(\"SELECT * FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n// $db->query(\"INSERT INTO wishlist(id,items,username,expire_date) VALUES ({$cart_id}','{$cartQ}','{$user_name}','{$cart_expire}')\");\n $result = mysqli_fetch_assoc($cartQ);\n $cart_items = json_decode($result['items'],true);\n $updated_items =array();\n foreach($cart_items as $item){\n $mode = 'expire';\n $edit_id = $item['id'];\n $edit_size = $item['size'];\n $edit_quantity = $item['quantity'];\n updateProductQtyupdate($mode,$item,$db,$edit_id,$edit_size,$edit_quantity);\n //$item['quantity'] = 0;\n $updated_items[] = $item;\n }\n if(!empty($updated_items)){\n $json_update = json_encode($updated_items);\n //$db->query(\"UPDATE cart SET items = '{$json_update}' WHERE id = '{$cart_id}' AND paid = '{$paid}'\");\n //$_SESSION['success_flash'] = 'Your shopping cart has been updated';\n $cart_item = $db->query(\"SELECT * FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n $cart = mysqli_fetch_assoc($cart_item);\n $items = json_decode($cart['items'],true); //makes it an associated array not an object\n\n\n foreach ($items as $w_item) {\n $product_id = $w_item['id'];\n $price = $w_item['price'];\n $size = $w_item['size'];\n $quantity = $w_item['quantity'];\n $request = $w_item['request'];\n $item = array();\n $item[] = array(\n 'id' => $product_id,\n 'price' => $price,\n 'size' => $size,\n 'quantity' => $quantity,\n 'request' => $request,\n );\n $nill = 100; //not applicable for wishlist\n $available = $nill;\n cart_wishlist_update('wishlist',$db,$item,$cart_id,$user_name,$json_update,$cart_expire,$available);\n }\n\n $db->query(\"DELETE FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n $_SESSION['success_flash'] = $user_name. ' Your shopping cart has been updated';\n }\n\n if(empty($updated_items)){\n $db->query(\"DELETE FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n }\n}", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function clearCart(){\r\n\t\t$this->cart_items = array();\r\n\t\t$this->latestItemId = 1;\t\t\r\n\t}", "public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }", "public function store(Request $request) {\n $data = new ItemOrder();\n $data->table_number = $request->table_number;\n $data->user_name = $request->user_name;\n $data->staff_id = auth()->user()->id;\n $data->order_number = generate_order_number();\n \n $data->save();\n $orderId = $data->id;\n\n foreach($request->order_details as $val) {\n $detailObj = new ItemOrderDetail();\n $detailObj->order_id = $orderId;\n $detailObj->item_id = $val['item_id'];\n $detailObj->quantity = $val['quantity'];\n $detailObj->price = $val['price'];\n $detailObj->final_price = $val['price'] * $val['quantity'];\n\n $detailObj->save();\n }\n\n $data->save();\n\n return redirect()->route('orders')->with('success', 'Order added successfully.');\n }", "public function insertUpdateProductInCart() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $hotel_id = func_get_arg(1);\n $product_id = func_get_arg(2);\n $quantity = func_get_arg(3);\n $allCartDetail = array();\n $success = null;\n $i = 0;\n $this->getAdapter()->beginTransaction();\n\n try {\n\n foreach ($product_id as $key => $value) {\n $cartId = $this->select()\n ->from($this, array('id'))\n ->where('user_id = ?', $user_id)\n ->where('hotel_id = ?', $hotel_id)\n ->where('product_id = ?', $value);\n\n $cartId = $this->getAdapter()->fetchRow($cartId);\n\n $data = null;\n\n if ($cartId) {\n\n $where['id = ?'] = $cartId['id'];\n $data1 = array('quantity' => 0);\n $data2 = array('quantity' => $quantity[$key]);\n $updateQuantity1 = $this->update($data1, $where);\n $updateQuantity2 = $this->update($data2, $where);\n\n if ($updateQuantity1 && $updateQuantity2) {\n\n $allCartDetail[$i]['cartId'] = $cartId['id'];\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n } else {\n\n $data = array(\n 'product_id' => $value,\n 'user_id' => $user_id,\n 'quantity' => $quantity[$key],\n 'hotel_id' => $hotel_id,\n );\n\n $insertedCartId = $this->insert($data);\n\n if ($insertedCartId) {\n $allCartDetail[$i]['cartId'] = $insertedCartId;\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n }\n\n $i++;\n }\n\n if ($success) {\n $this->getAdapter()->commit();\n return $allCartDetail;\n } else {\n $this->getAdapter()->rollBack();\n return 'fail';\n }\n } catch (Exception $ex) {\n $this->getAdapter()->rollBack();\n throw new Exception(\"Error : \" . $ex);\n }\n } else {\n throw new Exception(\"Argument has not passed\");\n }\n }", "public function updateCart(Cart $cart): void\n {\n }", "public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }", "public function addItemToCart($account_id, $item_id, $quantity = false);", "public function update($items = array())\n\t{\n\t\t// Check if we have data.\n\t\t//\n\t\tif ( ! is_array($items) or count($items) === 0)\n\t\t{\n\t\t\tthrow new CartInvalidDataException;\n\t\t}\n\n\t\t// We only update the cart when we insert data into it.\n\t\t//\n\t\t$update_cart = false;\n\n\t\t// Single item.\n\t\t//\n\t\tif ( ! isset($items[0]))\n\t\t{\n\t\t\t// Check if the item was updated.\n\t\t\t//\n\t\t\tif ($this->_update($items) === true)\n\t\t\t{\n\t\t\t\t$update_cart = true;\n\t\t\t}\n\t\t}\n\n\t\t// Multiple items.\n\t\t//\n\t\telse\n\t\t{\n\t\t\t// Loop through the items.\n\t\t\t//\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\t// Check if the item was updated.\n\t\t\t\t//\n\t\t\t\tif ($this->_update($item) === true)\n\t\t\t\t{\n\t\t\t\t\t$update_cart = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update the cart if the insert was successful.\n\t\t//\n\t\tif ($update_cart === true)\n\t\t{\n\t\t\t// Update the cart.\n\t\t\t//\n\t\t\t$this->update_cart();\n\n\t\t\t// We are done here.\n\t\t\t//\n\t\t\treturn true;\n\t\t}\n\n\t\t// Something went wrong.\n\t\t//\n\t\tthrow new CartException;\n\t}", "public function saveOrder()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$modelUserCart = $this->getModel('usercart');\n\n\t\t$modelUserCart->storeUserOrder();\n\t\t$modelUserCart->sendOrderMail();\n\t\t$modelUserCart->emptyCart();\n\t\t$params = $app->getParams('com_simpleshop');\n\t\t$return_url = $params->get('return_url');\n\n\n\t\t$app->redirect($return_url);\n\n\t}", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "function changeCart(){\n\t\t$this->getCart();\n\t\t\n\t\t$keys = array(); $keys = $_POST['Key']; // Cart Keys\n\t\t$qtys = array(); $qtys = $_POST['Qty']; // Cart Quantities\n\t\tif(count($this->Cart) == 0) header(sprintf(\"Location: %s\", $this->Files['Cart'] ));\n\n\t\tforeach($keys as $k => $v){ // For Each Item go through the system and update the quatities\n\t\t\t$this->Cart[$v][\"qty\"] = $qtys[$k];\n\t\t\t$this->Cart[$v][\"attnd\"] = (isset($_POST['attnd_'.$k])) ? $_POST['attnd_'.$k] : array() ; // Cart Attendies\n\t\t\t/*\n\t\t\t$getProdMsgs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getProdMsgs->mysql(\"SELECT `prod_msg_type` FROM `prod_products` WHERE `prod_id` = '\".$cart[$v][\"id\"].\"';\");\n\t\t\t$getProdMsgs->mssql(\"SELECT prod_msg_type FROM prod_products WHERE prod_id = '\".$cart[$v][\"id\"].\"';\");\n\t\t\t$getProdMsgs = $getProdMsgs->Rows();\n\t\t\t$Msgs = $getProdMsgs[0]['prod_msg_type'];\n\t\t\t*/\n\t\t\t$Msgs='';\n\t\t\tif(strlen(trim($Msgs)) > 0)$Msgs = unserialize(urldecode($Msgs));\n\t\t\telse $Msgs = array(); $Tarray = array();\n\t\t\t\n\t\t\tif(count($Msgs) > 0){ // Now we need to update any message that the products may have.\n\t\t\t\tforeach($Msgs as $msgk => $msgv){\n\t\t\t\t\tswitch($msgk){\n\t\t\t\t\t\tcase \"Cmnts\":\n\t\t\t\t\t\t\tif(strlen(trim($_POST['message_'.$v])) > 0) $Tarray['Cmnts'][0] = clean_variable($_POST['message_'.$v],true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ToFrm\":\n\t\t\t\t\t\t\tif(strlen(trim($_POST['message_to_'.$v])) > 0){\n\t\t\t\t\t\t\t\t$Tarray['ToFrm'][0] = clean_variable($_POST['message_to_'.$v],true);\n\t\t\t\t\t\t\t\t$Tarray['ToFrm'][1] = clean_variable($_POST['message_from_'.$v],true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"Engv\":\n\t\t\t\t\t\t\tif(intval($msgv)>1){\n\t\t\t\t\t\t\t\tif(strlen(trim($_POST['engraving_'.$k])) > 0) $Tarray['Engv'][0] = clean_variable($_POST['engraving_'.$v],true);\n\t\t\t\t\t\t\t} else { $n=0;\n\t\t\t\t\t\t\t\tforeach($_POST['engraving_'.$v] as $msgv2){\n\t\t\t\t\t\t\t\t\tif(strlen(trim($v)) > 0) $Tarray['Engv'][$n] = clean_variable($msgv2,true);\n\t\t\t\t\t\t\t\t\t$n++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->Cart[$v]['msgs'] = $Tarray;\n\t\t\t\tif($qtys[$k] > 1){ $this->Cart[$v]['qty'] = 1; $Tarray = $this->Cart[$v]; array_push($this->Cart,$Tarray); }\n\t\t\t}\n\t\t}\n\t\t//echo '<pre>';\n\t\t//var_dump($this->Cart);\n\t\t//echo '</pre>';\n\t\t//die();\n\t\t$this->getRefered();\n\t\t$this->setCart();\n\t\t\n\t\tswitch($_POST['Controller']){\n\t\t\tcase \"CtnShp\": $GoTo = $this->Files['prodList']; break;\n\t\t\tdefault: $GoTo = $this->Files['Cart']; breal;\n\t\t}\n\t\theader(sprintf(\"Location: %s\", $GoTo));\n\t}", "public function store(Request $request)\n {\n //\n $items = new Item;\n $items->name = $request->name;\n $items->category_id = $request->category;\n $items->size = $request->size;\n $items->color = $request->color;\n\n\n $items->quantity = $request->quantity;\n \n \n \n if ($request->hasFile('image1')) {\n $items->image1 = $request->image1->store('public/image');\n }\n\n if ($request->hasFile('image2')) {\n $items->image2 = $request->image2->store('public/image');\n }\n\n if ($request->hasFile('image3')) {\n $items->image3 = $request->image3->store('public/image');\n }\n\n $items->description = $request->description;\n $items->Price = $request->Price;\n $items->save();\n return redirect()->route('item.index');\n\n \n }", "public function moveItems2DownloadList($cartlist = array())\n {\n \n $insert_item = array();\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('lists', 'mp3music'); \n foreach($cartlist as $key=>$value)\n {\n if ($value['type'] == 'song') \n {\n $insert_item = array($value['item_id'],0,Engine_Api::_()->user()->getViewer()->getIdentity());\n }\n if ($value['type'] == 'album') \n {\n $insert_item = array(0,$value['item_id'],Engine_Api::_()->user()->getViewer()->getIdentity());\n }\n $list = $l_table->createRow();\n $list->dl_song_id = $insert_item[0];\n $list->dl_album_id = $insert_item[1];\n $list->user_id = $insert_item[2];\n $list->save();\n }\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "public function run()\n {\n $stores = \\App\\Store::all();\n\n foreach ($stores as $store) {\n \tfor ($i=0; $i < 5; $i++) {\n\t \t$buyer = $store->buyers()->save(factory(App\\Buyer::class)->make());\n if($buyer->id == 1) {\n $buyer->update(['email' => '[email protected]',\n 'password' => '$2y$10$l07kG3A9ciFaauExHcFL2eAA7B8zSIP/3QAAG3vFgnMF3AyksOcHq'\n ]);\n }\n\t $buyer->cart()->create(['store_id' => $store->id]);\n \t}\n }\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "public function addselectedtocartAction() {\n $messages = array();\n $urls = array();\n $wishlistIds = array();\n $notSalableNames = array(); // Out of stock products message\n\n\t\t$ids = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('ids'));\n\t\t$qtys = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('qtys'));\n\t\t\n\t\t$ids_arr = explode(',', $ids);\n\t\t$qtys_arr = explode(',', $qtys);\n\t\t\n\t\t$i=0;\n\t\tforeach($ids_arr as $id)\n\t\t{\n\t\t\t$id = intval($id);\n\t\t\t$qty = intval($qtys_arr[$i]);\n\t\t\tif($id != '' && $qty != '')\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t$product = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->load($id)\n\t\t\t\t\t\t->setQty($qty);\n\t\t\t\t\tif ($product->isSalable()) {\n\t\t\t\t\t\tMage::getSingleton('checkout/cart')->addProduct($product,$qty);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$notSalableNames[] = $product->getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$url = Mage::getSingleton('checkout/session')->getRedirectUrl(true);\n\t\t\t\t\tif ($url)\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = Mage::getModel('core/url')\n\t\t\t\t\t\t\t->getUrl('catalog/product/view', array(\n\t\t\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t\t\t'wishlist_next' => 1\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$urls[] = $url;\n\t\t\t\t\t\t$messages[] = $e->getMessage();\n\t\t\t\t\t\t$wishlistIds[] = $id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$item->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n }\n\t\t\t$i++;\n\t\t}\n\t\tMage::getSingleton('checkout/cart')->save();\n\n if (count($notSalableNames) > 0) {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Following product(s) is currently out of stock:'));\n array_map(array(Mage::getSingleton('checkout/session'), 'addNotice'), $notSalableNames);\n }\n\n if ($urls) {\n Mage::getSingleton('checkout/session')->addError(array_shift($messages));\n $this->getResponse()->setRedirect(array_shift($urls));\n\n Mage::getSingleton('checkout/session')->setWishlistPendingUrls($urls);\n Mage::getSingleton('checkout/session')->setWishlistPendingMessages($messages);\n Mage::getSingleton('checkout/session')->setWishlistIds($wishlistIds);\n }\n else {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Product(s) Added successfully'));\n $this->_redirect('wishlist/index');\n }\n }" ]
[ "0.77006334", "0.7656624", "0.7605002", "0.75858235", "0.75247955", "0.7001633", "0.68210167", "0.681683", "0.68084854", "0.6778957", "0.67635655", "0.67142963", "0.6685901", "0.6548933", "0.6504954", "0.6390826", "0.6314578", "0.6292063", "0.62647027", "0.6259779", "0.62525076", "0.62495345", "0.62380093", "0.6234055", "0.6231773", "0.6220208", "0.6217351", "0.621252", "0.6206262", "0.61915267", "0.61915267", "0.617771", "0.61770314", "0.61728257", "0.617138", "0.6169173", "0.616441", "0.6155178", "0.6145928", "0.6143271", "0.6134378", "0.6131522", "0.6130347", "0.61295056", "0.6126386", "0.6111067", "0.6110257", "0.6104142", "0.6101336", "0.60833603", "0.6074778", "0.6069441", "0.606451", "0.6056203", "0.6048197", "0.602859", "0.6026923", "0.60263956", "0.602526", "0.60209584", "0.60135585", "0.60078865", "0.6003744", "0.5989154", "0.59795237", "0.59786594", "0.5972", "0.5968052", "0.59656656", "0.59584796", "0.5956015", "0.5941984", "0.5940874", "0.5906237", "0.58999664", "0.58989716", "0.588738", "0.58833677", "0.58801645", "0.5876665", "0.5875197", "0.58638084", "0.58576584", "0.5851945", "0.58466196", "0.5842603", "0.58365685", "0.58365566", "0.5833105", "0.58318365", "0.58304375", "0.582438", "0.5821038", "0.5820631", "0.5809345", "0.58018804", "0.57995677", "0.57940394", "0.57934463", "0.5793266" ]
0.7333073
5
Change item quantity in the cart
public function change($id, $quantity) { $this->loadItems(); if (isset($this->items[$id])) { $this->items[$id]->setQuantity($quantity); } $this->saveItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_quantity()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$quantity = $this->input->post('quantity');\n\t\t$this->cart->update_quantity($item->product, $item->variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function changeQtyAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isChangeItemQtyAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n $quoteItem->setQty(\n $this->getRequest()->getPost('qty')\n );\n\n try {\n if ($quoteItem->getHasError() === true) {\n $result['error'] = $quoteItem->getMessage(true);\n } else {\n $this->_recalculateTotals();\n $result['success'] = true;\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during changing product qty');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function updateQuantity() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'][$count]['quantity'] = $this->quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function updateCartQuantity()\n {\n if(isset($_GET[\"quantity\"]) && $_GET[\"quantity\"] > 0) {\n $_SESSION[\"products\"][$_GET[\"update_quantity\"]][\"product_qty\"] = $_GET[\"quantity\"];\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(['products' => $total_product]));\n }", "function updateItemQty(){\n $update = 0;\n // Get cart item info\n $rowid = $this->input->get('rowid');\n $qty = $this->input->get('qty');\n\n // Update item in the cart\n if(!empty($rowid) && !empty($qty)){\n $data = array(\n 'rowid' => $rowid,\n 'qty' => $qty\n );\n $update = $this->cart->update($data);\n }\n\n // Return response\n echo $update?'ok':'err';\n }", "function set_quantity( $cart_item_key, $quantity = 1 ) {\n\t\t\tif ($quantity==0 || $quantity<0) :\n\t\t\t\tunset($this->cart_contents[$cart_item_key]);\n\t\t\telse :\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t}", "public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }", "function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}", "public function updateItemQuantity( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->where($params);\r\n\t\t\t$qty = array('quantity'=>$map['quantity']);\r\n\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t}", "public function updateQuantity(int $quantity)\n {\n $newQuantity = $quantity - $this->quantity();\n $item = $this->items->first();\n $item->quantity = $item->quantity + $newQuantity;\n $item->save();\n }", "public function changeQuantityAction()\r\n {\r\n if ($this->Request()->getParam('sArticle') && $this->Request()->getParam('sQuantity')) {\r\n $this->View()->sBasketInfo = $this->basket->sUpdateArticle($this->Request()->getParam('sArticle'), $this->Request()->getParam('sQuantity'));\r\n }\r\n $this->forward($this->Request()->getParam('sTargetAction', 'index'));\r\n }", "public function changeQuantityItemToCart(Request $request)\n {\n return $this->repository->changeQuantityItemToCart($request);\n }", "public function changed_cart_quantity( $cart_item_key, $quantity ) {;\n\n\t\tif ( isset( SV_WC_Plugin_Compatibility::WC()->cart->cart_contents[ $cart_item_key ] ) ) {\n\n\t\t\t$item = SV_WC_Plugin_Compatibility::WC()->cart->cart_contents[ $cart_item_key ];\n\n\t\t\t$this->api_record_event( $this->event_name['changed_cart_quantity'], array( $this->property_name['product_name'] => get_the_title( $item['product_id'] ), 'quantity' => $quantity ) );\n\t\t}\n\t}", "public function change_cart_quantity( $cart_key, $quantity, $old_quantity ) {\n\t\tif ( ! isset( WC()->cart->cart_contents[ $cart_key ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$item = WC()->cart->cart_contents[ $cart_key ];\n\n\t\t$original_quantity = $old_quantity;\n\t\t$new_quantity = $quantity;\n\n\t\t// If we are not really changing quantity, return\n\t\tif ( $original_quantity === $new_quantity ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product_id = $item['product_id'];\n\t\t$variation = '';\n\t\t$product = null;\n\n\t\tif ( ! empty( $item['variation_id'] ) ) {\n\t\t\t$product = wc_get_product( $item['variation_id'] );\n\t\t\tif ( method_exists( $product, 'get_name' ) ) {\n\t\t\t\t$variation = $product->get_name();\n\t\t\t} else {\n\t\t\t\t$variation = $product->post->post_title;\n\t\t\t}\n\t\t} else {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t}\n\n\t\t$categories = (array) get_the_terms( $product_id, 'product_cat' );\n\t\t$category_names = wp_list_pluck( $categories, 'name' );\n\t\t$first_category = reset( $category_names );\n\n\t\tif ( $original_quantity < $new_quantity ) {\n\t\t\t$atts = array(\n\t\t\t\t't' => 'event', \t\t\t\t\t\t\t// Type of hit\n\t\t\t\t'ec' => 'Cart', \t\t\t\t\t\t// Event Category\n\t\t\t\t'ea' => 'Increased Cart Quantity', \t\t\t\t\t// Event Action\n\t\t\t\t'el' => htmlentities( get_the_title( $product_id ), ENT_QUOTES, 'UTF-8' ), // Event Label (product title)\n\t\t\t\t'ev' => absint( $new_quantity - $original_quantity ), \t\t// Event Value (quantity)\n\t\t\t\t'pa' => 'add', \t\t\t\t\t\t\t// Product Action\n\t\t\t\t'pal' => '', \t\t\t\t\t\t // Product Action List\n\t\t\t\t'pr1id' => $product_id, \t\t\t\t\t\t// Product ID\n\t\t\t\t'pr1nm' => get_the_title( $product_id ), \t\t\t// Product Name\n\t\t\t\t'pr1ca' => $first_category, \t\t\t\t\t\t// Product Category\n\t\t\t\t'pr1va' => $variation, \t\t\t\t\t\t\t// Product Variation Title\n\t\t\t\t'pr1pr' => $product->get_price(), \t\t\t// Product Price\n\t\t\t\t'pr1qt' => absint( $new_quantity - $original_quantity ), // Product Quantity\t\n\t\t\t);\n\n\t\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t\t}\n\n\t\t\tmonsterinsights_mp_track_event_call( $atts );\n\t\t} else {\n\t\t\t$atts = array(\n\t\t\t\t't' => 'event', \t\t\t\t\t\t\t// Type of hit\n\t\t\t\t'ec' => 'Cart', \t\t\t\t\t\t// Event Category\n\t\t\t\t'ea' => 'Decreased Cart Quantity', \t\t\t\t\t// Event Action\n\t\t\t\t'el' => htmlentities( get_the_title( $product_id ), ENT_QUOTES, 'UTF-8' ), // Event Label (product title)\n\t\t\t\t'ev' => absint( $new_quantity - $original_quantity ), \t\t// Event Value (quantity)\n\t\t\t\t'cos' => $this->get_funnel_step( 'added_to_cart' ), \t\t// Checkout Step: Add to cart\n\t\t\t\t'pa' => 'remove', \t\t\t\t\t\t\t// Product Action\n\t\t\t\t'pal' => '', \t\t\t\t\t\t\t// Product Action List:\n\t\t\t\t'pr1id' => $product_id, \t\t\t\t\t\t// Product ID\n\t\t\t\t'pr1nm' => get_the_title( $product_id ), \t\t\t// Product Name\n\t\t\t\t'pr1ca' => $first_category, \t\t\t\t\t\t// Product Category\n\t\t\t\t'pr1va' => $variation, \t\t\t\t\t\t\t// Product Variation Title\n\t\t\t\t'pr1pr' => $product->get_price(), \t\t\t// Product Price\n\t\t\t\t'pr1qt' => absint( $new_quantity - $original_quantity ), // Product Quantity\t\t\n\t\t\t);\n\n\t\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t\t}\n\n\t\t\tmonsterinsights_mp_track_event_call( $atts );\n\t\t}\n\t}", "public function update_cart_product_quantity($product_id, $cart_item_id, $quantity)\n {\n $cart = $this->session_cart_items;\n if (!empty($cart)) {\n foreach ($cart as $item) {\n if ($item->cart_item_id == $cart_item_id) {\n $item->quantity = $quantity;\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $cart);\n }", "public static function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['bookCart'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['bookCart'][$key]);\n } else {\n $_SESSION['bookCart'][$key]['qty'] = $quantity;\n $total = $_SESSION['bookCart'][$key]['cost'] *\n $_SESSION['bookCart'][$key]['qty'];\n $_SESSION['bookCart'][$key]['total'] = $total;\n }\n }\n }", "public function setQty($qty);", "public function changeItemQuantity($id, $quantity)\n {\n $cart = Session::get('cart');\n foreach ($cart as $key => $item) {\n $product = json_decode($item);\n\n if ($product->id == $id) {\n $product->quantity = $quantity;\n }\n\n $cart[$key] = json_encode($product);\n }\n\n Session::put('cart', $cart);\n\n return true;\n }", "public function updateQuantity(Request $request)\n {\n $cart = $request->session()->get('pos.cart', collect([]));\n $cart = $cart->map(function ($object, $key) use ($request) {\n if($key == $request->key){\n $product = \\App\\Product::find($object['id']);\n $product_stock = $product->stocks->where('id', $object['stock_id'])->first();\n\n if($product_stock->qty >= $request->quantity){\n $object['quantity'] = $request->quantity;\n }else{\n return array('success' => 0, 'message' => translate(\"This product doesn't have more stock.\"), 'view' => view('pos.cart')->render());\n }\n }\n return $object;\n });\n $request->session()->put('pos.cart', $cart);\n\n return array('success' => 1, 'message' => '', 'view' => view('pos.cart')->render());\n }", "public function increaseItem($rowId){\n // kemudian ambil semua isi product\n // ambil session login id\n // cek eloquent id\n $idProduct = substr($rowId, 4, 5);\n $product = ProductModel::find($idProduct);\n $cart = \\Cart::session(Auth()->id())->getContent();\n $checkItem = $cart->whereIn('id', $rowId);\n \n // kita cek apakah value quantity yang ingin kita tambah sama dengan quantity product yang tersedia\n if($product->qty == $checkItem[$rowId]->quantity){\n session()->flash('error', 'Kuantiti terbatas');\n }\n else{\n \\Cart::session(Auth()->id())->update($rowId, [\n 'quantity' => [\n 'relative' => true,\n 'value' => 1\n ]\n ]);\n }\n\n }", "public function decrement_quantity(){\n\t\t$mysql = mysql_connection::get_instance();\n\t\t\n\t\t$stmt = $mysql->prepare('UPDATE `items` SET `item_quantity` = `item_quantity` - 1 WHERE `item_id` = ?');\n\t\t$stmt->bind_param('i', $this->id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\t}", "public function incrementCartItem()\n {\n cart()->incrementQuantityAt(request('id'));\n\n\n return redirect()->route('cart');;\n }", "public function setQuantity(int $quantity)\n {\n $this->quantity = $quantity;\n }", "function updateItemQuantity($index, $amount)\n {\n $_SESSION['cart'][$index]['quantity'] += $amount;\n $_SESSION['cart'][$index]['total'] += $_SESSION['cart'][$index]['price'] * $amount;\n if ($_SESSION['cart'][$index]['quantity'] == 0) {\n unset($_SESSION['cart'][$index]);\n $_SESSION['cart'] = array_values($_SESSION['cart']);\n }\n }", "public function setQty($prod_id, $newQty)\n {\n // if the item already exists\n if (array_key_exists($prod_id, $this->items)) {\n $this->items[$prod_id] = $newQty;\n } else {\n $this->items = $this->items + array($prod_id => $newQty);\n }\n\n if ($this->items[$prod_id] <= 0) {\n unset($this->items[$prod_id]);\n }\n $this->calcTotal();\n }", "public function update($id, $newQty){\n $cart = Session::get('cart');\n // calculations of add/reduce\n $lessQty = $this->items[$id]['qty'] -= $newQty;\n $moreQty = $newQty -= $cart->items[$id]['qty'];\n $lessTotal = $this->items[$id]['price'] * $lessQty;\n $moreTotal = $this->items[$id]['price'] * $moreQty;\n // if == 0, destroy\n if($newQty == 0) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n unset($cart->items[$id]);\n Session::put('cart', $cart);\n } else { // else reduce values\n if($cart->items[$id]['qty'] > $newQty) {\n $cart->totalQty -= $lessQty;\n $cart->totalPrice -= $lessTotal;\n $cart->items[$id]['qty'] -= $lessQty;\n Session::put('cart', $cart);\n } else { // or add values\n $cart->totalQty += $moreQty;\n $cart->totalPrice += $moreTotal;\n $cart->items[$id]['qty'] += $moreQty;\n Session::put('cart', $cart);\n }\n }\n if($cart->totalQty <= 0){\n Session::forget('cart');\n }\n }", "public function update_qty_item($itemqty, $arrayDelete){\n\t\t\tforeach ($_SESSION['terminal_list'][$arrayDelete] as $key => $value) {\n\t\t\t\t$_SESSION['terminal_list'][$arrayDelete][$key]->quantity = $itemqty;\n\t\t\t}\n\t\t\treturn 'sucess';\t\n\t}", "public function updateQtyItem(UpdateCartRequest $request)\n {\n $data = Cart::updateQtyItem($request);\n if ($data['success']) {\n return response()->json($data);\n } else {\n return response()->json([\n 'success' => false,\n 'msg' => 'Đã xảy ra lỗi. Vui lòng thử lại.'\n ]);\n }\n }", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculatePriceTotal();\n }", "public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }", "function updateCart($ucart) {\n\t\tfor ($i=0; $i < count($ucart['item']); $i++) {\n\t\t\t$item = $ucart['item'][$i];\n\t\t\t$newQty = $ucart['quantity'][$i];\n\t\t\t//set the new quantity\n\t\t\t$_SESSION['cart'][$item] = $newQty;\n\t\t}\n\t}", "function change_quantity($pid,$q){\n\t// scart-products_addorder.php?action=checkout -- id=\"submit_editqty\" \n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\tif(product_exists($pid)) {\n\t for($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t $_SESSION[$cart][$i]['qty']=$q;\n\t\t // break;\n\t\t}\n\t }\n\t print '<script type=\"text/javascript\">';\n\t print 'alert(\"Quantity Updated!\\n--- New Quantity = '.$q.'!\\n\\n\")';\n\t print '</script>';\n return $pid; // pid existing return empty array no message\n\t}\n\n}", "public function testItemQtyUpdate()\n {\n $item = $this->addItem();\n $itemHash = $item->getHash();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n $this->addItem();\n\n $this->assertEquals(7, $item->qty);\n $this->assertEquals($itemHash, $item->getHash());\n\n $options = [\n 'a' => 2,\n 'b' => 1\n ];\n\n $item = $this->addItem(1, 1, false, $options);\n $this->addItem(1, 1, false, array_reverse($options));\n\n $this->assertEquals(2, $item->qty);\n }", "function updateNumberOfItems()\n {\n $gameId = intval($_POST['gameId']);\n $amount = intval($_POST['amount']);\n if($amount == 0){\n $amount = 1;\n }\n\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n if (!empty($gameFromDb)) {\n $_SESSION['addToCartError'] = \"Kon de game niet updaten\";\n header(\"Location: /cart\");\n }\n $supply = $game->supply;\n\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n\n // Set the new amount in the correct game\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n if ($_SESSION['cart'][$index][0] == $gameId) {\n $_SESSION['cart'][$index][1] = $amount;\n }\n }\n header(\"Location: /cart\");\n }", "public function qtyUpdate(Request $request, $id, $qty)\n {\n $user = Auth::id();\n $cart = Cart::where('id', $id)->where('user_id', $user)->first();\n $product = Product::find($cart->product_id);\n if ($product->stock < $qty && $cart->type == 2) {\n return response()->json('stock-out');\n }\n else {\n if ($qty == 0) {\n $cart->delete();\n }\n else {\n $cart->qty = $qty;\n $cart->subtotal = $qty * $cart->price;\n $cart->save();\n }\n }\n }", "public function setQuantity(int $quantity)\n {\n $this->quantity = $quantity;\n }", "public function setQuantity(int $quantity): void\n {\n $this->_quantity = $quantity;\n }", "public function updateProductQuantity(Request $request)\n {\n //get the cart\n $cart = $this->cartRepository->getCart();\n $this->cartRepository->updateProductQuantity($request, $cart);\n\n if ($request->ajax()) {\n return 'true';\n }\n\n return redirect()->back();\n }", "public function updateQuantity($item, $qty)\n {\n // Remove the item from the array\n $this->removeItem($item);\n\n // Push new item into $items array\n for ($i = 0; $i < $qty; $i++) {\n $this->addItem($item);\n }\n\n }", "public function updateProductsQuantity(array $quantity) {\n\t\t$cart = (array) $this->_session->cart;\n\n\t\tforeach ($quantity as $id => $value) {\n\t\t\tif (is_numeric($value) && $value > 0) {\n\t\t\t\tif (array_key_exists($id, $cart)) {\n\t\t\t\t\t$cart[$id]['quantity'] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->_session->cart = $cart;\n\t}", "public function updateCart($type, $quantity) {\n\t\t$this->order[$type] = $quantity;\n\t}", "public function updateCart(Request $request)\n {\n $session_id = Session::getId(); \n\n $shopping_cart = shopping_cart::where('session_id', $session_id)->first();\n\n //$shopping_cart = shopping_cart::where('session_id', '!=', $session_id)->where('item_id','=',$request->item_id)->where('time', '>', time() -600)->first();\n //if (product->quantity - $shopping_cart > $request->quantity)\n \n $product = Item::find($request->cart_id);\n\n //check if stock is available\n if ( ($product->quantity + $shopping_cart->quantity) >= $request->quantity) {\n\n $product->quantity += $shopping_cart->quantity;\n $product->quantity -= $request->quantity;\n\n $product->save(); \n\n //update item quantity in shopping cart\n $shopping_cart->quantity = $request->quantity;\n $shopping_cart->save(); \n \n }\n else{\n return redirect()->route('products.shoppingCart')->with('error', 'Amount entered exceeds availble stock');\n }\n\n //update cart model\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n // $product = Item::find($request->cart_id);\n $cart->update($product, $product->id);\n\n // $request->session()->put('cart', $cart);\n\n if (count($cart->items) > 0) {\n Session::put('cart', $cart);\n } else {\n Session::forget('cart');\n }\n\n\n // $items['item']['qty'] = $request->quantity;\n\n // $oldCart = Session::has('cart') ? Session::get('cart') : null;\n // Session::put('quantity', $request->quantity);\n // $request->session()->put('cart', $cart);\n\n // $request->session()->put('cart', $cart);\n\n return redirect()->route('products.shoppingCart')->with('message', 'Quantity updated!');\n }", "public function update_cart($project_id, $project_item_id, $quantity)\n\t{\n\t\tif($this->projects_model->update_cart($project_item_id, $quantity))\n\t\t{\n\t\t\tredirect('edit-project/'.$project_id);\n\t\t}\n\t}", "public function setQuantity($quantity)\n {\n $this->quantity = $quantity;\n }", "public function cartIncrement($id,$qty){\n Cart::update($id,$qty+1);\n return redirect()->back()->with('info','One Product in added in cart');\n }", "public function single_product_quantity_ajax_cart() {\n\n\t\t\t$woo_header_cart_click_action = astra_get_option( 'woo-header-cart-click-action' );\n\n\t\t\tadd_filter(\n\t\t\t\t'woocommerce_widget_cart_item_quantity',\n\t\t\t\tarray( $this, 'astra_addon_add_offcanvas_quantity_fields' ),\n\t\t\t\t10,\n\t\t\t\t3\n\t\t\t);\n\t\t}", "public function addItemToCart($account_id, $item_id, $quantity = false);", "public function productquantity() {\n\n $this->checkPlugin();\n\n if ($_SERVER['REQUEST_METHOD'] === 'PUT') {\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProductsQuantity($requestjson);\n } else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n } else {\n $json['success'] = false;\n $json['error'] = \"Invalid request method, use PUT method.\";\n $this->sendResponse($json);\n }\n }", "public function testUpdateItem()\n {\n $item = $this->addItem();\n\n $this->laracart->updateItem($item->getHash(), 'qty', 4);\n\n $this->assertEquals(4, $item->qty);\n }", "public function setItemQuantity($productId, $quantity) {\n Doctrine_Query::create()\n ->update('Orderdetail od')\n ->where('od.Product = ?', $productId)\n ->andWhere('od.Order = ?', $this->getOrderId())\n ->set('quantity', $quantity)\n ->execute();\n }", "public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }", "public function setQuantity($val)\n {\n $val = $val < 1 ? 1 : $val;\n $this->setField('Quantity', $val);\n }", "public function astra_addon_add_offcanvas_quantity_fields( $html, $cart_item, $cart_item_key ) {\n\n\t\t\t$_product = apply_filters(\n\t\t\t\t'woocommerce_cart_item_product',\n\t\t\t\t$cart_item['data'],\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\t\t\t$product_price = apply_filters(\n\t\t\t\t'woocommerce_cart_item_price',\n\t\t\t\tWC()->cart->get_product_price( $cart_item['data'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$product_subtotal = apply_filters(\n\t\t\t\t'woocommerce_cart_item_subtotal',\n\t\t\t\tWC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ),\n\t\t\t\t$cart_item,\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\tif ( $_product->is_sold_individually() ) {\n\t\t\t\t$product_quantity = sprintf( '1 <input type=\"hidden\" name=\"cart[%s][qty]\" value=\"1\" />', $cart_item_key );\n\t\t\t} else {\n\t\t\t\t$product_quantity = trim(\n\t\t\t\t\twoocommerce_quantity_input(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'input_name' => \"cart[{$cart_item_key}][qty]\",\n\t\t\t\t\t\t\t'input_value' => $cart_item['quantity'],\n\t\t\t\t\t\t\t'max_value' => $_product->get_max_purchase_quantity(),\n\t\t\t\t\t\t\t'min_value' => '0',\n\t\t\t\t\t\t\t'product_name' => $_product->get_name(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t$_product,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $product_quantity . '<div class=\"ast-mini-cart-price-wrap\">' . $product_subtotal . '</div>';\n\t\t}", "function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function postUpdateQuantity(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $cart = Cart::findOrFail($request['id']);\n if($request['action'] == 'plus'){\n $cart->quantity = $cart->quantity + $request['quantity'];\n $cart->save();\n return response()->json(['status'=> 1]);\n }\n if($request['action'] == 'minus'){\n $cart->quantity = $cart->quantity - $request['quantity'];\n $cart->save();\n return response()->json(['status'=> 1]);\n }\n if($request['action'] == 'manual' && $request['quantity'] >= 1){\n $cart->quantity = $request['quantity'];\n $cart->save();\n return response()->json(['status'=> 1]);\n }\n }", "public function update($id, $quantity = 1)\n\t{\n\t\tif(isset($this->items[$id])){\n\t\t\t$this->items[$product->id]['quantity'] = $quantity;\n\t\t}\n\t\tsession(['cart' => $this->items]);\n\t}", "public function update($items = array())\n {\n if ($this->_checkCartUpdate($items) === TRUE)\n {\n\t\t\t$this->_session['products'][$items['token']]['qty'] = $items['qty'];\n $this->trigger(CartEvent::EVENT_UPDATE_QUANTITY_POST, $items['token'], $this->_session['products'][$items['token']], $this);\n }\n }", "public function updateQuantity($productId, $quantityToUpdate)\n {\n $cartItems = $this->session->get('cart');\n\n foreach ($cartItems as $index => $cartItem) {\n\n if ($cartItem['product_id'] == $productId) {\n $cartItems[$index]['quantity'] = $quantityToUpdate;\n }\n }\n\n $this->session->set('cart', $cartItems);\n }", "public function editCartQuant($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Update overall inventory\n $updatedInventory = $cart[$sku-1] - $amount;\n $updatedInventory = $currentInventoryQuant[0] + $updatedInventory;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }", "public function increaseQuantity(Cart $cartObj)\n {\n $productObj = new Product($cartObj->getProductId());\n $query = $this->pdo->prepare(\"UPDATE orders_products SET quantity = quantity+ :quantity\n WHERE product_id =:product_id AND orders_products.order_id = :order_id\");\n $query->execute(array('product_id'=>$productObj->getId(),\n 'order_id'=>$cartObj->getOrderId(),\n 'quantity'=>$cartObj->getQuantity()));\n $productObj->increaseQuantity($productObj->getId(), 1);\n unset($query);\n }", "function update_product_qty($qty,$p_id){\n global $db;\n $qty = (int) $qty;\n $id = (int)$p_id;\n $sql = \"UPDATE products SET quantity=quantity -'{$qty}' WHERE id = '{$id}'\";\n $result = $db->query($sql);\n return($db->affected_rows() === 1 ? true : false);\n\n }", "public function readdItems($input) {\n $orderItems = \\App\\OrderItem::where('order_id', $input['order_id'])->get();\n foreach ($orderItems as $orderItem) {\n \\App\\Product::where('id', $orderItem->product_id)->increment('qty', $orderItem->qty);\n }\n }", "private function addProductCount($product_id, $quantity)\n {\n $this->cart[$product_id]['quantity'] += $quantity;\n }", "public function hookActionUpdateQuantity($params)\n\t{\n\t\t$context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n\n $shop_name = strval(Configuration::get('PS_SHOP_NAME'));\n $shop_email = strval(Configuration::get('PS_SHOP_EMAIL'));\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $quantity = (int)$params['quantity'];\n\n // Prepares the variables used in the email template\n $templateVars = array(\n \t\t'{shop_name}' => $shop_name,\n \t\t'{shop_email}' => $shop_email,\n \t\t'{id_product}' => $id_product,\n \t\t'{product_name}' => $product_name,\n \t\t'{quantity}' => $quantity\n );\n\n // Checks if the module is on \n if(!Configuration::get('MYMOD_EMAILS') == false)\n {\t\n \t// Sends the email notification to '$shop_email'\n\t\t\tMail::send($id_lang,\n\t\t 'stock_notification',\n\t\t 'Stock Update',\n\t\t $templateVars,\n\t\t $shop_email,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t 'mails/'\n\t\t );\n\t\t}\n\t}", "public function update($rowid,$quantity)\n {\n $quantity = intval($quantity);\n try\n {\n Cart::update($rowid,$quantity);\n }\n catch(\\Exception $e)\n {\n // If the items does not exist, we do nothing\n }\n return redirect()->route('cart.index');\n }", "public function UpdateQty($qty = 0)\n\t{\n\t\t$sql = 'UPDATE coursetickets SET tqty = tqty ' . ($qty >= 0 ? '+ ' : '- ') . abs($qty) . ' WHERE tid = '. (int)$this->id;\t\n\t\t\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\n\t\t\tif ($this->db->AffectedRows())\n\t\t\t{\n\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\tif ($this->details['tqty'] <= 0)\n\t\t\t\t{\t$this->UpdateStatus('sold_out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }", "public function setQuantity($value) \n {\n $this->_fields['Quantity']['FieldValue'] = $value;\n return $this;\n }", "public function _updateCatalogQty($product_id){\n\t\t$results = Mage::getResourceModel('inventorydropship/inventorydropship')->getSumTotalAvailableQtyByProduct($product_id);\n\t\t$newQty = $results[0]['total_avail_qty'];\n\t\t$product = Mage::getModel('catalog/product')->load($product_id);\n\t\t$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id);\n\t\t$stockItem->setQty($newQty);\n\t\t$stockItem->save();\n\t\t$product->save();\n\t}", "public function addItem(string $sku, int $qty): Cart;", "public function decrementCartItem()\n {\n cart()->decrementQuantityAt(request('id'));\n\n return redirect()->route('cart');\n }", "public function update(Request $request, $id)\n {\n\n $qty = $request->input('quantity');\n\n\n foreach(Cart::instance('finalCart')->content() as $row){\n\n if($row -> rowId == $id){\n\n Cart::instance('finalCart')->update($id, ['qty' => $qty]); // Will update the name\n\n }\n\n\n }\n\n return back();\n\n\n\n }", "public function update($cartItemId, $quantity) {\n $newCartItemId = explode(\":\", $cartItemId);\n $itemId = $newCartItemId[0];\n $itemAttr = $newCartItemId[1];\n $this->cartItemNb = $this->cart->containsProduct($itemId, $itemAttr, FALSE);\n /* Product addition to the cart */\n if (!isset($this->cart->id) OR !$this->cart->id) {\n $this->cart->add();\n if ($this->cart->id)\n $this->cookie->id_cart = (int) ($this->cart->id);\n }\n if ($quantity < $this->cartItemNb['quantity']) {\n $operator = 'down';\n $qty = $this->cartItemNb['quantity'] - $quantity;\n } else {\n $operator = 'up';\n $qty = $quantity - $this->cartItemNb['quantity'];\n }\n return $this->cart->updateQty($qty, $itemId, $itemAttr, false, $operator);\n }", "abstract public function getOriginalQty();", "public function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ) {\n\t\tif ( 0 === $quantity || $quantity < 0 ) {\n\t\t\tdo_action( 'woocommerce_before_cart_item_quantity_zero', $cart_item_key, $this );\n\t\t\tunset( $this->cart_contents[ $cart_item_key ] );\n\t\t} else {\n\t\t\t$old_quantity = $this->cart_contents[ $cart_item_key ]['quantity'];\n\t\t\t$this->cart_contents[ $cart_item_key ]['quantity'] = $quantity;\n\t\t\tdo_action( 'woocommerce_after_cart_item_quantity_update', $cart_item_key, $quantity, $old_quantity, $this );\n\t\t}\n\n\t\tif ( $refresh_totals ) {\n\t\t\t$this->calculate_totals();\n\t\t}\n\n\t\treturn true;\n\t}", "public function updateItem($id, $qty) {\n if ($qty === 0) {\n $this->deleteItem($id);\n } else if ( ($qty > 0) && ($qty != $this->items[$id])) {\n $this->items[$id] = $qty;\n }\n }", "public function increase(Request $request, $id)\n {\n if (Auth::check()) {\n $cart = Cart::where('user_id', Auth::id())->where('product_id',$id)->first();\n\n if ($cart === null) {\n return response()->json('Product doesnt exist in cart');\n }\n\n $cart->quantity += 1;\n $cart->save();\n\n return response()->json('Quantity increased');\n }\n }", "public function setQuantity($var)\n {\n GPBUtil::checkInt64($var);\n $this->quantity = $var;\n\n return $this;\n }", "function updateCart()\n{\n\n\t$productId = $_POST['hidProductId'];\n\t$itemQty = $_POST['txtQty'];\n\t$numItem = count($itemQty);\n\t$numDeleted = 0;\n\t$notice = '';\n\t\n\tfor ($i = 0; $i < $numItem; $i++) {\n\t\t$newQty = (int)$itemQty[$i];\n\t\tif ($newQty < 1) {\n\t\t\t// Remove items from the cart if new quantity is negative,\n\t\t\tdeleteFromCart($cartId[$i]);\t\n\t\t\t$numDeleted += 1;\n\t\t} else {\n\t\t\t// Check if enough in stock to update.\n\t\t\t$sql = \"SELECT Name, Quantity\n\t\t\t FROM Items \n\t\t\t\t\tWHERE ItemID = {$productId[$i]}\";\n\t\t\t$result = query($sql);\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t\n\t\t\tif ($newQty > $row['Quantity']) {\n\t\t\t\t// we only have this much in stock\n\t\t\t\t$newQty = $row['Quantity'];\n\n\t\t\t\t// If request is more than in stock, update to total quantity and display error.\n\t\t\t\tif ($row['Quantity'] > 0) {\n\t\t\t\t\tsetError('The quantity you have requested is more than we currently have in stock. The number available is indicated in the &quot;Quantity&quot; box. ');\n\t\t\t\t} else {\n\t\t\t\t\t// the product is no longer in stock\n\t\t\t\t\tsetError('Sorry, but the product you want (' . $row['Name'] . ') is no longer in stock');\n\n\t\t\t\t\t// Remove this item from the shopping cart\n\t\t\t\t\tdeleteFromCart($cartId[$i]);\t\n\t\t\t\t\t$numDeleted += 1;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t// update product quantities in database.\n\t\t\t$sql = \"UPDATE Cart\n\t\t\t\t\tSET Quantity = $newQty\";\n\t\t\t\t\n\t\t\tquery($sql);\n\t\t}\n\t}\n\t\n\tif ($numDeleted == $numItem) {\n\t\t// Return user to last page if entire cart is cleared.\n\t\theader(\"Location: $returnUrl\" . $_SESSION['shop_return_url']);\n\t} else {\n\t\theader('Location: ./cart.php');\t\n\t}\n\t\n\texit;\n}", "public function update(Request $request, $id, $qty)\n {\n // var_dump($request->quantity);die();\n // Validation on max quantity\n // $validator = Validator::make($request->all(), [\n // 'quantity' => 'required|numeric'\n // ]);\n\n // if ($validator->fails()) {\n // session()->flash('error_message', 'Số lượng không phù hợp!');\n // return response()->json(['success' => false]);\n // }\n \n if (!is_numeric($qty)) {\n session()->flash('error_message', 'Số lượng không phù hợp!');\n return response()->json(['success' => false]);\n }\n\n $item = ShoppingCart::find($id);\n $item->quantity = $qty;\n if(is_numeric($item->unit_price))\n $item->total_price = $qty*$item->unit_price;\n $item->save();\n\n session()->flash('success_message', 'Số lượng đã cập nhật thành công!');\n\n return response()->json(['success' => true]);\n }", "public function actionUpdateCart($id, $qty) {\n\t\t$modelCart=$this->loadModelCart($id);\n\t\tif(isset($_POST['TicketReservationParent']))\n\t\t{\n\t\t\t$modelCart->num_of_ticket = $qty;\n\t\t\t$price= $modelCart->unit_price;\n\t\t\t$modelCart->total_price = $qty * $price;\n\t\t\t$modelCart->save();\n\t\t}\n }", "public function hookactionUpdateQuantity($params)\n {\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n \n $context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n $product = new Product($id_product, false, $id_lang, $id_shop, $context);\n \n if (empty($product)) {\n return;\n }\n \n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $product_has_attributes = $product->hasAttributes();\n $productInfo = array(\n 'product_name' => $product_name,\n 'product_id' => $id_product\n );\n $check_oos = ($product_has_attributes && $id_product_attribute)\n || (!$product_has_attributes && !$id_product_attribute);\n $product_quantity = (int)$params['quantity'];\n if (Module::isInstalled('mailalerts')) {\n // For out of stock notification to admin\n $isActivate = $this->isRulesetActive('out_of_stock_alerts');\n if ($check_oos\n && $product->active == 1\n && $isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity <= $this->outStock) {\n $legendstemp = $this->replaceProductLegends(\n $isActivate[0]['template'],\n $productInfo\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $this->adminMobile\n );\n \n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('OutStock', $legendstemp, $this->adminMobile);\n }\n \n // For back in stock\n $isActivate = $this->isRulesetActive('back_of_stock_alerts');\n if ($isActivate != null\n && $isActivate != ''\n && $this->smsAPI != null\n && $this->smsAPI != ''\n && $product_quantity > 0) {\n $bosSql = 'SELECT DISTINCT adr.phone_mobile, oos.id_customer';\n $bosSql .= ' FROM '._DB_PREFIX_. 'mailalert_customer_oos as oos';\n $bosSql .= ' INNER JOIN '._DB_PREFIX_. 'address as adr ON oos.id_customer = adr.id_customer';\n $bosSql .= ' WHERE oos.id_product = \"' . (int)$id_product . '\" AND deleted = 0';\n $bosResults = Db::getInstance()->ExecuteS($bosSql);\n \n if ($bosResults) {\n foreach ($bosResults as $customerVal) {\n $customerInfo = array(\n 'id_customer' => $customerVal['id_customer'],\n 'phone_mobile' => $customerVal['phone_mobile']\n );\n $legendstemp = $this->replaceProductCustomerLegends(\n $isActivate[0]['template'],\n $customerInfo,\n $productInfo\n );\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n // Use send SMS API here\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $customerVal['phone_mobile']\n );\n $this->sendSMSByAPI($postAPIdata);\n $delQuery = 'DELETE FROM ' . _DB_PREFIX_ . 'mailalert_customer_oos';\n $delQuery .= ' WHERE id_customer = \"' . (int)$customerVal['id_customer'] . '\"';\n Db::getInstance()->execute($delQuery);\n Onehopsmsservice::onehopSaveLog('BackStock', $legendstemp, $customerVal['phone_mobile']);\n }\n }\n }\n }\n }", "public function takeFromStock($quantity = 1) {\n $this->leftInStock = $this->leftInStock - $quantity;\n $this->save();\n }", "public function updateCart(Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n\n\n // get quantity from Form Request\n $quantity = $request->all();\n //dd($quantity);\n if (!empty($carts)) {\n foreach( $quantity['cart_quantity'] as $key => $qty){\n\n // get quantity from data\n $product = Product::findOrFail($key);\n $quantityDB = $product->quantity;\n // so sánh\n if($qty<=$quantityDB){\n foreach ($carts as $id => $value) {\n if ($value['id'] == $key) {\n $carts[$id]['quantity'] = $qty;\n }\n }\n }\n else{\n return redirect()->back()->with('error','Quantity exceeds stock. Please re-enter the quantity !');\n }\n }\n //update session\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->back()->with('success','Update quantity success!');\n }\n }", "public function CartQuantity(Request $request, $id)\n {\n $data = $request->all();\n if ($data['value'] != null && $data['value'] > 0) {\n $cartOld = AddToCartModel::find($id);\n if ($cartOld) {\n $cartOld->quantity = $data['value'];\n $cartOld->save();\n return \"success\";\n }\n } else {\n $return = array(\"error\", \"Quantity must be more than zero.\");\n return $return;\n }\n }", "public function update(Request $request, $id)\n {\n \n $cart = Cart::find($id);\n if (!is_null($cart)) {\n $cart->product_quantity = $request->product_quantity;\n $cart->save();\n }else {\n return redirect()->route('carts');\n }\n session()->flash('success', 'Cart item has updated successfully !!');\n return back();\n }", "public function edit(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n if($product){\n\n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product exists in cart\n $item->quantity = $request->quantity;\n $item->save();\n\n return redirect()->back()->with('success', 'Product quantity modified');\n }\n }\n\n }else{\n\n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity = $request->quantity;\n \n return redirect()->back()->with('success', 'Product quantity modified');\n }\n }\n\n }\n\n }\n\n // case product is not in cart\n return redirect()->back()->with('error', 'This product is not in your cart');\n\n }\n\n // case product not found \n return redirect()->back()->with('error', 'Product not found!');\n\n }", "public function update($cartItemId)\n {\n // exit('thre');\n // echo \"<pre>\"; print_r($_REQUEST); exit('outt');\n // echo \"<pre>\"; print_r($cartItemId); exit('out');\n Cart::updateQuantity(decrypt($cartItemId), request('qty'));\n\n try {\n resolve(Pipeline::class)\n ->send(Cart::coupon())\n ->through($this->checkers)\n ->thenReturn();\n } catch (MinimumSpendException | MaximumSpendException $e) {\n Cart::removeOldCoupon();\n }\n\n // Cart\n\n if($_REQUEST['_method'] == 'put' && isset($_REQUEST['advance_options']) ){\n\n // echo \"<pre>\"; print_r($_REQUEST); exit('thy');\n\n Cart::remove(decrypt($_REQUEST['cart_item_id'])); //self::destory($_REQUEST['cart_item_id'], 'update');\n\n // advance_options\n $_REQUEST['advance_options']['product_id'] = $_REQUEST['product_id'];\n\n $res = Cart::store($_REQUEST['product_id'], 1,[], $_REQUEST['advance_options']);\n\n }\n\n return back()->withSuccess(trans('cart::messages.quantity_updated'));\n }", "public function astra_add_cart_single_product_quantity() {\n\n\t\t\tcheck_ajax_referer( 'single_product_qty_ajax_nonce', 'qtyNonce' );\n\n\t\t\t$cart_item_key = sanitize_text_field( $_POST['hash'] );\n\n\t\t\t$threeball_product_values = WC()->cart->get_cart_item( $cart_item_key );\n\n\t\t\t$threeball_product_quantity = apply_filters(\n\t\t\t\t'woocommerce_stock_amount_cart_item',\n\t\t\t\tapply_filters(\n\t\t\t\t\t'woocommerce_stock_amount',\n\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t'/[^0-9\\.]/',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tfilter_var( $_POST['quantity'], FILTER_SANITIZE_NUMBER_INT )\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t$cart_item_key\n\t\t\t);\n\n\t\t\t$passed_validation = apply_filters(\n\t\t\t\t'woocommerce_update_cart_validation',\n\t\t\t\ttrue,\n\t\t\t\t$cart_item_key,\n\t\t\t\t$threeball_product_values,\n\t\t\t\t$threeball_product_quantity\n\t\t\t);\n\n\t\t\tif ( $passed_validation ) {\n\t\t\t\tWC()->cart->set_quantity(\n\t\t\t\t\t$cart_item_key,\n\t\t\t\t\t$threeball_product_quantity,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdie();\n\t\t}", "public function update(Request $request, $id) {\n $new_quantity = $request->post('quantity-input');\n\n // find requested cart item of logged user in DB and update it\n if(Auth::check()){\n $cartItem = CartItem::find($id);\n\n $this->authorize('update', $cartItem);\n\n $cartItem->update(['amount'=>$new_quantity]);\n }\n\n // find requested cart item of guest in session and update it\n else {\n $cartItems = session()->get('cartItems');\n session()->forget('cartItems');\n\n foreach ($cartItems as $key => &$item) {\n\n if ($key == $id) {\n $cartItems[$key]['amount'] = $new_quantity;\n break;\n }\n }\n\n session()->put('cartItems',$cartItems);\n }\n\n return redirect('/cart');\n }", "public function updateCart() {\n if (func_num_args() > 0):\n $userid = func_get_arg(0);\n $productid = func_get_arg(1);\n $quantity = func_get_arg(2);\n $cost = func_get_arg(3);\n $hotelid = func_get_arg(4);\n $select = $this->select()\n ->from($this)\n ->where('user_id = ?', $userid)\n ->where('product_id = ?', $productid)\n ->where('hotel_id = ?', $hotelid);\n $res = $this->getAdapter()->fetchRow($select);\n\n $value = 1;\n if ($quantity['quantity'] === 'increase') {\n $data = array('quantity' => new Zend_Db_Expr('quantity + ' . $value),\n 'cost' => new Zend_Db_Expr('cost + ' . $cost));\n } else if ($quantity['quantity'] === 'decrease' && $res['quantity'] > 1) {\n $data = array('quantity' => new Zend_Db_Expr('quantity - ' . $value),\n 'cost' => new Zend_Db_Expr('cost - ' . $cost));\n } else {\n $value = 0;\n $cost = 0;\n $data = array('quantity' => new Zend_Db_Expr('quantity + ' . $value),\n 'cost' => new Zend_Db_Expr('cost + ' . $cost));\n }\n try {\n $where[] = $this->getAdapter()->quoteInto('user_id = ?', $userid);\n $where[] = $this->getAdapter()->quoteInto('product_id = ?', $productid);\n $where[] = $this->getAdapter()->quoteInto('hotel_id = ?', $hotelid);\n $result = $this->update($data, $where);\n if ($result) {\n try {\n $select = $this->select()\n ->from($this)\n ->where('user_id = ?', $userid)\n ->where('product_id = ?', $productid)\n ->where('hotel_id = ?', $hotelid);\n $response = $this->getAdapter()->fetchRow($select);\n if ($response) {\n $select = $this->select()\n ->from($this, array(\"totalcost\" => \"SUM(cost)\"))\n ->where('user_id = ?', $userid)\n ->where('hotel_id = ?', $hotelid);\n $res = $this->getAdapter()->fetchRow($select);\n $response['total'] = $res['totalcost'];\n if ($response) {\n return $response;\n } else {\n return null;\n }\n } else {\n return null;\n }\n } catch (Exception $ex) {\n \n }\n } else {\n return null;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n else:\n throw new Exception(\"Argument not passed\");\n endif;\n }", "function hapus_cart(){\n \t$data = array(\n \t\t'rowid' => $this->input->post('row_id'), \n \t\t'qty' => 0, \n \t);\n \t$this->cart->update($data);\n \techo $this->show_cart();\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "function hapus_cart(){\n\t\t$data = array(\n\t\t\t'rowid' => $this->input->post('row_id'), \n\t\t\t'qty' => 0, \n\t\t);\n\t\t$this->cart->update($data);\n\t\techo $this->show_cart();\n\t}", "public function incrQty($increment) {\n $this->setQty($this->getQty() + $increment);\n }", "public function deletecartitem() {\n $userId = $_POST['userId'];\n $itemId = $_POST['itemId'];\n $shopId = $_POST['shopId'];\n $size = $_POST['size'];\n if (isset($_POST['qnty'])) {\n $qnty = $_POST['qnty'];\n } else {\n $qnty = 0;\n }\n $cartId = TableRegistry::get('Carts');\n // DELETE & UPDATE ITEM & QUANTITY IN CART\n $query = $cartId->query();\n if ($qnty == 0) {\n $query->delete()\n ->where(['user_id' => $userId])\n ->where(['payment_status' => 'progress'])\n ->where(['id' => $itemId])\n ->execute();\n } else {\n $query->update()\n ->set(['quantity' => $qnty])\n ->where(['user_id' => $userId])\n ->where(['id' => $itemId])\n ->execute();\n }\n\n $itemCount = TableRegistry::get('Carts')->find('all')->where(['user_id' => $userId])->where(['payment_status' => 'progress'])->count();\n if ($itemCount == 0) {\n $this->Flash->success('Your Shopping Cart is Empty');\n echo '0';\n die;\n } else {\n return $this->updatecart();\n }\n }", "public function removeItemFromCart( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->select('quantity')->from(TABLES::$ORDER_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif(count($result) > 0) {\r\n\t\t\t\tif ($result[0]['quantity'] <=1 ) {\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->delete(TABLES::$ORDER_CART);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$quantity = $result[0]['quantity'];\r\n\t\t\t\t\t$qty = array();\r\n\t\t\t\t\t$qty['quantity'] = $quantity - 1;\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function update_cart_item($book_id, $quantity)\n\t{\n\t\t$items = $this->get_cart_items();\n\n\t\t$items[$book_id]['qty'] = $quantity;\n\t\t$this->ci->session->set_userdata('cart_items', $items);\n\n\t\treturn $this->get_cart_items();\n\t}", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }" ]
[ "0.84345835", "0.79758817", "0.78904253", "0.7739696", "0.77150273", "0.7635611", "0.76076293", "0.7559233", "0.7545109", "0.7508889", "0.74151874", "0.73155046", "0.7195504", "0.71945745", "0.7186388", "0.71679765", "0.7129428", "0.7128203", "0.70499873", "0.7047494", "0.7045944", "0.70348966", "0.7033856", "0.6998983", "0.6998734", "0.69978106", "0.69976074", "0.6967959", "0.6933877", "0.6929687", "0.69278437", "0.69246", "0.6901605", "0.6857466", "0.6856196", "0.6848771", "0.68414277", "0.6837131", "0.6829271", "0.6823379", "0.68022996", "0.67858094", "0.678256", "0.67517924", "0.6742765", "0.67296416", "0.669666", "0.66633004", "0.66587317", "0.6648104", "0.66378134", "0.6633938", "0.66238296", "0.66199213", "0.66110057", "0.6602222", "0.6587262", "0.6585008", "0.6576428", "0.6575061", "0.6564646", "0.6557055", "0.65530765", "0.653805", "0.65243244", "0.65069866", "0.65015316", "0.6494498", "0.6475839", "0.64671844", "0.64569736", "0.64533615", "0.6441196", "0.6440571", "0.6425409", "0.64244235", "0.6422684", "0.64208496", "0.64203066", "0.6407122", "0.64045274", "0.64028347", "0.6397906", "0.6393744", "0.6385074", "0.63769454", "0.6358659", "0.6353173", "0.63493216", "0.6349066", "0.6347432", "0.63429534", "0.6337545", "0.6332707", "0.6329999", "0.63178915", "0.6315288", "0.630859", "0.6306748", "0.63042784" ]
0.63563883
87
Removes an items from the cart
public function remove($id) { $this->loadItems(); if (array_key_exists($id, $this->items)) { unset($this->items[$id]); } $this->saveItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($items = array())\n {\n if (($this->_checkCartRemove($items) === TRUE) && isset($this->_session['products'][$items['token']]) )\n {\n $cart = $this->_session['products'][$items['token']];\n unset($this->_session['products'][$items['token']]);\n $this->trigger(CartEvent::EVENT_REMOVE_ITEM_POST, $items['token'], $cart, $this);\n }\n }", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function clearCart(){\r\n\t\t$this->cart_items = array();\r\n\t\t$this->latestItemId = 1;\t\t\r\n\t}", "public function removeItem(Cart $cart, CartItem $item);", "public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }", "public function removeItems($products)\n {\n }", "public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }", "public function remove(...$items);", "function deleteCartItem()\n {\n $item_id = $_POST['movie_id'];\n\n // User is not logged in\n if (!LoggedIn::user()) {\n\n $storeItem = 1;\n $movieItem = 0;\n $sessionType = \"\";\n\n $category_id = $_POST['category_id'];\n\n // if cart or store\n\n if ($category_id == $movieItem) {\n\n $sessionType = 'cart';\n\n } else if ($category_id == $storeItem) {\n\n $sessionType = 'store_items';\n }\n\n\n // CART\n foreach ($_SESSION[$sessionType] as $key => $value) {\n foreach ($value as $movie => $id) {\n if ($id == $item_id) {\n // Is match then remove element at position $key eg 0, 1, 2 ,3 in the array\n unset($_SESSION[$sessionType][$key]);\n }\n }\n }\n\n\n // STORE\n\n\n } else {\n\n // IF USER IS LOGGED IN USE THIS (TODO::LATER)\n Cart_item::where('movie_id', '=', $item_id)->delete();\n }\n }", "public function removeItemFromCart( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->select('quantity')->from(TABLES::$ORDER_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif(count($result) > 0) {\r\n\t\t\t\tif ($result[0]['quantity'] <=1 ) {\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->delete(TABLES::$ORDER_CART);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$quantity = $result[0]['quantity'];\r\n\t\t\t\t\t$qty = array();\r\n\t\t\t\t\t$qty['quantity'] = $quantity - 1;\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function testRemoveItem()\n {\n $cart = new Cart(['foo']);\n $cart->removeItem('foo');\n $this->assertEquals([], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 3]);\n $cart->removeItem(3);\n $this->assertEquals(['bar', 'foo', 'horse'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 'bar', 'horse', 3]);\n $cart->removeItem('foo');\n $this->assertEquals(['bar', 'bar', 'horse', 'horse', 3], $cart->getItems());\n }", "public function remove($id)\n {\n\t\t$item = $this->getItem($id);\n \t$cart = $this->session->get(self::SHOPPINGCART);\n $this->session->forget(self::SHOPPINGCART);\n for($i=0;$i<sizeof($cart);$i++)\n {\n if($cart[$i] == $item)\n {\n continue;\n }\n $this->session->push(self::SHOPPINGCART,$cart[$i]);\n }\n \n \tfor($i=0;$i<sizeof($this->items);$i++)\n {\n if($this->items[$i] == $item)\n {\n unset($this->items[$i]);\n }\n }\n }", "public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }", "public function removeFromCart() : void\n {\n $this->VIEW = false;\n $this->Cart->removeFromCart($_SESSION['Auth']->id, $_POST);\n }", "public function remove()\n {\n $key = $this->request->param('ID');\n $title = \"\";\n\n if (!empty($key)) {\n foreach ($this->items as $item) {\n if ($item->Key == $key) {\n $title = $item->Title;\n $this->items->remove($item);\n }\n }\n\n $this->save();\n \n if ($title) {\n $this->setSessionMessage(\n \"bad\",\n _t(\n \"Checkout.RemovedItem\",\n \"Removed '{title}' from your cart\",\n \"Message to tell user they removed an item\",\n array(\"title\" => $title)\n )\n );\n }\n }\n\n return $this->redirectBack();\n }", "function remove_cart_item($keyId) { \n //print_r($keyId); die;\n if(isset($keyId) && !empty($keyId)) { //\n $cart = $_SESSION['cart'];\n $rem_qty = $cart['item'][$keyId]['qty'];\n foreach($cart['item'] as $key => $val) { \n if ($key== $keyId) {\n if($cart['item'][$key]['qty'] > 1) {\n $cart['total'] = $cart['total'] - ($cart['item'][$key]['qty'] * $val['price']);\n $cart['itotal'] = $cart['itotal'] - ($cart['item'][$key]['qty'] * $val['price']);\n } else {\n $cart['total'] = $cart['total'] - $val['price'];\n $cart['itotal'] = $cart['itotal'] - $val['price'];\n }\n \n $cart['item'][$key]['qty'] = 0;\n //print_r($cart['itotal']); die;\n \n //$this->apply_coupon($cart['itotal']);\n \n $cart['tcount'] = $cart['tcount'] - 1;\n $cart['item'][$key]['price'] = 0;\n \n }\n\n } \n $this->session->set('cart', $cart);\n //echo \"<pre>\"; print_r($_SESSION['cart']); \"</pre>\"; die;\n for($i =1; $i<=$rem_qty; $i++ ) {\n $rem_val = array_pop($_SESSION['cart']['seats_selected']);\n \n }\n if(!empty($_SESSION['ccode'])) {\n $this->remove_coupon();\n }\n \n if($_SESSION['cart']['tcount'] <= 0) {\n $_SESSION['cart']['total'] = 0;\n $_SESSION['cart']['salestax'] = 0;\n $_SESSION['cart']['processingfees'] = 0;\n }\n return redirect()->to('/cart');\n } else {\n echo \"Item Not Removed\";\n }\n }", "public function deleteCart(){\n $cartItemModel = \\Ccc::objectManager('\\Model\\Item',false);\n\n foreach($this->getCartItems() as $item){\n $ids[] = $item->itemId;\n }\n \n if($cartItemModel->deleteData($ids)){\n return true;\n }\n\n return false;\n }", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "public function action_removeCartItem()\n {\n $cartItemId = $this->request->post('cartItemId');\n\n if(!is_null($cartItemId))\n {\n try\n {\n $modelCartItem = new Model_CartItemInfo();\n $modelCartItem->removeItem($cartItemId);\n\n $this->redirect('cart/index');\n }\n catch (Exception $e)\n {\n $this->request->status = 400;\n $this->request->response = View::factory('errors/400');\n }\n }\n else\n {\n $this->request->status = 406;\n $this->request->response = View::factory('errors/406');\n }\n }", "public function removeitem(Request $request) {\n Cart::remove([\n 'id' => $request->id,\n ]);\n return back()->with('success',\"Producto eliminado con éxito de su carrito.\");\n }", "public static function remove_specials_from_cart(){\n\n foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ){\n if ( self::is_item_special( $cart_item['product_id'] ) ){\n WC()->cart->set_quantity( $cart_item_key, 0 );\n $product_title = $cart_item['data']->get_title();\n\n wc_add_notice( sprintf( __( '&quot;%s&quot; has been removed from your cart. It cannot be purchased in conjunction with other products.', 'wc-only-item-in-cart' ), $product_title ), 'error' );\n }\n\n }\n\n }", "function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "function removeItem($itemKey){\n\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t//remove the item from the cart including all of its quantity\n\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t//code for if the items should be removed 1 item at a time \n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] - 1;\n\t\t\t\tif($this->items[$itemKey]['quantity'] == 0){\t\n\t\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function clear() {\n\t\t$this->load->library('cart');\n\t\tforeach($this->cart->contents() as $item) {\n\t\t\t\t$item['qty'] = 0;\n\t\t\t\t$this->cart->update($item);\n\t\t}\n\t\t$this->json->output(array(\"status\"=>\"success\", \"msg\"=>\"Your cart has been cleared.\"));\n\t}", "private function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n unset($this->items[$id]);\n }", "protected function removeAll()\n {\n if (isset($this->currentSession->cart)) {\n unset($this->currentSession->cart);\n }\n }", "public function removeItemFromCart($itemId)\n {\n $client = new GuzzleHttp\\Client();\n $res = $client->get($this->_link . '/removeItemApi/' . $itemId);\n $cartItems = json_decode($res->getBody());\n return redirect('/cart');\n }", "public function remove($cartId);", "public function unset_sess_cart_items()\n {\n if (!empty($this->session->userdata('mds_shopping_cart'))) {\n $this->session->unset_userdata('mds_shopping_cart');\n }\n }", "public function removeItem(string $sku): Cart;", "public function removeAction() {\r\n $response = Mage::getModel('ajaxcartpro/ajaxresponse');\r\n $id = $this->getRequest()->getParam('id');\r\n Mage::getSingleton('checkout/cart')->removeItem($id)->save();\r\n $response->setCart(Mage::helper('ajaxcartpro')->rendercartpageUpdate());\r\n $response->setSidebar(Mage::helper('ajaxcartpro')->cartItemssidebar());\r\n $response->setLinks(Mage::helper('ajaxcartpro')->topLinkTitle());\r\n $response->send();\r\n }", "public function remove_item(Request $request)\n {\n $user = $request->user();\n\n $validatedData = $request->validate([\n 'id' => 'required|integer|gte:1',\n 'item_id' => 'required|integer|gte:1',\n ]);\n\n $cart = $user->cart()->findOrFail($validatedData['id']);\n $item = $cart->items()->find($validatedData['item_id']);\n $item->delete();\n\n $response = [\n 'items' => CartItemCollection::collection(CartItem::where('cart_id', $cart->id)->get()),\n 'total' => $cart->cart_sub_total,\n ];\n\n return response()->json($response);\n }", "public function clearItems();", "public function clearCart()\n {\n $this->clearParams('cart');\n }", "public function deletecartitem() {\n $userId = $_POST['userId'];\n $itemId = $_POST['itemId'];\n $shopId = $_POST['shopId'];\n $size = $_POST['size'];\n if (isset($_POST['qnty'])) {\n $qnty = $_POST['qnty'];\n } else {\n $qnty = 0;\n }\n $cartId = TableRegistry::get('Carts');\n // DELETE & UPDATE ITEM & QUANTITY IN CART\n $query = $cartId->query();\n if ($qnty == 0) {\n $query->delete()\n ->where(['user_id' => $userId])\n ->where(['payment_status' => 'progress'])\n ->where(['id' => $itemId])\n ->execute();\n } else {\n $query->update()\n ->set(['quantity' => $qnty])\n ->where(['user_id' => $userId])\n ->where(['id' => $itemId])\n ->execute();\n }\n\n $itemCount = TableRegistry::get('Carts')->find('all')->where(['user_id' => $userId])->where(['payment_status' => 'progress'])->count();\n if ($itemCount == 0) {\n $this->Flash->success('Your Shopping Cart is Empty');\n echo '0';\n die;\n } else {\n return $this->updatecart();\n }\n }", "public function destroy()\n {\n $this->CI->session->unset_userdata('cartItems');\n }", "function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}", "public static function cart_remove_product()\n {\n if (!isset($_REQUEST['cart-item-key'])) {\n WordPress_Rewrite_API_Request::missing_params();\n }\n\n //@TODO Check item_key exist in Cart or Use $_REQUEST['product_id'] as item_key\n\n // Remove\n WooCommerce_Cart::remove_item_cart(sanitize_text_field($_REQUEST['cart-item-key']));\n\n // Result\n wp_send_json_success(self::_return_cart_list(), 200);\n }", "function removeItem() {\r\n \tglobal $itemsArray;\r\n\r\n\tif (isset( $_GET[\"itemId\"] )){\r\n\t$itemId = (int)$_GET[\"itemId\"];\r\n\t$price = $_GET[\"price\"];\r\n\r\n\tif ( isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\t\tunset( $_SESSION[\"cart\"][$itemId] );\r\n\t}\r\n\r\n\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]-1; //decrements the number of items in the cart \r\n\t$_SESSION[\"total\"] = $_SESSION[\"total\"]-$price; //decrement current total price by the price recived from the URL\r\n}\r\nsession_write_close();\r\n}", "public function removeItem($index) {\n $this->sessionCart->removeItem($index);\n }", "public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }", "public function clearCart(): void\n {\n CartFcd::clear();\n $this->updateCart();\n }", "public function clear_cart()\n {\n unset($_SESSION['cart']);\n }", "public function remove($request)\n {\n\n \\Cart::remove($request->id);\n return redirect()->route('cart.index')->with('success_msg', 'Item is removed!');\n\n }", "public function removeFromShoppingCart($id){\r\n $stmt = $this->DB->prepare(\"DELETE FROM shopping_cart WHERE Cart_ID = $id;\");\r\n $stmt->execute();\r\n }", "public function destroy(Items $items)\n {\n //\n }", "public function removeCartItem($itemId){\r\n\t\tfor($i=0;$i<(count($this->cart_items));$i++){\r\n\t\t\tif($this->cart_items[$i]->itemId==$itemId){\r\n\t\t\t\tunset($this->cart_items[$i]);\r\n\t\t\t\t$this->cart_items = array_values($this->cart_items);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function removeItems(array $items)\n {\n foreach ($items as $item) {\n $this->em->remove($item);\n }\n }", "public function actionDelItem() {\n $id = Yii::$app->request->get('id');\n $session = $this->session;\n $cart = new Cart();\n $cart->recalc($id);\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "public function remove($item);", "public function remove_item($data)\n {\n $required = array(\n 'id' => 'Cart item id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removeProduct($cart, $data['id'], true);\n }", "function remove($id) \n\t{\n\t\tif ($id==\"all\" || $this->uri->segment(3) == 'all') {\n\t\t\t$this->cart->destroy();\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'rowid' => $id,\n\t\t\t\t'qty' => 0\n\t\t\t);\n\n\t\t\t$this->cart->update($data);\n\t\t}\n\n\t\t$cart = $this->cart->contents();\n\n\t\tif($this->uri->segment(2) == 'remove-ajax' ) {\n\t\t\t$grand_total = 0;\n\n foreach ($cart as $item) {\n \t$grand_total += $item['subtotal'];\n }\n\n $total = $this->cart->total_items();\n \n\t\t\techo json_encode(array(\n\t\t\t\t'result' => 'Xóa giỏ hàng thành công', \n\t\t\t\t'grand_total' => $grand_total,\n\t\t\t\t'total' => $total\n\t\t\t)); exit();\n\t\t}\n\n\t\tredirect();\n\t}", "public static function removeItem($item_id) {\n global $lC_Database, $lC_Language, $lC_Currencies, $lC_Customer, $lC_ShoppingCart, $lC_Image;\n\n $result = array();\n \n $lC_ShoppingCart->remove($item_id);\n \n // crete the new order total text\n $otText = '';\n foreach ($lC_ShoppingCart->getOrderTotals() as $module) {\n $otText .= '<tr>' .\n ' <td class=\"align_left' . (($module['code'] == 'sub_total') ? ' sc_sub_total' : null) . (($module['code'] == 'total') ? ' sc_total' : null) . '\" style=\"padding-right:10px;\">' . $module['title'] . '</td>' .\n ' <td class=\"align_right' . (($module['code'] == 'sub_total') ? ' sc_sub_total' : null) . (($module['code'] == 'total') ? ' sc_total' : null) . '\">' . $module['text'] . '</td>' .\n '</tr>';\n }\n \n $result['otText'] = $otText;\n \n // create the new mini-cart text\n $mcText = '';\n if ($lC_ShoppingCart->hasContents()) {\n $mcText .= '<a href=\"#\" class=\"minicart_link\">' . \n ' <span class=\"item\"><b>' . $lC_ShoppingCart->numberOfItems() . '</b> ' . ($lC_ShoppingCart->numberOfItems() > 1 ? strtoupper($lC_Language->get('text_cart_items')) : strtoupper($lC_Language->get('text_cart_item'))) . ' /</span> <span class=\"price\"><b>' . $lC_Currencies->format($lC_ShoppingCart->getSubTotal()) . '</b></span>' . \n '</a>' .\n '<div class=\"cart_drop\">' .\n ' <span class=\"darw\"></span>' .\n ' <ul>';\n\n foreach ($lC_ShoppingCart->getProducts() as $products) {\n $mcText .= '<li>' . $lC_Image->show($products['image'], $products['name'], null, 'mini') . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $products['keyword']), '(' . $products['quantity'] . ') x ' . $products['name']) . ' <span class=\"price\">' . $lC_Currencies->format($products['price']) . '</span></li>';\n } \n \n $mcText .= '</ul>' .\n '<div class=\"cart_bottom\">' .\n '<div class=\"subtotal_menu\">' .\n '<small>' . $lC_Language->get('box_shopping_cart_subtotal') . '</small>' .\n '<big>' . $lC_Currencies->format($lC_ShoppingCart->getSubTotal()) . '</big>' .\n '</div>' .\n '<a href=\"' . lc_href_link(FILENAME_CHECKOUT, null, 'SSL') . '\">' . $lC_Language->get('text_checkout') . '</a>' .\n '</div>' .\n '</div>';\n $result['redirect'] = '0';\n } else {\n $mcText .= $lC_Language->get('box_shopping_cart_empty');\n $result['redirect'] = '1';\n } \n \n $result['mcText'] = $mcText;\n \n \n return $result;\n }", "public function remove($rowid) {\n\t\t \n\t\tif ($rowid===\"all\"){\n\t\t\t$this->cart->destroy(); //invokes destroy() method of Cart class.\n\t\t}\n\t\telse{\n\t\t\t$data = array(\n\t\t\t\t'rowid' => $rowid,\n\t\t\t\t'qty' => 0\n\t\t\t);\n\t\t\t$this->cart->update($data); //invokes update() method of Cart class.\n\t\t}\n\t\tredirect('cart'); //redirect to the same controller but in index method\n\t}", "public function delete($id)\n\t{\n\t\tif(isset($this->items[$id])){\n\t\t\t$this->items[$id]['quantity']--;\n\t\t\t$this->totalQuantity--;\n\t\t\tif($this->items[$id]['quantity'] <= 0){\n\t\t\t\tunset($this->items[$id]);\n\t\t\t}\n\t\t}\n\t\tsession(['cart' => $this->items]);\n\t}", "public function clearCart(): Cart;", "public function removeCartItem($user, $cart_id, $item_id){\n $data['error']=true;\n $dlt = $this->redis->hDel(md5($user).':cart_'.$cart_id, $item_id);\n if($dlt != false){\n // $updated_cart = $this->redis->hGetAll($user.\":cart_\".$cart_id);\n $data['error']=false;\n $data['content']=$item_id;\n }\n return $data;\n }", "private function _checkCartRemove($items)\n {\n if (!isset($items['token']))\n {\n throw new \\Exception('The Remove method takes an array that must contain token.');\n return FALSE;\n }\n return TRUE;\n }", "public function remove_item($item_id) \n\t{\n\t\tif($this->cart[$item_id] == 1)\n\t\t{\n\t\t\tunset($this->cart[$item_id]);\n\t\t}\n\t\telse if(isset($this->cart[$item_id]))\n\t\t{\n\t\t\t$this->cart[$item_id]--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"Item not found\";\n\t\t}\n\t\tSession::set('cart', $this->cart);\n\t\treturn true;\n\t}", "public function clearCart()\n {\n $this->model->destroy();\n }", "public function remove(Request $request): void\n {\n \\Cart::remove($request->get('product_id'));\n }", "public function remove(){\n\n $id = $this->input->post('i');\n $type = $this->input->post('t');\n\n if(empty($id) || empty($type)){\n die('No direct access');\n }\n\n //Fetch cookie\n $basket = $this->input->cookie('basket');\n\n if(empty($basket)){\n die('You have nothing in your cart');\n }\n\n $response = unserialize( $basket );\n\n if( in_array($id,$response) ){\n\n $pos = array_search( $id,$response );\n\n unset($response[$pos]);\n\n if( count($response) == 0 ){\n\n $this->load->helper('cookie');\n\n delete_cookie('basket');\n\n }else{\n\n $cookie = array(\n 'name' => 'basket',\n 'value' => serialize( $response ),\n 'expire' => '86500',\n 'path' => '/'\n );\n\n $this->input->set_cookie( $cookie );\n\n }\n\n\n\n echo 'success';\n\n } else {\n\n echo 'Item not in cart';\n\n }\n\n\n\n }", "public function postRemoveItems()\n\t{\n\t\tif (!$this->request->ajax()) { return $this->ajaxErrorResponse(); }\n\n\t\t$ids = explode(',', $this->request->input('types'));\n\t\t$ids = count($ids) && $ids[0] != '' ? $ids : [];\n\t\t$items = $this->item_model->whereIn('typeID', $ids)->get();\n\n\t\ttry {\n\t\t\tif ($items->count() == 0) {\n\t\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\t\ttrans('buyback.messages.remove_items_nothing', $items->count()));\n\t\t\t}\n\n\t\t\t$items->each(function ($item) { $item->delete(); });\n\n\t\t\treturn $this->ajaxSuccessResponse(\n\t\t\t\ttrans_choice('buyback.messages.remove_items_success', $items->count() == 1 ? 1 : 2));\n\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\ttrans_choice('buyback.messages.remove_items_failure', $items->count() == 1 ? 1 : 2));\n\t\t}\n\t}", "public function removeItem()\n\t{\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t$id = \"\";\n\t\tif($this->request->is(array('POST')))\n\t\t{\n\t\t\t$data = $this->request->data;\n\t\t\t$cateId = $data['cate_id'];\n\t\t\t$row = $data['row'];\n\t\t\t$id= '';\n\t\t\tif($this->Session->check('item_'.$cateId))\n\t\t\t{\n\t\t\t\t$itemId = $this->Session->read('item_'.$cateId);\n\t\t\t\tif(!empty($itemId))\n\t\t\t\t{\n\t\t\t\t\t$i = $row*2 -2;\n\t\t\t\t\tif(isset($itemId[$i+1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i+1]);\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($itemId[$i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->Session->write('item_'.$cateId,$itemId);\n\t\t\t\t\t$id = implode(',',$itemId);\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $id;\n\t\t\texit;\n\t}", "public function emptyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.empty', $this->instance);\n }", "public function removeItemFromCartById($itemModelNum)\n {\n if ( !empty($this->cartItems) )\n {\n $i = 0;\n foreach ( $this->cartItems as $item )\n {\n if ( $item )\n {\n if ( $item->getModelNumber() == $itemModelNum )\n {\n unset($this->cartItems[i]);\n break;\n }\n $i++;\n }\n }\n }\n else\n {\n echo \"Cart is empty. Cannot Remove\";\n }\n Cart::updateTotalPrice();\n }", "public function actionRemoveFromBasket()\n\t{\n\t\t$removeThis = array($_GET['imageid']);\n\t\t$basket = Yii::app()->user->getState('basketContents');\n\t\t$newBasket = array_diff($basket,$removeThis);\n\t\t// reduces useless keys, blank keys, from the array\n\t\t$newBasket = array_values($newBasket);\n\t\tYii::app()->user->setState('basketContents',$newBasket);\n\t}", "public function action_item_remove(Request $request, Response $response)\n\t{\n\t\t$values = $request->query();\n\n\t\t$restock = ORM::factory('Store_Restock', $values['restock_id']);\n\n\t\tif(!$restock->loaded())\n\t\t{\n\t\t\tRD::set(RD::ERROR, 'No restock record found.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$restock->delete();\n\t\t\tRD::set(RD::SUCCESS, 'Item successfully removed from the store\\'s stock');\n\t\t}\n\t}", "public function remove_from_cart($qty=0, $oid=0, $proid=0) {\n\t\tif($qty) {\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ? WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($qty,$oid,$prodid);\n\t\t\n\t\t} else {\n\t\t\t$query = \"DELETE FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($oid,$prodid);\n\n\t\t}\n\t\treturn $this->db->query($query,$values);\n\t}", "public function empty_cart()\n\t{\n\t\t$option = JRequest::getVar('option');\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 empty_cart method of model to remove all products from cart\n\t\t$model->empty_cart();\n\t\t$user = JFactory::getUser();\n\n\t\tif ($user->id)\n\t\t{\n\t\t\t$this->_carthelper->removecartfromdb(0, $user->id, true);\n\t\t}\n\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}", "public function deleteCart(Request $request){\n Cart::remove($request->rowId);\n if(Cart::count()==0){\n session(['discount'=>0]);\n }\n Session::flash('success','Item delted!');\n return redirect()->route('accounts.get_cart');\n\n }", "public function removeItem($type, $id)\n {\n if(Auth::check())\n {\n $userId = Auth::id(); // user id\n $userCart = Cart::userCart($userId); //finding cart object of this user\n $cartId = $userCart->id; // finding user's cart ID\n\n $item = Cartable::FindItem($cartId, $type, $id); //finding specified item in the cart\n\n switch($type)\n {\n case 'file':\n $result = $userCart->files()->detach($item->cartable_id);\n break;\n case 'episode':\n $result = $userCart->episodes()->detach($item->cartable_id);\n break;\n case 'plan':\n $result = $userCart->plans()->detach($item->cartable_id);\n break;\n }\n\n if($result)\n {\n $message = 'محصول موردنظر از سبد خرید حذف شد.';\n }\n else\n {\n $message = 'محصول موردنظر در سبد خرید موجود نیست.';\n }\n }\n else //if user is not logged in then remove item from session\n {\n $userCart = Session::get('cart');\n\n\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->removeItem($type, $id);\n Session::put('cart', $cart);\n }\n\n return redirect()->route('shoppingCart')->with('message', $message);\n }", "public function deleteFromCart($prod_id){\n $this->cartConstruct();\n $this->removeItem($prod_id);\n if(count($this->items)>0)\n {\n Session::put('cart',$this);\n }\n else\n {\n Session::forget('cart',$this);\n }\n return redirect()->back();\n\t}", "function deleteCart() {\n\t\t$queryString = \"DELETE FROM cart;\";\n\n\t\tif ($stmt = $this->connection->prepare($queryString)) {\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\theader(\"Location: http://serenity.ist.rit.edu/~qsb2538/341/project1/cart.php\");\n\t\t}\n\t}", "public function deleting(Cart $cart)\n {\n //\n }", "public function testRemovesOneUnitOfItemFromCart()\n {\n }", "function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }", "public function deleteAction() {\r\n $id = (int) $this->getRequest()->getParam('id');\r\n if ($id) {\r\n try {\r\n $this->_getCart()->removeItem($id)\r\n ->save();\r\n } catch (Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot remove the item.'));\r\n $_response->send();\r\n\r\n Mage::logException($e);\r\n }\r\n }\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n\r\n $_response->setMessage($this->__('Item was removed.'));\r\n\r\n //append updated blocks\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n $_response->addUpdatedBlocks($_response);\r\n\r\n $_response->send();\r\n }", "function clearCart() {\r\n\tunset($_SESSION['cart']);\r\n}", "public function deleteCart($id)\n {\n $data['cart'] = DB::table('carts')\n ->where('id', $id)\n ->delete(); //delete data from db table.cart based on item id\n\n return back()->with('success', 'Removed Item From Cart!');\n }", "function delete_cart_item($row_id = FALSE) \n\t\t{\n\t\t\t$this->flexi_cart->delete_items($row_id);\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\t\t\n\t\t}", "public function itemDelete(Request $request)\n {\n $data = $request;\n $goodsData = Cart::content();\n\n if (!empty($data)) {\n $id = $data['id']; // id товара\n $rowId = self::searchInCart($id, $goodsData); //ищем этот товар в корзине\n\n if (!is_null($rowId)) { // если не пустой $rowId\n\n $result = Cart::remove($rowId); // удаляем\n }\n }\n }", "public function removeCart(Request $request)\n {\n $cart = new Cart($request);\n $item = Product::find($request->get('product_id'));\n if(!empty($item)) {\n $data = $cart->deleteItem($item,1,$request);\n return response()->json([\"message\" => __(\"Product remove from cart\"),\"data\" => $data]);\n }\n return response()->setStatusCode(404)->json([\"message\" => \"Product not found\"]);\n\n }", "private function removeOneItemFromCart( $cartItems, $productId ) {\n\t\t$newCartItems = new Collection();\n\t\t$foundIt = false;\n\t\tforeach ( $cartItems as $item ) {\n\t\t\tif ( $item->id == $productId ) {\n\t\t\t\tif($foundIt === false) {\n\t\t\t\t\t$foundIt = true;\n\t\t\t\t}else {\n\t\t\t\t\t$newCartItems->push( $item );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$newCartItems->push( $item );\n\t\t\t}\n\t\t}\n\t\treturn $newCartItems;\n\t}", "public function destroy($item)\n {\n // dd($item);\n Cart::remove($item);\n return back()->with('success_message','Item was deleted ');\n }", "public function removeCart($id){\n\n CartItem::destroy($id);\n return redirect('/product_carts')->withSuccessRemoveCartMessage('Product cart has been removed!');\n //->withSuccessRemoveCartMessage('Product cart has been removed!');\n }", "public function remove_item($code){\n\t\t\t$id = md5($code);\n\t\t\tunset($_SESSION['cart'][$id]);\n\t\t\t//Actualiza el carro con el ultimo cambio\n\t\t\t$this->update_cart();\n\t\t\treturn true;\n\t\t}", "public function testRemoveItem()\n {\n $item = $this->addItem();\n\n $this->laracart->removeItem($item->getHash());\n\n $this->assertEmpty($this->laracart->getItem($item->getHash()));\n }", "public function delete_cart_post(){\n $rowid = $this->input->post('row_id');\n $r = $this->cart->remove($rowid);\n $result = array();\n if ($r) {\n\n $result['result'] = '1';\n $result['data'] = $this->cart->contents();\n $result['totals_rows'] = $this->cart->total_items();\n $result['pagination'] = false;\n }\n else\n {\n $result['result'] = '2';\n $result['message'] = 'Error al agregar al carrito';\n }\n\n $this->response($result,201);\n }", "public static function cart_process_remove($id){\r\n\r\n\t\t\t// Remove ID from Cart\r\n\t\t\tif (isset($id)) {\r\n\t\t\t\t$cartArray = $_SESSION['cartArray'];\r\n\t\t\t\t$cartString = implode(\",\", $cartArray);\r\n\r\n\t\t\t\t// TODO: FIX this, if ID = 3, changes 38 to 8\r\n\t\t\t\t$cartString = str_replace($id .\"\", \"\", $cartString);\r\n\t\t\t\t$cartString = RBAgency_Common::clean_string($cartString);\r\n\r\n\t\t\t\t// Put it back in the array, and wash your hands\r\n\t\t\t\t$_SESSION['cartArray'] = array($cartString);\r\n\t\t\t}\r\n\r\n\t\t\t// echo \"TEST\";\r\n\t\t}", "public function removeCart($id,Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n //dd($carts);\n\n //delete item\n Arr::pull($carts, $id);\n\n // store session\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->route('cart.cart-info');\n }", "public function removed_from_cart( $cart_item_key ) {\n\n\t\tif ( isset( SV_WC_Plugin_Compatibility::WC()->cart->cart_contents[ $cart_item_key ] ) ) {\n\n\t\t\t$item = SV_WC_Plugin_Compatibility::WC()->cart->cart_contents[ $cart_item_key ];\n\n\t\t\t$this->api_record_event( $this->event_name['removed_from_cart'], array( 'product name' => get_the_title( $item['product_id'] ) ) );\n\t\t}\n\t}", "public function clear($synchronize = false) {\r\n $this->items = array();\r\n if ($synchronize && $this->user->profile['userid'] !== -1) {\r\n return $this->user->context->dbDriver->remove(RestoDatabaseDriver::CART_ITEMS, array('email' => $this->user->profile['email']));\r\n }\r\n }", "public function remove($item) {\n unset($this->items[$item->id()]);\n }", "function remove()\n {\n $items = @implode(\", \", Misc::escapeInteger($_POST[\"items\"]));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"news\n WHERE\n nws_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n self::removeProjectAssociations($_POST['items']);\n return true;\n }\n }", "public function removeItem ( $item ) {\n\n if ( is_object( $item ) ) {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Object: ' . $item->getIdentifier() );\n } else {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Identifier: ' . $item );\n }\n\n\n $item = is_object( $item ) ? $item : $this->getOrder()->getItem( $item );\n\n $orderApi = new OrdersApi( );\n\n\n//\t\tdie(print_r($this->getOrder()->getItems(),true));\n //TODO: Check if the item exists, we have to remove it and add the new one.\n if ( $this->getOrder()->itemExists( $item->getIdentifier() ) ) {\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Item found: ' . $item->getIdentifier() );\n\n $orderApi->removeItem( $this->order, $item );\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Updating order after item removed: ' . $item->getIdentifier() );\n $this->update();\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item removed sucessfully', $this->order );\n }\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item not found', $this->order );\n }", "public function actionDelItemView() {\n $id = Yii::$app->request->get('id');\n $session = $this->session;\n $cart = new Cart();\n $cart->recalc($id);\n $qty_sum['qty'] = $session['cart.qty'];\n $qty_sum['sum'] = Currency::getPrice($session['cart.sum'], true);\n echo json_encode($qty_sum); // array of values to insert into cart table at the checkout page\n }", "protected function clear_cart()\n {\n $GLOBALS['cart']->reset(true);\n\n tep_session_unregister('sendto');\n tep_session_unregister('billto');\n tep_session_unregister('shipping');\n tep_session_unregister('payment');\n tep_session_unregister('comments');\n }", "function removeFromCart ($productID, $amount) {\r\n if (checkCart()) {\r\n if (array_key_exists($productID, $_SESSION['cart'])) {\r\n if ($amount >= $_SESSION['cart'][$productID]['amount'] || $amount == 'all') {\r\n //remove item completely\r\n unset($_SESSION['cart'][$productID]);\r\n } else {\r\n //remove item partially\r\n $_SESSION['cart'][$productID]['amount'] = $_SESSION['cart'][$productID]['amount'] - $amount;\r\n }\r\n }\r\n }\r\n}" ]
[ "0.78974086", "0.76858616", "0.75085753", "0.7496261", "0.748771", "0.74585634", "0.7336066", "0.7269179", "0.72423506", "0.7196607", "0.7170548", "0.71522534", "0.7123197", "0.7096081", "0.7062699", "0.70258814", "0.7019003", "0.70185167", "0.7005794", "0.699055", "0.6990102", "0.69272834", "0.691049", "0.6907827", "0.6899729", "0.68764603", "0.68242586", "0.6810234", "0.6801504", "0.67989635", "0.6795485", "0.6778637", "0.675537", "0.6734952", "0.6733749", "0.67336094", "0.67317635", "0.6705989", "0.6694929", "0.6674785", "0.66522324", "0.6645156", "0.6637541", "0.6590119", "0.6581642", "0.65771586", "0.65700984", "0.65614533", "0.6541557", "0.65359676", "0.6530547", "0.6527758", "0.65267885", "0.6526682", "0.6501523", "0.6501211", "0.64993507", "0.6484684", "0.6480041", "0.6473592", "0.6468737", "0.64598644", "0.64486206", "0.6429768", "0.6416339", "0.6409755", "0.64040285", "0.6394154", "0.6393117", "0.63869035", "0.63740027", "0.6371179", "0.6370956", "0.6370677", "0.63585556", "0.63455373", "0.6344749", "0.63406587", "0.63352406", "0.6330171", "0.6325053", "0.6321705", "0.6320737", "0.6318146", "0.6309671", "0.62892884", "0.62858295", "0.62722087", "0.6258435", "0.6258258", "0.62492406", "0.6249172", "0.6249053", "0.62428975", "0.62377685", "0.6229161", "0.62247276", "0.62240463", "0.6220435", "0.62123305", "0.6209421" ]
0.0
-1
Removes all items from the cart
public function clear() { $this->items = []; $this->saveItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearCart(){\r\n\t\t$this->cart_items = array();\r\n\t\t$this->latestItemId = 1;\t\t\r\n\t}", "protected function removeAll()\n {\n if (isset($this->currentSession->cart)) {\n unset($this->currentSession->cart);\n }\n }", "public function clear() {\n\t\t$this->load->library('cart');\n\t\tforeach($this->cart->contents() as $item) {\n\t\t\t\t$item['qty'] = 0;\n\t\t\t\t$this->cart->update($item);\n\t\t}\n\t\t$this->json->output(array(\"status\"=>\"success\", \"msg\"=>\"Your cart has been cleared.\"));\n\t}", "public function clearCart(): void\n {\n CartFcd::clear();\n $this->updateCart();\n }", "public function clearCart()\n {\n $this->clearParams('cart');\n }", "public function emptyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.empty', $this->instance);\n }", "public function clearItems();", "public function reset()\n {\n $this->cartItems = [];\n }", "protected function clear_cart()\n {\n $GLOBALS['cart']->reset(true);\n\n tep_session_unregister('sendto');\n tep_session_unregister('billto');\n tep_session_unregister('shipping');\n tep_session_unregister('payment');\n tep_session_unregister('comments');\n }", "public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }", "public function clearShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }", "public function clearItems()\n\t{\n\t\t$this->storage->clear();\n\t}", "public function removeAll()\n {\n foreach ($this->items as $item) {\n $this->items->remove($item);\n }\n }", "public function clearCart()\n {\n $this->model->destroy();\n }", "public function clear_cart()\n {\n unset($_SESSION['cart']);\n }", "public function empty_cart()\n\t{\n\t\t$option = JRequest::getVar('option');\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 empty_cart method of model to remove all products from cart\n\t\t$model->empty_cart();\n\t\t$user = JFactory::getUser();\n\n\t\tif ($user->id)\n\t\t{\n\t\t\t$this->_carthelper->removecartfromdb(0, $user->id, true);\n\t\t}\n\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}", "function empty_cart() {\n\t\t\t$this->cart_contents = array();\n\t\t\t$this->reset_totals();\n\t\t\tunset($_SESSION['cart']);\n\t\t\tunset($_SESSION['coupons']);\n\t\t}", "public function unset_sess_cart_items()\n {\n if (!empty($this->session->userdata('mds_shopping_cart'))) {\n $this->session->unset_userdata('mds_shopping_cart');\n }\n }", "public function empty_cart()\n\t{\n\t\tunset($_SESSION['cart']);\n\t}", "public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }", "public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function empty_cart(){\n\t\t\t\n\t\t\tif(isset($_SESSION['cart'])){\n \t\t\tunset($_SESSION['cart']);\n \t\t}\n\n \t\t$this->update_cart();\n\n\t\t}", "public function clearCart(){\n Mage::getSingleton ( 'checkout/cart' )->truncate ()->save ();\n Mage::getSingleton ( 'checkout/session' )->clear ();\n }", "public function clearCart(): Cart;", "public static function remove_specials_from_cart(){\n\n foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ){\n if ( self::is_item_special( $cart_item['product_id'] ) ){\n WC()->cart->set_quantity( $cart_item_key, 0 );\n $product_title = $cart_item['data']->get_title();\n\n wc_add_notice( sprintf( __( '&quot;%s&quot; has been removed from your cart. It cannot be purchased in conjunction with other products.', 'wc-only-item-in-cart' ), $product_title ), 'error' );\n }\n\n }\n\n }", "function clear_cart()\n\t\t{\n\t\t\t// The 'empty_cart()' function allows an argument to be submitted that will also reset all shipping data if 'TRUE'.\n\t\t\t$this->flexi_cart->empty_cart(TRUE);\n\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\n\t\t}", "public function destroy()\n {\n $this->CI->session->unset_userdata('cartItems');\n }", "public function clear()\n {\n $this->items = array();\n }", "public function destroy(): void\n {\n $this->items = collect();\n $this->coupons = collect();\n $this->giftcards = collect();\n\n $this->session?->remove('shop.cart');\n }", "function remove_cart_item($keyId) { \n //print_r($keyId); die;\n if(isset($keyId) && !empty($keyId)) { //\n $cart = $_SESSION['cart'];\n $rem_qty = $cart['item'][$keyId]['qty'];\n foreach($cart['item'] as $key => $val) { \n if ($key== $keyId) {\n if($cart['item'][$key]['qty'] > 1) {\n $cart['total'] = $cart['total'] - ($cart['item'][$key]['qty'] * $val['price']);\n $cart['itotal'] = $cart['itotal'] - ($cart['item'][$key]['qty'] * $val['price']);\n } else {\n $cart['total'] = $cart['total'] - $val['price'];\n $cart['itotal'] = $cart['itotal'] - $val['price'];\n }\n \n $cart['item'][$key]['qty'] = 0;\n //print_r($cart['itotal']); die;\n \n //$this->apply_coupon($cart['itotal']);\n \n $cart['tcount'] = $cart['tcount'] - 1;\n $cart['item'][$key]['price'] = 0;\n \n }\n\n } \n $this->session->set('cart', $cart);\n //echo \"<pre>\"; print_r($_SESSION['cart']); \"</pre>\"; die;\n for($i =1; $i<=$rem_qty; $i++ ) {\n $rem_val = array_pop($_SESSION['cart']['seats_selected']);\n \n }\n if(!empty($_SESSION['ccode'])) {\n $this->remove_coupon();\n }\n \n if($_SESSION['cart']['tcount'] <= 0) {\n $_SESSION['cart']['total'] = 0;\n $_SESSION['cart']['salestax'] = 0;\n $_SESSION['cart']['processingfees'] = 0;\n }\n return redirect()->to('/cart');\n } else {\n echo \"Item Not Removed\";\n }\n }", "public function clear()\n\t{\n\t\t$this->items = [];\n\t}", "public function reset(): void\n {\n \\Cart::clear();\n }", "function clearCart() {\r\n\tunset($_SESSION['cart']);\r\n}", "public function clear()\n {\n Cart::destroy();\n return redirect()->route('cart.index');\n }", "public function empty_cart() {\n\t\t$cart = WC()->session->get( 'cart' );\n\t\tupdate_user_meta( $this->userId, '_ebanx_persistent_cart', $cart );\n\n\t\tWC()->cart->empty_cart( true );\n\t}", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function clear($synchronize = false) {\r\n $this->items = array();\r\n if ($synchronize && $this->user->profile['userid'] !== -1) {\r\n return $this->user->context->dbDriver->remove(RestoDatabaseDriver::CART_ITEMS, array('email' => $this->user->profile['email']));\r\n }\r\n }", "public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "public function Clear()\n {\n $this->items = array();\n }", "public function clear()\n {\n $cart = Cart::name('shopping');\n $cart->clearItems();\n\n return redirect()->route('cart.index')->withSuccess('Xóa giỏ hàng thành công');\n }", "function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}", "public function clear() {\n try{\n unset($this->Items);\n $this->Items = array();\n }catch(Exception $e){\n throw $e;\n }\n }", "public function removeFromCart() : void\n {\n $this->VIEW = false;\n $this->Cart->removeFromCart($_SESSION['Auth']->id, $_POST);\n }", "public function remove($items = array())\n {\n if (($this->_checkCartRemove($items) === TRUE) && isset($this->_session['products'][$items['token']]) )\n {\n $cart = $this->_session['products'][$items['token']];\n unset($this->_session['products'][$items['token']]);\n $this->trigger(CartEvent::EVENT_REMOVE_ITEM_POST, $items['token'], $cart, $this);\n }\n }", "public function actionClear() {\n $session = $this->session;\n $session->remove('cart');\n $session->remove('cart.qty');\n $session->remove('cart.sum');\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "public function emptyCart(){\n if(Session::exists(\"cart\")){\n //Remove all cart entries\n Session::forget(\"cart\");\n }\n return redirect(\"/cart\");\n }", "function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }", "public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }", "public function clear(): void\n {\n $this->items = collect();\n\n $this->save();\n }", "public function deleteCart(){\n $cartItemModel = \\Ccc::objectManager('\\Model\\Item',false);\n\n foreach($this->getCartItems() as $item){\n $ids[] = $item->itemId;\n }\n \n if($cartItemModel->deleteData($ids)){\n return true;\n }\n\n return false;\n }", "function clear()\r\n {\r\n $this->items=array();\r\n }", "public function removeAll()\n {\n echo $this->_em->createQueryBuilder()->delete('Tdms\\Entity\\Product', 'p')->getQuery()->execute();\n }", "public function clear() \n\t{\n\t\t$this->cart = array();\n\t\tSession::set('cart', array());\n\t\treturn true;\n\t}", "public function removeItems($products)\n {\n }", "public function remove($id)\n {\n\t\t$item = $this->getItem($id);\n \t$cart = $this->session->get(self::SHOPPINGCART);\n $this->session->forget(self::SHOPPINGCART);\n for($i=0;$i<sizeof($cart);$i++)\n {\n if($cart[$i] == $item)\n {\n continue;\n }\n $this->session->push(self::SHOPPINGCART,$cart[$i]);\n }\n \n \tfor($i=0;$i<sizeof($this->items);$i++)\n {\n if($this->items[$i] == $item)\n {\n unset($this->items[$i]);\n }\n }\n }", "public function clearItems()\n {\n $this->collItems = null; // important to set this to NULL since that means it is uninitialized\n }", "function Clear()\r\n {\r\n $this->_items = array();\r\n }", "function deleteCartItem()\n {\n $item_id = $_POST['movie_id'];\n\n // User is not logged in\n if (!LoggedIn::user()) {\n\n $storeItem = 1;\n $movieItem = 0;\n $sessionType = \"\";\n\n $category_id = $_POST['category_id'];\n\n // if cart or store\n\n if ($category_id == $movieItem) {\n\n $sessionType = 'cart';\n\n } else if ($category_id == $storeItem) {\n\n $sessionType = 'store_items';\n }\n\n\n // CART\n foreach ($_SESSION[$sessionType] as $key => $value) {\n foreach ($value as $movie => $id) {\n if ($id == $item_id) {\n // Is match then remove element at position $key eg 0, 1, 2 ,3 in the array\n unset($_SESSION[$sessionType][$key]);\n }\n }\n }\n\n\n // STORE\n\n\n } else {\n\n // IF USER IS LOGGED IN USE THIS (TODO::LATER)\n Cart_item::where('movie_id', '=', $item_id)->delete();\n }\n }", "public function emptyCart(){\n\n CartItem::removeCart();\n return redirect('/product_carts')->withSuccessEmptyCartMessage('');\n }", "public function clear()\n {\n BasketProductPeer::deleteAllProductsByBasketId($this->getId());\n }", "public function clear()\n {\n Session::clear('Checkout.ShoppingCart.Items');\n Session::clear('Checkout.ShoppingCart.Discount');\n Session::clear(\"Checkout.PostageID\");\n }", "function remove_all_discounts()\n\t\t{\n\t\t\t// The 'unset_discount()' function can accept an array of either discount ids or codes to delete more than one discount at a time.\n\t\t\t// Alternatively, if no data is submitted, the function will delete all discounts that are applied to the cart.\n\t\t\t// This example removes all discount data.\n\t\t\t// $this->flexi_cart->unset_userdata_discount(); // Can't remeber why this 'stock code' didn't work - said 'undefined method' or something\t\t\n\t\t\t$this->flexi_cart->unset_discount();\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\n\t\t}", "public function flushItems()\n\t{\n\t\t$this->items = array();\n\t}", "public function destroy()\n {\n $this->items = array();\n }", "public function destroy()\n\t{\n\t\t// Remove all the data from the cart and set some base values\n\t\t//\n\t\tarray_set($this->cart_contents, $this->cart_name, array('cart_total' => 0, 'total_items' => 0));\n\n\t\t// Remove the session.\n\t\t//\n\t\tSession::forget($this->cart_name);\n\t}", "public function removeAll() {\n\t\t\tif( !$items = $this->getStats( 'items' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$memcache = $this->getMemcache();\n\t\t\tforeach ($items['items'] as $key => $item) {\n\t\t\t\t$dump = $memcache->getStats( 'cachedump', $key, $item['number'] * 2 );\n\t\t\t\tforeach( array_keys( $dump ) as $ckey ) {\n\t\t\t\t\t$memcache->delete( $ckey );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->stats = null;\n\t\t}", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "public function emptyCart()\n {\n ShoppingCart::where('username', Auth::user()->username)->delete();\n return redirect('cart')->withSuccessMessage('Giỏ hàng của bạn đã được xóa!');\n }", "public function actionDeleteAll() {\n SupItemsSync::model()->deleteAll();\n\n $this->redirect(array('index'));\n }", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "public function clear_cart_data($user_id,$cart_id)\n\t{\n\t\t$this->db->where(\"id\",$cart_id);\n\t\t$this->db->where(\"member_id\",$user_id);\n\t\t$this->db->delete(\"tbl_events_cart\");\n\t\t//echo $this->db->last_query();exit;\n\t}", "function killCart(){\n\t\t$this->Cart = $this->Referred = $this->Shipping = $this->Customer = array(); // Set the session to an empty array\n\t\t$this->setCart();\n\t\tunset($_SESSION[ $this->SesName[\"Cart\"] ]); // Unset the session array\n\t}", "public function clear()\n {\n return $this->deleteMultiple(array_keys($this->items));\n }", "protected function deleteUnusedItems(){\n $items=Item::where('serial_number','')->get();\n foreach($items as $item){\n $item->delete();\n }\n }", "function clear_cartvars(){\n\t// clear an associative array of cart items\n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\tunset($_SESSION[$cart]);\n\tif (count($_SESSION['custCart_ID']) > 1 ) {\n\t return 1; // failed not reset for some reason\n\t} else {\n\t return 0; // success reset\n\t}\n}", "public function emptycart()\n {\n $this->extend(\"onBeforeEmpty\");\n $this->removeAll();\n $this->save();\n \n $this->setSessionMessage(\n \"bad\",\n _t(\"Checkout.EmptiedCart\", \"Shopping cart emptied\")\n );\n\n return $this->redirectBack();\n }", "public static function remove_all_stores()\n {\n }", "protected function clearQuoteItemsCache()\n {\n foreach ($this->_quote->getAllAddresses() as $address) {\n\n /** @var $address Mage_Sales_Model_Quote_Address */\n\n $address->unsetData('cached_items_all');\n $address->unsetData('cached_items_nominal');\n $address->unsetData('cached_items_nonnominal');\n }\n }", "public function clearCart()\n {\n $_SESSION['cart'] = [];\n\n return $this;\n }", "public function testRemoveItem()\n {\n $cart = new Cart(['foo']);\n $cart->removeItem('foo');\n $this->assertEquals([], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 3]);\n $cart->removeItem(3);\n $this->assertEquals(['bar', 'foo', 'horse'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 'bar', 'horse', 3]);\n $cart->removeItem('foo');\n $this->assertEquals(['bar', 'bar', 'horse', 'horse', 3], $cart->getItems());\n }", "public function emptyItems()\r\n\t{\r\n\t\t$this->_items = array();\r\n\t}", "public function removeFromShoppingCart($id){\r\n $stmt = $this->DB->prepare(\"DELETE FROM shopping_cart WHERE Cart_ID = $id;\");\r\n $stmt->execute();\r\n }", "public function clearAll() {}", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function destroy()\n {\n $this->_session->offsetUnset('products');\n $this->getEventManager()->trigger(CartEvent::EVENT_DELETE_CART_POST, $this, ['cart_id'=>$this->_session->cartId]);\n }", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function clear(Request $request)\n {\n\n $oreder = new Order;\n $oreder->address_id = strip_tags($request->addressID);\n $oreder->restorant_id = strip_tags($request->restID);\n $oreder->client_id = auth()->user()->id;\n $oreder->driver_id = 2;\n $oreder->delivery_price = 3.00;\n $oreder->order_price = strip_tags($request->orderPrice);\n $oreder->comment = strip_tags($request->comment);\n $oreder->save();\n\n foreach (Cart::getContent() as $key => $item) {\n $oreder->items()->attach($item->id);\n }\n\n //Find first status id,\n ///$oreder->stauts()->attach($status->id,['user_id'=>auth()->user()->id]);\n Cart::clear();\n\n return redirect()->route('front')->withStatus(__('Cart clear.'));\n //return back()->with('success',\"The shopping cart has successfully beed added to the shopping cart!\");;\n }", "public function remove($rowid) {\n\t\t \n\t\tif ($rowid===\"all\"){\n\t\t\t$this->cart->destroy(); //invokes destroy() method of Cart class.\n\t\t}\n\t\telse{\n\t\t\t$data = array(\n\t\t\t\t'rowid' => $rowid,\n\t\t\t\t'qty' => 0\n\t\t\t);\n\t\t\t$this->cart->update($data); //invokes update() method of Cart class.\n\t\t}\n\t\tredirect('cart'); //redirect to the same controller but in index method\n\t}", "public function remove(...$items);", "public function removeAll () {\n\t\t$this->exchangeArray(array());\n\t}", "function empty_cart() {\n if(isset($_SESSION['cart'])) {\n\t\t\t## unset and recreate cart\n unset($_SESSION['cart']);\n\t\t\t$_SESSION['cart'] = array(); \n return TRUE;\n } else {\n return FALSE;\n\t\t }\n }", "function deleteCart() {\n\t\t$queryString = \"DELETE FROM cart;\";\n\n\t\tif ($stmt = $this->connection->prepare($queryString)) {\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\theader(\"Location: http://serenity.ist.rit.edu/~qsb2538/341/project1/cart.php\");\n\t\t}\n\t}", "public function clearAll();", "public function clearAll();", "function remove($id) \n\t{\n\t\tif ($id==\"all\" || $this->uri->segment(3) == 'all') {\n\t\t\t$this->cart->destroy();\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'rowid' => $id,\n\t\t\t\t'qty' => 0\n\t\t\t);\n\n\t\t\t$this->cart->update($data);\n\t\t}\n\n\t\t$cart = $this->cart->contents();\n\n\t\tif($this->uri->segment(2) == 'remove-ajax' ) {\n\t\t\t$grand_total = 0;\n\n foreach ($cart as $item) {\n \t$grand_total += $item['subtotal'];\n }\n\n $total = $this->cart->total_items();\n \n\t\t\techo json_encode(array(\n\t\t\t\t'result' => 'Xóa giỏ hàng thành công', \n\t\t\t\t'grand_total' => $grand_total,\n\t\t\t\t'total' => $total\n\t\t\t)); exit();\n\t\t}\n\n\t\tredirect();\n\t}", "public function clearCartConditions()\n {\n $this->session->put(\n $this->sessionKeyCartConditions,\n array()\n );\n }", "function removeItem($itemKey){\n\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t//remove the item from the cart including all of its quantity\n\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t//code for if the items should be removed 1 item at a time \n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] - 1;\n\t\t\t\tif($this->items[$itemKey]['quantity'] == 0){\t\n\t\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\n\t\t\treturn;\n\t\t}" ]
[ "0.8119539", "0.7881413", "0.777156", "0.7532916", "0.7453845", "0.74533695", "0.7423607", "0.7322221", "0.73215467", "0.73086977", "0.7289867", "0.7278434", "0.72028416", "0.71741563", "0.7153963", "0.7080745", "0.70703006", "0.69851065", "0.69818103", "0.69359267", "0.69134575", "0.68991774", "0.6885751", "0.6794073", "0.6784066", "0.67706895", "0.6757197", "0.6711998", "0.6708646", "0.6699692", "0.6697285", "0.66915154", "0.66677207", "0.66443133", "0.662814", "0.6625471", "0.66213614", "0.66137296", "0.6612498", "0.66067713", "0.6594436", "0.65841454", "0.6581761", "0.65776604", "0.65697527", "0.6569036", "0.6542346", "0.6493478", "0.6473141", "0.6470308", "0.64513195", "0.6450638", "0.64222497", "0.64145267", "0.63987", "0.63925415", "0.6388307", "0.63853294", "0.6384894", "0.6383888", "0.63740957", "0.6368208", "0.63623035", "0.63562214", "0.63495475", "0.63380706", "0.63378936", "0.63254166", "0.62908816", "0.6274896", "0.6272707", "0.6245859", "0.6239", "0.6234144", "0.62177", "0.62151176", "0.6182729", "0.6182604", "0.6180745", "0.61792123", "0.61683315", "0.616134", "0.61353457", "0.61194456", "0.61062497", "0.61046016", "0.61040896", "0.60977256", "0.6093864", "0.60830444", "0.6082413", "0.6081818", "0.60723186", "0.6056124", "0.60531056", "0.60234255", "0.60234255", "0.6013921", "0.601118", "0.60035515" ]
0.6706774
29
Returns all items from the cart
public function getItems() { $this->loadItems(); return $this->items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartItems($cart_id);", "public function get_cart_items()\n\t{\n\t\t$this->initiate_cart();\n\t\treturn $this->ci->session->cart_items;\n\t}", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "public function getCartItemCollection()\n {\n return $this->items;\n }", "public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }", "public function _getItems(Cart $cart)\n {\n $items = $cart->getQuote()->getAllVisibleItems();\n try {\n $data = [];\n $configurableSkus = [];\n foreach ($items as $item) {\n $product = $item->getProduct();\n $_item = [];\n $_item['vars'] = [];\n if ($item->getProduct()->getTypeId() == 'configurable') {\n $_item['isConfiguration'] = 1;\n $parentIds[] = $item->getParentItemId();\n $options = $this->cpModel->getOrderOptions($product);\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(), $configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n if ($_item['id']) {\n $_item['qty'] = (int)$item->getQty();\n $_item['url'] = $item->getProduct()->getProductUrl();\n $_item['image'] = $this->productHelper->getSmallImageUrl($product);\n $current_price = null;\n $reg_price = $product->getPrice();\n $special_price = $product->getSpecialPrice();\n $special_from = $product->getSpecialFromDate();\n $special_to = $product->getSpecialToDate();\n if ($special_price &&\n ($special_from === null || (strtotime($special_from) < strtotime('Today'))) &&\n ($special_to === null || (strtotime($special_to) > strtotime('Today')))) {\n $current_price = $special_price;\n } else {\n $current_price = $reg_price;\n }\n $_item['price'] = $current_price * 100;\n if ($tags = $this->_getTags($product)) {\n $_item['tags'] = $tags;\n }\n $data[] = $_item;\n }\n }\n\n return $data;\n } catch (\\Exception $e) {\n $this->clientManager->getClient()->logger($e);\n\n return false;\n }\n }", "public function cart()\n {\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n $items = array();\n foreach ($this->_session->offsetGet('products') as $key => $value)\n {\n $items[$key] = array(\n 'id' \t\t=> \t$value['id'],\n 'qty' \t\t=> \t$value['qty'],\n 'price' \t=> \t$value['price'],\n 'name' \t\t=> \t$value['name'],\n 'sub_total'\t=> \t$this->_formatNumber($value['price'] * $value['qty']),\n \t'options' \t=> \t$value['options'],\n 'date' \t\t=> \t$value['date'],\n 'vat' => $value['vat']\n );\n }\n return $items;\n }\n }", "public function getItems(): array\n {\n return $_SESSION['cart'] ?? [];\n }", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "public function getAllShoppingItems()\n {\n $query = $this->db->prepare('SELECT `id`, `name`, `bought`, `deleted` FROM `shopping_items`;');\n $query->execute();\n $results = $query->fetchAll();\n return $results;\n }", "public function getSessionItems() { global $smarty; \n if(isset($_SESSION['checkout']['items'])) { \n $smarty->assign(\"cart\", $_SESSION['checkout']['items']);\n }\n }", "public function getCart();", "public function getFullCart()\n {\n $completeCart = [];\n\n if ($this->get())\n {\n foreach ($this->get() as $id => $quantity)\n {\n $product = $this->em->getRepository(Product::class)->findOneById($id);\n\n if (!$product)\n {\n $this->delete($id);\n continue;\n }\n\n $completeCart[] = [\n 'product' => $product,\n 'quantity' => $quantity,\n ];\n }\n }\n\n return $completeCart;\n }", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "protected function get_items_from_cart() {\n\t\t$this->items = array();\n\n\t\tforeach ( $this->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t$item = $this->get_default_item_props();\n\t\t\t$item->key = $cart_item_key;\n\t\t\t$item->object = $cart_item;\n\t\t\t$item->tax_class = $cart_item['data']->get_tax_class();\n\t\t\t$item->taxable = 'taxable' === $cart_item['data']->get_tax_status();\n\t\t\t$item->price_includes_tax = wc_prices_include_tax();\n\t\t\t$item->quantity = $cart_item['quantity'];\n\t\t\t$item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] );\n\t\t\t$item->product = $cart_item['data'];\n\t\t\t$item->tax_rates = $this->get_item_tax_rates( $item );\n\t\t\t$this->items[ $cart_item_key ] = $item;\n\t\t}\n\t}", "public function all(){\r\n return $this->items;\r\n }", "function getCart() {\n\t\t$cartData = array();\n\t\t\tif($stmt = $this->connection->prepare(\"select * FROM cart;\")) {\n\t\t\t\t$stmt -> execute();\n\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($id, $itemName, $itemDesc, $numberOf, $price);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$cartData[] = array(\n\t\t\t\t\t\t\t'id' =>$id,\n\t\t\t\t\t\t\t'productName' => $itemName,\n\t\t\t\t\t\t\t'productDescription' => $itemDesc,\n\t\t\t\t\t\t\t'numberOf' => $numberOf,\n\t\t\t\t\t\t\t'price' => $price\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn $cartData;\n\t}", "public function getCartData()\n {\n $data = array();\n $session= Mage::getSingleton('checkout/session');\n $items = $session->getQuote()->getAllVisibleItems();\n if($items) {\n foreach ($items as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n }", "public static function getItems()\n {\n $items = Catalog::item()\n ->select('catalog_items.*, catalog_categories.name AS category')\n ->leftJoin('catalog_categories', 'catalog_categories.id', '=', 'catalog_items.category_id')\n ->orderBy('catalog_categories.weight')\n ->orderBy('catalog_categories.name')\n ->orderBy('catalog_items.name')\n ->all();\n\n if($items)\n $items = self::getItemData($items);\n\n return $items;\n }", "public function index()\n {\n return $cart=cart::all();\n }", "public function cartItems() {\n return $this->hasMany(CartItem::class);\n }", "public function getAll()\n {\n \tif(!$this->isEmpty()){\n \t\treturn $this->items;\n \t}\n }", "public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}", "function items( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the list of items or not? If $zcarriage='NO' exclude the zcarriage from the return result\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND ci.sku<>'zcarriage'\" : '';\n\n\t\t$qry = \"SELECT ci.*, product, product_image, model_type FROM cart ct INNER JOIN cart_items ci ON ct.id=ci.cart_id LEFT OUTER JOIN catalog c ON c.sku=ci.sku WHERE ct.id='\".$cart_id.\"' AND user='\".$user_no.\"' \".$zcarriage.\" AND ci.qty>0 GROUP BY ci.sku\";\n\t\treturn $this->db->query( $qry )->result_array();\n\t}", "public function get_items(){\n\t \t//Si no esta vacio empieza a imprimirlos\n\t \tif(!empty($this->cart)){\n\t \t\t\n\t\t \tforeach ($this->cart as $linea) {\n\t\t \t\t\n\t\t \t\t?>\n\t\t\t <tr class=\"filaTicket\">\n\t\t\t\t <td height=\"20\"><?=$linea['code']?></td>\n\t\t\t\t <td><?=$linea['product']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['price'], 2, ',','.')?></td>\n\t\t\t\t <td align=\"right\"><?=$linea['iva']?></td>\n\t\t\t\t <td align=\"right\"><?= $linea['amount']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['subtotal'], 2, ',','.') ?></td>\n\n\t\t\t\t \n\t\t\t\t <td>\n\t\t\t\t <button onClick=\"borrarProducto(<?=$linea['code']?>);\">Borrar</button>\n\n\t\t\t\t </td>\n\n\t\t\t </tr>\n\t\t \t\t\t<?php\n\n\t \t}\n\n\t \t}\n\t \t\n\t }", "public function getActiveCartProducts();", "public function cartOrders()\n {\n $cart = $this->sessionGet('cart');\n //$cart = Az::$app->cores->session->get('cart');\n\n //vdd($cart);\n $productItems = [];\n\n if ($cart) {\n foreach ($cart as $item) {\n $productItem = $this->productItemByCatalogId($item['catalog_id']);\n if ($productItem === null)\n continue;\n $productItem->cart_amount = $item['amount'];\n $productItems[] = $productItem;\n }\n }\n return $productItems;\n }", "protected function all()\n\t{\n\t\treturn $this->items;\n\t}", "public function all()\n {\n return $this->getCartSession();\n }", "public function get() {\n $result = array();\n $this->initShoppingCartGetReslut($result);\n $result['is_virtual'] = $this->cart->isVirtualCart();\n $result['cart_items'] = $this->getProducts();\n $result['price_infos'] = $this->getPriceInfo();\n $result['cart_items_count'] = $this->cart->nbProducts();\n $result['payment_methods'] = $this->getPaymentMethods();\n\n return $result;\n }", "public function index()\n\t{\n\t\t$items = \\Cart::getContent();\n\t\t$this->data['items'] = $items;\n\n\t\treturn $this->load_theme('carts.index', $this->data);\n\t}", "public function contents()\n\t{\n\t\t// Get the cart contents.\n\t\t//\n\t\t$cart = array_get($this->cart_contents, $this->cart_name);\n\n\t\t// Remove these so they don't create a problem when showing the cart table.\n\t\t//\n\t\tarray_forget($cart, 'total_items');\n\t\tarray_forget($cart, 'cart_total');\n\n\t\t// Return the cart contents.\n\t\t//\n\t\treturn $cart;\n\t}", "function getCartContent()\n{\n\t$cartContent = array();\n\n\t$sql = \"SELECT ct.ItemID, ct.Quantity, Name, Price, ImageURL, i.Weight\n\t\t\tFROM Cart ct, Items i\n\t\t\tWHERE ct.ItemID = i.ItemID\";\n\t\n\t$result = query($sql);\n\t\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t\tif (!$row['ImageURL']) {\n\t\t\t$row['ImageURL'] = '../images/No-Image-Thumbnail.png';\n\t\t}\n\t\t$cartContent[] = $row;\n\t}\n\t\n\treturn $cartContent;\n}", "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "function Cart() {\n\t\t$order = self::get_current_order();\n\t\t$order->Items();\n\t\t$order->Total;\n\n\t\t//HTTP::set_cache_age(0);\n\t\treturn $order;\n\t}", "public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }", "public function getItems()\n {\n }", "public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}", "public function index()\n {\n return Cart::with('product')\n ->orderBy('created_at', 'desc')\n ->get();\n }", "public function getProductsFromShopingCart(){\n global $book;\n\n if( isset( $_SESSION['shopingCart'] )){\n\n $testArray = [];\n \n foreach( $_SESSION['shopingCart'] as $key => $quantity ){\n \n \n $keyArray = explode(\"_\", $key);\n \n $bookId = $keyArray[1]; \n \n \n \n $getBook = $book->getBookById( $bookId );\n $getBook->quantity = $quantity;\n \n array_push( $testArray,$getBook ); \n }\n \n $_SESSION['shopingCartProducts'] = $testArray;\n\n return $_SESSION['shopingCartProducts'];\n }\n }", "public function contents(){\n // Reorganizo el carrito poniendo lo más nuevo primero\n $cart = array_reverse($this->cart_contents);\n\n // Elimino para que no creen un problema al mostrar la tabla del carrito\n unset($cart['total_items']);\n unset($cart['cart_total']);\n\n return $cart;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function getAllproducts() {\r\n\r\n\t\t$res = $this->db->get('items');\r\n\r\n\t\treturn $res->result();\r\n\t}", "function get_cart() {\n\t\t\treturn $this->cart_contents;\n\t\t}", "public function all() {\n\t\treturn $this->items;\n\t}", "public function all()\n\t{\n\t\treturn $this->items;\n\t}", "public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}", "function getItems(){\r\n\t\t\treturn $this->items;\r\n\t\t}", "function getItems();", "function getItems();", "public function get_cart_products()\n {\n $user_id = $_SESSION['user_id'];\n\n $query = \"SELECT p.*\n \t FROM \" . $this->db_table_prefix . \"cart c\n JOIN \" . $this->db_table_prefix . \"products p\n ON p.id = c.product_id WHERE c.user_id ='\".$user_id.\"'\";\n // echo $query; exit; \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "public function getItems(): array\n\t{\n\t\treturn $this->storage->all();\n\t}", "function fetchProductsFromCart () {\r\n if (checkCart()) {\r\n $sql = \"SELECT * FROM stockitems WHERE StockItemID IN (\" . arrayToSQLString(array_keys($_SESSION['cart'])) . \")\";\r\n return runQuery($sql);\r\n }\r\n}", "public function getAll()\n {\n return $this->products;\n }", "public function items()\n {\n return $this->{$this->_driver}->items();\n }", "public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }", "function contents()\n\t{\n\t\t$cart = $this->_tour_cart_contents;\n\t\t\n\t\t// Remove these so they don't create a problem when showing the cart table\n\t\tunset($cart['tour_cart_total']);\n\t\tunset($cart['total_itineraries']);\n\t\tunset($cart['delete_itineraries']);\n\t\tunset($cart['estimate']);\n\n\t\treturn $cart;\n\t}", "public function getBasketItems()\n {\n return $this->basketItems;\n }", "public function index()\n {\n $data = Cart::get();\n\n return $this->sendResponse(CartResource::collection($data), 'Data has been retrieved.');\n }", "public function itemsQuery()\n {\n return $this->items(null);\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n if ($this->getCustomQuote()) {\n return $this->getCustomQuote()->getAllVisibleItems();\n }\n\n return parent::getItems();\n }", "public function getAll(){\n\t\t\t//return $this->db->get('item'); \n\t\t}", "public function allItemsApi() {\n return Products::with('queue')->get()->toJson();\n }", "public function getItems()\n\t{\n\t\t$items = parent::getItems();\n\t\t\n\n\t\treturn $items;\n\t}", "public function getItemsArray() {\r\n $stmt = $this->DB->prepare ( \"SELECT * FROM products\");\r\n $stmt->execute ();\r\n return $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n }", "public function items()\n {\n return $this->items;\n }", "public function getItems()\n {\n $items = Item::all();\n return response($items, 200);\n }", "public function getCatalogItems()\n {\n return $this->catalog_items;\n }", "public function get_cart_contents() {\n\t\treturn (array) $this->cart_contents;\n\t}", "public function indexAction() {\n $service = $this->getItemService();\n\n $items = $service->findAll();\n \n return array(\n 'items' => $items,\n );\n }", "public function getCurrentFullCart(){\n\n $product_ids = array();\n $cart = Mage::getModel('checkout/cart')->getQuote();\n foreach ($cart->getAllItems() as $item) {\n\n array_push($product_ids, $item->getProduct()->getId());\n }\n return $product_ids;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }", "public function getItems()\n {\n return $this->items;\n }" ]
[ "0.7715779", "0.7671784", "0.7650585", "0.7584836", "0.7548737", "0.7513873", "0.7349169", "0.72980654", "0.7291972", "0.7269382", "0.7263285", "0.722936", "0.71350646", "0.7121039", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6979915", "0.6964471", "0.69584274", "0.6934738", "0.6931447", "0.6920911", "0.68876743", "0.6885833", "0.6883629", "0.6873227", "0.68663913", "0.68644196", "0.68422586", "0.68391794", "0.67950404", "0.67766875", "0.6775067", "0.6739508", "0.67248946", "0.6717123", "0.66906136", "0.6688357", "0.6647145", "0.664586", "0.66440195", "0.66288114", "0.6612177", "0.6610789", "0.66086006", "0.66086006", "0.66086006", "0.66086006", "0.66086006", "0.66086006", "0.6599248", "0.6595283", "0.6586243", "0.65813", "0.6570642", "0.65649337", "0.6564681", "0.6564681", "0.6531263", "0.6527099", "0.64986765", "0.649799", "0.6496848", "0.6491339", "0.64888555", "0.64883304", "0.6478219", "0.647417", "0.6471487", "0.6468042", "0.64603764", "0.6455334", "0.6448444", "0.6441514", "0.6432387", "0.6431595", "0.6423041", "0.64151144", "0.6414862", "0.64137286", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063", "0.64131063" ]
0.65272903
69
Returns an item from the cart
public function getItem($id) { $this->loadItems(); return isset($this->items[$id]) ? $this->items[$id] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartItem() {\n\n if (!$this->cartItem) {\n $this->cartItem = $this->cartItemRepository->getbyId($this->route('item'));\n }\n return $this->cartItem;\n }", "public function getCart();", "public function findItem(string $sku): ?CartItem;", "public function retrieveItem($id) {\n return $this->itemsDB->retrieve($id);\n }", "public function retrieve() {\n\t\t$conditions = $this->cartConditions();\n\t\ttry {\n\t\t\tif ($this->readIdCache($this->cartId())) {\n\t\t\t\treturn $this->cachedData;\n\t\t\t}\n\t\t\tif (!$this->cartExists()) {\n\t\t\t\t\n\t\t\t\t$userId = $this->Session->read('Auth.User.id');\n\t\t\t\tif (is_null($userId)) {\n\t\t\t\t\t$this->data = array(\n\t\t\t\t\t\t'session_id' => $this->Session->id(), \n\t\t\t\t\t\t'state' => 'Cart'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$this->data = $this->makeUserCartData(array());\n\t\t\t\t\t$this->data['state'] = 'Cart';\n\t\t\t\t}\n\t\t\t\t$this->create($this->data);\n//\t\t\t\tdmDebug::ddd($this->data, 'this data just saved');\n\t\t\t\t$this->save($this->data);\n//\t\t\t\tdmDebug::ddd($this->validationErrors, 'errors');\n\t\t\t}\n//\t\t\tdmDebug::ddd($this->Session->id(), 'session id');\n\t\t\t\n//\t\t\t$cacheName = $this->cacheName($this->cacheData, $Session);\n\t\t\t$cart = $this->find('first', array(\n\t\t\t\t'conditions' => $this->cartConditions(), \n\t\t\t\t'contain' => array(\n\t\t\t\t\t'CartItem' => array(\n\t\t\t\t\t\t'Supplement' => array(\n\t\t\t\t\t\t\t'fields' => array('Supplement.id', 'Supplement.order_item_id', 'Supplement.type', 'Supplement.data')\n\t\t\t\t\t\t)\n\t\t\t\t\t))));\n\t\t\t\n\t\t\tforeach ($cart['CartItem'] as $index => $item) {\n\t\t\t\tif (isset($cart['CartItem'][$index]['Supplement']['data'])) {\n\t\t\t\t\t$cart['CartItem'][$index]['Supplement']['data'] = unserialize($cart['CartItem'][$index]['Supplement']['data']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->writeIdCache($cart['Cart']['id'], $cart);\n\t\t\treturn $cart;\n\t\t} catch (Exception $exc) {\n\t\t\techo $exc->getFile() . ' Line: ' . $exc->getLine();\n\t\t\techo $exc->getMessage();\n\t\t\techo $exc->getTraceAsString();\n\t\t}\n\t}", "function getCart() {\n return $_SESSION['cart'];\n }", "public function getItemFromCart( $map ) {\r\n\t\t \t$params = array('a.session_cookie'=>$map['cart_session'],'a.restid'=>$map['restid'],'a.itemid'=>$map['itemid']);\r\n\t\t \t$this->db->select('a.itemid,a.restid,a.quantity,b.catid,b.name,b.price,(a.quantity * b.price) as total,(a.quantity *b.packaging) as packaging,b.sub_cat', FALSE)\r\n\t\t \t\t\t ->from(TABLES::$ORDER_CART.' AS a')\r\n\t\t \t\t\t ->join(TABLES::$MENU_ITEM_TABLE.' AS b','a.itemid = b.id','inner')\r\n\t\t \t\t\t ->where($params)->order_by('b.name','asc');\r\n\t\t \t$query = $this->db->get();\r\n\t \t$result = $query->result_array();\r\n\t \treturn $result;\r\n\t\t}", "public function getCartItems($cart_id);", "public function getItem()\n {\n return $this->get(self::ITEM);\n }", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function getItem() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $id = $params['id'];\n try {\n $item = new Item;\n $item->getItem($id);\n View::renderJson($item);\n } catch (Exception $e) {\n View::renderJson(['status' => 0, 'message' => $e]);\n }\n }", "public function getItem() {}", "public function getItem() {}", "public function getItem()\n {\n $query = $this->grammar->compileGetItem($this);\n\n $result = $this->connection->getClient()->getItem($query);\n\n return $this->processor->processItem($result);\n }", "public function get($cartId);", "function getItem() ;", "public function getItem();", "public function findItem(string $rowId) : CartItem\n {\n return $this->model->get($rowId);\n }", "public function getById(string $id): ?CartItem\n {\n return $this->items->get($id);\n }", "static function cartItem()\n {\n if(session()->has('user'))\n {\n $user_id = Session::get('user')['id'];\n $cartId = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('id')->first();\n \n return Cartdetail::where('order_id',$cartId)->count();\n }\n else\n {\n return \"\";\n }\n \n }", "public function getActiveCart();", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "private function getCart()\n {\n $session = $this->app->make('session');\n $events = $this->app->make('events');\n\n $cart = new Cart($session, $events);\n\n return $cart;\n }", "function get_cart() {\n\t\t\treturn $this->cart_contents;\n\t\t}", "abstract public function getItem();", "public function show(){\n $cart = session()->get('cart');\n return $cart;\n }", "public function getCart() {\r\n\t\treturn $this->getUser()->getCart();\r\n\t}", "public function get()\n\t{\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\t#get all product ids of items in the cart\n\t\t\t$ids = $this->get_ids();\n\t\t\t\n\t\t\t# use the list of ids to get product information\n\t\t\tglobal $Products;\n\t\t\treturn $Products->get($ids);\n\t\t}\n\t\treturn NULL;\n\t}", "public function getCart($account_id);", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "public function retrieve($item);", "public function getCart()\n {\n return $this->getParam('cart');\n }", "public function getCartAttribute()\n {\n return $this->carts()->latest()->first();\n }", "public function returnCart() {\n return $this->cart_id;\n }", "public function findCartByUserId($id)\n {\n \t$cart = $this->model->whereUserId($id)->first();\n \n \treturn $cart;\n }", "function getItemById($id) {\n \n $connection = getConnection();\n \n // TODO Prevent SQL injection. Prepared statement?\n $data = mysqli_query($connection, \"SELECT * FROM inventory WHERE item_id = $id\");\n\n $result = mysqli_fetch_assoc($data);\n \n mysqli_close($connection);\n\n return $result;\n }", "public function get_item() {\n\t\treturn $this->item;\n\t}", "public function getShoppingCart()\r\n\t{\r\n\t\treturn $this->shoppingCart;\r\n\t}", "public function item($rowid = null)\n\t{\n\t\t// Check if we have a valid rowid.\n\t\t//\n\t\tif (is_null($rowid))\n\t\t{\n\t\t\tthrow new CartInvalidItemRowIdException;\n\t\t}\n\n\t\t// Check if this item exists.\n\t\t//\n\t\tif ( ! $item = array_get($this->cart_contents, $this->cart_name . '.' . $rowid))\n\t\t{\n\t\t\tthrow new CartItemNotFoundException;\n\t\t}\n\n\t\t// Return all the item information.\n\t\t//\n\t\treturn $item;\n\t}", "public function retrieve()\r\n\t\t{\r\n\t\t\t//Validate request method\r\n\t\t\tif($this->getRequestMethod() != \"GET\"){\r\n\t\t\t\t$this->methodNotAllowed();\r\n\t\t\t}\r\n\r\n\t\t\t$arrGetData = array(\"fields\"=>\"c.sCartName,p.sProductName,c.iTotal,c.iTotalDiscount,c.iTotalWithDiscount,c.iTotalTax,c.iTotalWithTax,c.iGrandTotal\");\r\n\t\t\t$arrCartList = $this->getRecord($this->_sCartTable.' c',$arrGetData,'cart-join');\r\n\t\t\t$iStatus \t = (count($arrCartList)>0) ? 'Success' : 'False';\r\n\t\t\t$sMessage\t = (count($arrCartList)>0) ? 'Total '.count($arrCartList).' record(s) found.' : \"Record not found.\";\r\n\t\t\t$arrData \t = (count($arrCartList)>0) ? $arrCartList : \"Record not found.\";\r\n\t\t\t$iTotalRecord = count($arrCartList);\r\n\r\n\t\t\t$arrResponse['status']\t\t= $iStatus;\r\n\t\t\t$arrResponse['message']\t\t= $sMessage;\r\n\t\t\t$arrResponse['total_record']= $iTotalRecord;\r\n\t\t\t$arrResponse['data']\t\t= $arrData;\r\n\t\t\t$this->response($this->json($arrResponse), 200);\r\n\t\t}", "protected function getCurrentCart()\n {\n return $this\n ->getProvider()\n ->getCart()\n ;\n }", "public function get()\n {\n if ($this->cart instanceof CartInterface) {\n return $this->cart;\n }\n\n $this->cart = $this->loadCartFromSession();\n\n return $this->cart;\n }", "public function getItem() {\n return $this->item;\n }", "public function get(Buyable $buyable): ?CartItem\n {\n return $this->items->get($this->getItemId($buyable));\n }", "public function findCartBySessionId($id)\n {\n \t$cart = $this->model->whereSessionId($id)->first();\n \n \treturn $cart;\n }", "public function getCurrentCartIdentifier();", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function getItem()\n {\n return $this->item;\n }", "public function get()\n {\n if (isset($_SESSION['cart'])) {\n //get all product ids of items in cart\n $ids = $this->get_ids();\n\n // use list of ids to get product info from DB\n global $products;\n return $products->get_prod($ids);\n }\n return null;\n }", "protected function _getCart()\n {\n return Mage::getSingleton('checkout/cart');\n }", "function Cart() {\n\t\t$order = self::get_current_order();\n\t\t$order->Items();\n\t\t$order->Total;\n\n\t\t//HTTP::set_cache_age(0);\n\t\treturn $order;\n\t}", "public function getItem() {\n\t\treturn $this->item;\n\t}", "function getItem($id){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount FROM inventory WHERE idItem = :id\");\n \n\t\t$binds= array(\n\t\t\t\":id\"=>$id\n\t\t);\n\t\t\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public static function get()\n {\n return ShoppingCart::create();\n }", "public function getCartable();", "public function grabItemByID($itemID)\n\t{\n\t\treturn $this->caches['ibEco_stocks'][ $itemID ];\n\t}", "public function getItem( $id );", "function pewc_get_cart_item_by_extras( $product_id, $variation_id, $cart_item_data ) {\n\n\t$cart = WC()->cart->cart_contents;\n\tif( $cart ) {\n\n\t\tforeach( $cart as $id=>$cart_item ) {\n\n\t\t\t// Check if our parameters exactly match the cart item\n\t\t\tif( ( isset( $cart_item['product_id'] ) && $cart_item['product_id'] == $product_id ) && ( isset( $cart_item['variation_id'] ) && $cart_item['variation_id'] == $variation_id ) ) {\n\t\t\t\treturn $cart_item;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn false;\n\n}", "public function getItem() {\n return $this->item;\n }", "public function GetItem()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_reference_item1\");\r\n\t}", "public function get_cart_item( $item_key ) {\n\t\treturn isset( $this->cart_contents[ $item_key ] ) ? $this->cart_contents[ $item_key ] : array();\n\t}", "function fetch_cart ($external_cart_id) {\n $db = getDb();\n $cart_id = fetch_cart_id($external_cart_id);\n\n $statement = $db->prepare(\"\n SELECT\n c.quantity,\n p.title,\n p.price,\n p.inventory_count,\n p.product_id\n FROM\n cart_content c\n INNER JOIN\n product p\n ON\n c.product_id = p.product_id\n WHERE\n cart_id = :cart_id\n \");\n $statement->execute([\"cart_id\" => $cart_id]);\n $products = $statement->fetchAll(PDO::FETCH_OBJ);\n\n $total = 0;\n foreach ($products as $product) {\n $total += $product->price * $product->quantity;\n }\n return (object)[\n \"total\" => $total,\n \"products\" => $products,\n \"external_cart_id\" => $external_cart_id,\n ];\n}", "public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "private function getActiveCart(): Cart\n {\n $cartRepository = $this->getCartRepository();\n\n if (!$cartHash = $this->cookie->get('cart_hash')) {\n $cartHash = Uuid::uuid4();\n $this->cookie->set(\n 'cart_hash',\n $cartHash,\n 2592000,\n '/',\n null,\n null,\n true,\n false,\n SymfonyCookie::SAMESITE_NONE\n );\n }\n\n return $cartRepository->findBySessionId($cartHash, $this->getRequest()->getClientIp());\n }", "public function getCartBySessionId($sessionId)\n {\n \t$cart = $this->findCartBySessionId($sessionId); \n \treturn $cart;\n }", "public function show(User $user, $id)\n {\n return Cart::where('user_id', $user->id)\n ->where('product_id', $id)->first();\n }", "function get( $id=\"\" )\n {\n $this->dbInit();\n $ret = false;\n \n if ( $id != \"\" )\n {\n $this->Database->array_query( $cart_array, \"SELECT * FROM eZTrade_OrderItem WHERE ID='$id'\" );\n if ( count( $cart_array ) > 1 )\n {\n die( \"Error: Cart's with the same ID was found in the database. This shouldent happen.\" );\n }\n else if( count( $cart_array ) == 1 )\n {\n $this->ID =& $cart_array[0][ \"ID\" ];\n $this->OrderID =& $cart_array[0][ \"OrderID\" ];\n $this->Count =& $cart_array[0][ \"Count\" ];\n $this->Price =& $cart_array[0][ \"Price\" ];\n $this->ProductID =& $cart_array[0][ \"ProductID\" ];\n\n $this->State_ = \"Coherent\";\n $ret = true;\n }\n }\n else\n {\n $this->State_ = \"Dirty\";\n }\n return $ret;\n }", "public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }", "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "public function cart()\n {\n if(Auth::check()) {\n $user_email = Auth::user()->email;\n $userCart = DB::table('cart')->where('user_email', $user_email)->get();\n } else {\n $session_id = Session::get('session_id');\n $userCart = DB::table('cart')->where('session_id', $session_id)->get();\n }\n \n // Get images for cart items\n foreach($userCart as $key => $product){\n $product = Product::where('id', $product->product_id)->first();\n $userCart[$key]->image = $product->image;\n }\n $meta_title = \"Shopping Cart - E-com Website\";\n $meta_description = \"View Shopping Cart of E-com Website\";\n $meta_keywords = \"Shopping Cart - E-com Website\";\n return view('products.cart', compact('userCart', 'meta_title','meta_description', 'meta_keywords'));\n }", "public function getRemoveItem($id){\n $session = new Session();\n\n $oldCart = $session->has('cart')? $session->get('cart') : null;\n\n $cart = new Cart($oldCart);\n $cart->removeItem($id);\n\n if(count($cart->items) > 0){\n $session->set('cart', $cart);\n } else {\n $session->clear('cart');\n }\n\n $json_data = array(\n 'message' => 'remove item from cart!',\n 'cart' => $cart\n );\n\n return response()->json($json_data);\n }", "function getfaircoin_only_one_item_on_cart($download_id) {\r\n //echo 'CART CONTENTS: ';\r\n //print_r($cart_contents);\r\n //$cart_contents = edd_get_cart_contents();\r\n //if($cart_contents) return false;\r\n //else return $download_id;\r\n edd_empty_cart();\r\n}", "public function getCart()\n {\n return $this->cart instanceof CartBuilder ? $this->cart->build() : $this->cart;\n }", "public function getOneItem($id)\n {\n $item = Item::find($id);\n // dd($item);\n return $item;\n }", "public function getCart($id)\n {\n $url = $id;\n $user = Auth::id();\n// $explode = explode('/', $url);\n if ($url == \"purchase\") {\n $type = 1;\n } else {\n $type = 2;\n }\n $cart = Cart::where('user_id', $user)->where('type', $type)->get();\n return response()->json($cart);\n }", "function details () {\n// Empty\n if (count($_SESSION['cart'])==0) {\n return false;\n }\n\n // Get cart\n $sql = \"SELECT * FROM `products` WHERE `product_id` IN (\";\n $sql .= str_repeat('?,', count($_SESSION['cart']) - 1) . '?';\n $sql .= \")\";\n return $this->fetch($sql, array_keys($_SESSION['cart']), \"product_id\");\n }", "static public function getItemById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"shop.`item` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n // MemCacheManager::Set($sKey, $aItems, 900); //900s = 15 min\n\n return $aItem[0];\n }", "public function f_get_item()\n {\n\n $sql = $this->db->query(\"SELECT * FROM md_dm_item \");\n return $sql->result();\n\n }", "public function getItem ($id);", "public function item($id)\n {\n foreach (static::$basket[$this->id] as $item) {\n if ($item->id == $id) return $item;\n }\n return false;\n }", "public function addItem($id){\n \t$product = Product::findOrFail($id);\n \tCart::add($id, $product->product_name, 1, $product->product_price, 550, ['img'=>$product->image, \"stock\" => $product->stock]);\n \treturn back();\n }", "function &get_cart_product($id, $options) {\r\n if (!isset($_SESSION['cart'])) {\r\n return null;\r\n } else {\r\n foreach ($_SESSION['cart'] as &$product) {\r\n if ($product['id'] == $id && $product['options'] == $options) {\r\n return $product;\r\n }\r\n }\r\n }\r\n return null;\r\n}", "public function MoveToCart($item){\n\n $cart=Cart::instance('saveForLater')->get($item);\n\n Cart::instance('saveForLater')->remove($item);\n\n\n $item=Cart::instance('default')->search(function ($cartItem, $rowId) use($cart){\n return $cartItem->id === $cart->id;\n });\n\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','This item is already added in your cart!');\n }\n Cart::instance('default')->add($cart->id,$cart->name,$cart->qty,$cart->price)\n ->associate('App\\Models\\Product');\n\n return back()->with('success_message','Item has been Moved to your Cart!');\n }", "public function getCurrentItem($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$sql = \"SELECT qty FROM tb_prolocation WHERE pro_id =\" .$post['item_id'] .\" AND LocationId = \".$post['location_id'].\" LIMIT 1\";\r\n\t\t$row=$db->fetchRow($sql);\r\n\t\treturn($row);\r\n\t}", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public function myCart(){\n Auth::loginUsingId(1);\n // $currentUser = Auth::user();\n // $cartList = $currentUser->cartProductId();\n $currUserId = Auth::user()->id;\n $cartList = Cart::cartList($currUserId)->get();\n return view ('myCart',compact('cartList'));\n // return view('myCart',compact('cartList'));\n }", "function getItemById($itemID) {\n global $dbh;\n $stmt = $dbh->prepare(\"SELECT * FROM ITEM WHERE itemID = ?\");\n $stmt->execute(array($itemID));\n return $stmt->fetch();\n }", "function checkCartForItem($item)\n {\n foreach ($_SESSION['cart'] as $key => $value) {\n if ($_SESSION['cart'][$key]['name'] == $item) {\n return $key;\n }\n }\n return -1;\n }" ]
[ "0.7720997", "0.71519005", "0.69477266", "0.6878156", "0.6802791", "0.6791912", "0.678039", "0.66736186", "0.6664862", "0.66474235", "0.6645511", "0.6645511", "0.6645511", "0.66350526", "0.663405", "0.6624117", "0.6624117", "0.6611097", "0.6610956", "0.66051203", "0.66048944", "0.6579259", "0.6575234", "0.6562097", "0.6539419", "0.6517135", "0.6510732", "0.6507613", "0.6507177", "0.650067", "0.6487096", "0.6480723", "0.6474026", "0.6460175", "0.644556", "0.64139736", "0.64132124", "0.6405899", "0.6403969", "0.63984585", "0.63923544", "0.63679034", "0.6349192", "0.6341348", "0.63400185", "0.63393474", "0.6337438", "0.6314521", "0.62967765", "0.6292355", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6290412", "0.6270338", "0.62619454", "0.6247966", "0.62458235", "0.624222", "0.62377626", "0.62338436", "0.62208", "0.6213427", "0.6212458", "0.62066257", "0.6201728", "0.6191353", "0.6175703", "0.6146503", "0.61349237", "0.6134685", "0.6115464", "0.6106544", "0.6089047", "0.6085148", "0.6085039", "0.608157", "0.60767376", "0.60713327", "0.60681975", "0.6052674", "0.6052346", "0.6040738", "0.6040447", "0.6025718", "0.6024739", "0.6021611", "0.60132396", "0.6004832", "0.59835625", "0.5974929", "0.5964705", "0.5953824", "0.5946469", "0.59397507", "0.5918164" ]
0.0
-1
Returns ids array all items from the cart
public function getItemIds() { $this->loadItems(); $items = []; foreach ($this->items as $item) { $items[] = $item->getId(); } return $items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCartItemIds()\n\t{\n\t\t$ids = array();\n\n\t\tforeach (Data::getOrderItems(null) as $item) {\n\t\t\t$ids []= $item['PRODUCT_ID'];\n\t\t}\n\n\t\treturn $ids;\n\t}", "public function arrayItems() {\r\n $quoteId = Mage::getSingleton('checkout/session')->getQuote()->getId();\r\n $session = Mage::getModel('giftwrap/selection')->getSelectionByQuoteId(\r\n $quoteId);\r\n $productIds = array();\r\n if ($session) {\r\n foreach ($session as $value) {\r\n $productIds[] = $value['itemId'];\r\n }\r\n }\r\n return $productIds;\r\n }", "public function getItemIds();", "public function get_ids()\n {\n if (isset($_SESSION['cart'])) {\n \n return array_keys($_SESSION['cart']);\n }\n return null;\n }", "public function getProductIds()\n {\n $cartItems = $this->session->get('cart');\n if(empty($cartItems)){\n throw new \\Exception('The cart is empty!');\n }\n\n $cartProductIds = [];\n foreach ($cartItems as $cartItem) {\n $cartProductIds[] = $cartItem['product_id'];\n }\n\n return $cartProductIds;\n }", "public function getItemIds(){\n\t return $this->getIds();\n\t}", "public function getCurrentCart(){\n\n $product_ids = array();\n $cart = Mage::getModel('checkout/cart')->getQuote();\n foreach ($cart->getAllVisibleItems() as $item) {\n\n array_push($product_ids, $item->getProduct()->getId());\n }\n return $product_ids;\n }", "public function get_ids()\n\t{\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\treturn array_keys($_SESSION['cart']);\n\t\t}\n\t\treturn NULL;\n\t}", "public function getIds();", "public function getIds();", "public function getCartItems($cart_id);", "public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }", "public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }", "public function getCurrentFullCart(){\n\n $product_ids = array();\n $cart = Mage::getModel('checkout/cart')->getQuote();\n foreach ($cart->getAllItems() as $item) {\n\n array_push($product_ids, $item->getProduct()->getId());\n }\n return $product_ids;\n }", "public function getGoodsInCartIdentifiers()\n {\n return $this->getItemIdentifiers('GetGoodsInCartIdentifiers');\n }", "public function getCheckoutIds()\n {\n if ($this->instanceOfThis->cart->hasProducts() > 0)\n {\n $cartProducts = $this->instanceOfThis->cart->getProducts();\n\n $productsArr = [];\n\n foreach ($cartProducts as $product)\n {\n $productsArr[] = $product['product_id'];\n }\n\n $productsIDs = implode(\",\", $productsArr);\n\n $this->data .= \"\n /* --- checkoutIds --- */\n _ra.checkoutIdsInfo = [\n $productsIDs\n ];\n\n if (_ra.ready !== undefined) {\n _ra.checkoutIds(_ra.checkoutIdsInfo);\n };\n \";\n\n return $this->data;\n }\n }", "public function getAllIds();", "public function getAllIds(): array;", "function getCartProductsByCartIds() {\n\n if (func_num_args() > 0) {\n $carts = func_get_arg(0);\n $result = array();\n if ($carts) {\n foreach ($carts as $value) {\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(array('cr' => 'addtocart'))\n ->joinLeft(array('pr' => 'products'), 'pr.product_id=cr.product_id')\n ->where('cr.id=?', $value)\n ->where('pr.prod_status=?', 1);\n $result[] = $this->getAdapter()->fetchRow($select);\n }\n if ($result) {\n return $result;\n } else {\n return null;\n }\n }\n } else {\n return null;\n }\n }", "public function itemids() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->select(SalesHistoryDetail::get_aliasproperty('itemid'));\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->find()->toArray();\n\t}", "public abstract function get_ids();", "public function cryptoIds()\n {\n $ticker = $this->ticker();\n\n return array_map(function($o) {\n return $o->id;\n }, $ticker);\n }", "public function getProductIds(): array\n {\n return $this->product_ids;\n }", "public function getIds(): array\n {\n return $this->ids;\n }", "public function get_cart_items()\n\t{\n\t\t$this->initiate_cart();\n\t\treturn $this->ci->session->cart_items;\n\t}", "public function getProdIds() \n {\n return array_keys($this->_products);\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}", "public function getAllIds()\n {\n if (is_null($this->_allProductIds)) {\n if (!$this->isShuffled()) {\n $this->_allProductIds = array_keys($this->getItemCollection());\n return $this->_allProductIds;\n }\n\n $targetRuleProductIds = $this->_getTargetRuleProductIds();\n $linkProductCollection = $this->_getPreparedTargetLinkCollection();\n $linkProductIds = array();\n foreach ($linkProductCollection as $item) {\n $linkProductIds[] = $item->getEntityId();\n }\n $this->_allProductIds = array_unique(array_merge($targetRuleProductIds, $linkProductIds));\n shuffle($this->_allProductIds);\n }\n\n return $this->_allProductIds;\n }", "private function _getCartProductIds()\n {\n if ($this->_products === null) {\n $this->_products = [];\n foreach ($this->getQuote()->getAllItems() as $quoteItem) {\n /* @var $quoteItem \\Magento\\Quote\\Model\\Quote\\Item */\n $product = $quoteItem->getProduct();\n $this->_products[] = $product->getEntityId();\n }\n }\n\n return $this->_products;\n }", "public function getIdsList() {\n return $this->_get(1);\n }", "public function products_id()\n {\n foreach ($_SESSION['cart'] as $id => $quaty){\n $product_id[] = \"($id, $quaty)\";\n $product = Data::find_by_id($id);\n $id = array('id' => 'No: '. $product->id, 'name' => ' '. $product->name, 'price' => ' €'.$product->price, 'quaty' => ' qty '.$quaty, 'cost' => ' = €'.$product->price * $quaty .'</br>');\n foreach ($id as $key => $value){\n echo /*$key .' = '.*/ $value; /*echo \", \"; &nbsp; = spatie*/\n }\n }\n // $insert_id = implode(',', $product_id);\n }", "public function getIds()\n {\n\n }", "public function getOrderIds() {\n\t\tif (!Mage::registry('current_product')) {\n\t\t\treturn;\n\t\t}\n\t\t$product_id = Mage::registry('current_product')->getId();\n\t\t$orderItems = Mage::getResourceModel('sales/order_item_collection')\n\t\t\t\t\t->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t->toArray(array('order_id'))\n\t\t\t\t\t;\n\t\t$orderIds = array_unique(array_map(\n\t\t\tfunction($orderItem) {\n\t\t\t\treturn $orderItem['order_id'];\n\t\t\t},\n\t\t\t$orderItems['items']\n\t\t));\n\t\treturn $orderItems;\n\t}", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function getIdentities(){\n return [self::CACHE_TAG.'_'.$this->getProductId()];\n }", "function getPackage($cart) {\n $array = [];\n\n for ($i = 0; $i < sizeof($cart['items']); $i++) {\n $cartItem = $cart['items'][$i];\n unset($cartItem['_id']);\n\n array_push($array, $cartItem);\n }\n\n return $array;\n}", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "function get_deal_ids_from_cart($cart = null)\n\t{\n\t\tif ($cart)\n\t\t{\n\t\t\t$cart_items = $this->cart_item_m->get_many_by('cart_id', $cart->id);\n\t\t\t\n\t\t\tif ($cart_items)\n\t\t\t{\n\t\t\t\t$deal_ids = array();\n\t\t\t\t\n\t\t\t\tforeach ($cart_items as $item)\n\t\t\t\t{\n\t\t\t\t\tif ( ! in_array($item->entry_id, $deal_ids)) $deal_ids[] = (int) $item->entry_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $deal_ids;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public static function getAllIds(): array\n {\n return ArrayHelper::getColumn(static::find()->select('id')->asArray()->all(), 'id');\n }", "public function cart()\n {\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n $items = array();\n foreach ($this->_session->offsetGet('products') as $key => $value)\n {\n $items[$key] = array(\n 'id' \t\t=> \t$value['id'],\n 'qty' \t\t=> \t$value['qty'],\n 'price' \t=> \t$value['price'],\n 'name' \t\t=> \t$value['name'],\n 'sub_total'\t=> \t$this->_formatNumber($value['price'] * $value['qty']),\n \t'options' \t=> \t$value['options'],\n 'date' \t\t=> \t$value['date'],\n 'vat' => $value['vat']\n );\n }\n return $items;\n }\n }", "public function getCartProdIdsByRefId(Request $request)\n {\n $cartProdIdArr = DB::table($this->DBTables['Pre_Orders_Products'])\n ->where('order_reference_id', '=', $request->orderRefId)\n ->select('product_id')\n ->get();\n\n return $cartProdIdArr;\n }", "private function findCartBySessionId()\n {\n $sessionId = $this->session->getId();\n $cartsArray = $this->orderRepository->findBy(\n array(\n 'sessionId' => $sessionId,\n 'status' => OrderStatus::STATUS_IN_CART\n ),\n array(\n 'created' => 'DESC'\n )\n );\n\n return $cartsArray;\n }", "protected function getProductIds( \\Aimeos\\MShop\\Order\\Item\\Base\\Iface $basket ) : array\n\t{\n\t\t$productIds = [];\n\n\t\tforeach( $basket->getProducts() as $product ) {\n\t\t\t$productIds[] = $product->getProductId();\n\t\t}\n\n\t\treturn $productIds;\n\t}", "public function getInStockStockIds()\n {\n $stockIds = array();\n foreach ($this->getInStockStockItems() as $stockItem) {\n $stockId = $stockItem->getStockId();\n $stockIds[$stockId] = $stockId;\n }\n return $stockIds;\n }", "public function getGoodsIds()\n {\n return $this->goods_ids;\n }", "public function ids()\n {\n return $this->_ids;\n }", "public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}", "public function getItemsArray() {\r\n $stmt = $this->DB->prepare ( \"SELECT * FROM products\");\r\n $stmt->execute ();\r\n return $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n }", "public function getStoreIds();", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "private function item_ids()\r\n {/*{{{*/\r\n\t\t$items = array();\r\n $ids = array(); \r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n foreach($items as $item)\r\n $ids[] = basename($item, '.xml');\r\n\t\tsort($ids);\r\n\t\treturn array_reverse($ids);\r\n\t}", "public function getCatalogIds() {\n /* @var $productDao \\prosys\\model\\SKCZ_ProductDao */\n $productDao = Agents::getAgent('SKCZ_ProductDao', Agents::TYPE_MODEL);\n \n return array_map(\n function($row) {\n return $row->katalogove_cislo;\n },\n $productDao->findRecordsProjection(\n ['katalogove_cislo'],\n SqlFilter::create()->comparise('id_vyrobce', '=', $this->id)\n ->andL()->comparise('katalogove_cislo', '!=', '')\n ->andL()->comparise('odstranen', '=', '0')\n ->andL()->comparise('aktivni', '=', '1')\n )\n );\n }", "public function getItemIdsAt($offset)\n {\n return $this->get(self::_ITEM_IDS, $offset);\n }", "public function getAllIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customers');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}", "protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }", "public function getIdentities()\n {\n $identities = [];\n foreach ($this->getChildProducts() as $item) {\n $identities = array_merge($identities, $item->getIdentities());\n }\n return $identities;\n }", "public function getIds(): array\n {\n return array_map(fn (Entity $entity) => $entity->getId(), $this->entities);\n }", "public function getCartData()\n {\n $data = array();\n $session= Mage::getSingleton('checkout/session');\n $items = $session->getQuote()->getAllVisibleItems();\n if($items) {\n foreach ($items as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n }", "public function getItems(): array\n {\n return $_SESSION['cart'] ?? [];\n }", "public function getObjectIds();", "public function getIdentities()\n {\n $identities = [];\n foreach ($this->_getProductCollection() as $item) {\n $identities = array_merge($identities, $item->getIdentities());\n }\n\n return $identities;\n }", "public function cartOrders()\n {\n $cart = $this->sessionGet('cart');\n //$cart = Az::$app->cores->session->get('cart');\n\n //vdd($cart);\n $productItems = [];\n\n if ($cart) {\n foreach ($cart as $item) {\n $productItem = $this->productItemByCatalogId($item['catalog_id']);\n if ($productItem === null)\n continue;\n $productItem->cart_amount = $item['amount'];\n $productItems[] = $productItem;\n }\n }\n return $productItems;\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function getFullCart()\n {\n $completeCart = [];\n\n if ($this->get())\n {\n foreach ($this->get() as $id => $quantity)\n {\n $product = $this->em->getRepository(Product::class)->findOneById($id);\n\n if (!$product)\n {\n $this->delete($id);\n continue;\n }\n\n $completeCart[] = [\n 'product' => $product,\n 'quantity' => $quantity,\n ];\n }\n }\n\n return $completeCart;\n }", "public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }", "public function getAllCartProducts ($ids) {\n if (sizeof($ids) == 0)\n return array();\n $where = new Where();\n $where->in('id', $ids);\n\n $resultSet = $this->_tableGateway->select($where);\n $return = array();\n $ll = 'l';\n foreach( $resultSet as $r ) {\n $return[]=$r;\n }\n return $return;\n }", "public function getCartItemCollection()\n {\n return $this->items;\n }", "public static function readAllId() {\n try {\n $database = SModel::getInstance();\n $query = \"select id from producteur\";\n $statement = $database->prepare($query);\n $statement->execute();\n $results = array();\n while ($tuple = $statement->fetch()) {\n $results[] = $tuple[0];\n }\n return $results;\n } catch (PDOException $e) {\n printf(\"%s - %s<p/>\\n\", $e->getCode(), $e->getMessage());\n return NULL;\n }\n }", "public function getDuplicatedCartItems()\n {\n return DB::table('carts')\n ->rightJoin('product_cart', 'carts.id', '=', 'product_cart.cart_id')\n ->where('user_id', Auth::user()->id)\n ->where('state', 'direct-buy')\n ->get();\n }", "public function getProductIds($coupon_id)\n {\n CI::db()->select('product_id');\n CI::db()->where('coupon_id', $coupon_id);\n $res = CI::db()->where('coupon_id', $coupon_id)->get('coupons_products')->result();\n\n $list = [];\n foreach($res as $item)\n {\n $list[] = $item->product_id;\n }\n return $list;\n }", "public function getListItemIds() : array\n {\n return $this->listItemIds;\n }", "public static function getIdsInUse() {\n global $wpdb;\n $products = Cart66Common::getTableName('products');\n $sql = \"SELECT gravity_form_id as gfid from $products where gravity_form_id > 0\";\n $ids = $wpdb->get_col($sql);\n return $ids;\n }", "private function calcItems(){\n $items = array();\n for ($i = 0; $i < count($_SESSION['cart']); $i++) {\n //Calculate total price and quantity of similar items\n foreach ($items as $k => $v) {\n if ($v['id'] == $_SESSION['cart'][$i]) {\n $items[$k]['price'] += $items[$k]['price']/$items[$k]['quantity'];\n $items[$k]['quantity'] += 1; \n continue 2;\n }\n }\n //TO DO code sucks, fix\n $query = 'SELECT * FROM shop_' . $this->lang . ' WHERE id = :id';\n $item = $this->database->prepare($query)->execute(array(':id' => $_SESSION['cart'][$i]))->fetchAllAssoc();\n $items[$i] = $item[0];\n $items[$i]['quantity'] = 1;\n }\n return $items;\n }", "public static function fetch_all_product_ids() {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$product_ids = $wpdb->get_results( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'product' AND post_status = 'publish';\" );\r\n\r\n\t\t\treturn $product_ids;\r\n\t\t}", "public function getAllIdCurrentItems($itemQuote) {\r\n $arrIdItemCurrent = array();\r\n\r\n foreach ($itemQuote as $item) {\r\n $arrIdItemCurrent[] = $item->getId();\r\n }\r\n\r\n return $arrIdItemCurrent;\r\n }", "protected function _getFilterEntityIds()\n {\n return $this->getLayer()->getProductCollection()->getAllIdsCache();\n }", "public function getIdArray()\n {\n $idArray = array();\n\n foreach ($this as $importedVideo) {\n $idArray[] = $importedVideo->id;\n }\n\n return $idArray;\n }", "function getCart() {\n\t\t$cartData = array();\n\t\t\tif($stmt = $this->connection->prepare(\"select * FROM cart;\")) {\n\t\t\t\t$stmt -> execute();\n\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($id, $itemName, $itemDesc, $numberOf, $price);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$cartData[] = array(\n\t\t\t\t\t\t\t'id' =>$id,\n\t\t\t\t\t\t\t'productName' => $itemName,\n\t\t\t\t\t\t\t'productDescription' => $itemDesc,\n\t\t\t\t\t\t\t'numberOf' => $numberOf,\n\t\t\t\t\t\t\t'price' => $price\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn $cartData;\n\t}", "public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "public function getIds()\n {\n return $this->article_ids;\n }", "function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "protected function getAllProductIds()\n {\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $connection = $om->get('Magento\\Framework\\App\\ResourceConnection')->getConnection();\n // TODO: use getTable()\n \n $visibilityAttrId = 99; // TODO: get it dynamically: visibility\n $select = $connection->select()\n ->from(['main_table' => 'catalog_product_entity'], ['entity_id'])\n ->join(\n 'catalog_product_entity_int as avisib',\n 'main_table.entity_id = avisib.entity_id AND avisib.attribute_id = '.$visibilityAttrId,\n []\n )\n ->where('avisib.value IN(?)', [\n \\Magento\\Catalog\\Model\\Product\\Visibility::VISIBILITY_IN_SEARCH,\n \\Magento\\Catalog\\Model\\Product\\Visibility::VISIBILITY_BOTH\n ]);\n \n return $connection->fetchCol($select);\n }", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "function get_product_ids($voucher_id)\n\t{\n\t\t$this->db->select('product_id');\n\t\t$this->db->where('voucher_id', $voucher_id);\n\t\t$res = $this->db->get('vouchers_products')->result_array();\n\n\t\t$list = array();\n\t\tforeach($res as $item)\n\t\t{\n\t\t\tarray_push($list, $item[\"product_id\"]);\t\n\t\t}\n\t\treturn $list;\n\t}", "private function _cart($items = array())\n {\n \treturn array(\n 'id'\t\t=> $items['id'],\n 'qty' \t\t=> $items['qty'],\n 'price' \t=> $this->_formatNumber($items['price']),\n 'name' \t\t=> $items['name'],\n \t'options'\t=> isset($items['options']) ? $items['options'] : 0,\n 'date' \t \t=> date('Y-m-d H:i:s', time()),\n 'vat' => isset($items['vat']) ? $items['vat'] : $this->_config['vat']\n );\n }", "private function get_convention_product_ids() : array {\n\t\t$all_convention_ids = get_transient( 'ghc-all-convention-variation-ids' );\n\t\tif ( false === $all_convention_ids ) {\n\t\t\t$all_convention_ids = $this->set_convention_variation_ids_transient();\n\t\t}\n\n\t\treturn $all_convention_ids;\n\t}", "public function _getItems(Cart $cart)\n {\n $items = $cart->getQuote()->getAllVisibleItems();\n try {\n $data = [];\n $configurableSkus = [];\n foreach ($items as $item) {\n $product = $item->getProduct();\n $_item = [];\n $_item['vars'] = [];\n if ($item->getProduct()->getTypeId() == 'configurable') {\n $_item['isConfiguration'] = 1;\n $parentIds[] = $item->getParentItemId();\n $options = $this->cpModel->getOrderOptions($product);\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(), $configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n if ($_item['id']) {\n $_item['qty'] = (int)$item->getQty();\n $_item['url'] = $item->getProduct()->getProductUrl();\n $_item['image'] = $this->productHelper->getSmallImageUrl($product);\n $current_price = null;\n $reg_price = $product->getPrice();\n $special_price = $product->getSpecialPrice();\n $special_from = $product->getSpecialFromDate();\n $special_to = $product->getSpecialToDate();\n if ($special_price &&\n ($special_from === null || (strtotime($special_from) < strtotime('Today'))) &&\n ($special_to === null || (strtotime($special_to) > strtotime('Today')))) {\n $current_price = $special_price;\n } else {\n $current_price = $reg_price;\n }\n $_item['price'] = $current_price * 100;\n if ($tags = $this->_getTags($product)) {\n $_item['tags'] = $tags;\n }\n $data[] = $_item;\n }\n }\n\n return $data;\n } catch (\\Exception $e) {\n $this->clientManager->getClient()->logger($e);\n\n return false;\n }\n }", "public function selectcartiddetails() {\n if (func_num_args() > 0) {\n $cartid = func_get_arg(0);\n try {\n $select = $this->select()\n ->from($this)\n ->where('id IN (?)', $cartid);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n return $result;\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }", "public function getAllShoppingItems()\n {\n $query = $this->db->prepare('SELECT `id`, `name`, `bought`, `deleted` FROM `shopping_items`;');\n $query->execute();\n $results = $query->fetchAll();\n return $results;\n }", "public function getAllIdPreviousItems($kt) {\r\n $arrIdItemOld = array();\r\n\r\n $quoteOldId = Mage::getSingleton('core/session')->getQuoteOldId();\r\n if ($kt == 2) {\r\n $quoteOld = Mage::getModel('sales/quote')\r\n ->setStoreId(Mage::getSingleton('adminhtml/session_quote')->getStoreId())\r\n ->load($quoteOldId)->getAllItems();\r\n } else {\r\n $quoteOld = Mage::getModel('sales/quote')->load($quoteOldId)->getAllItems();\r\n }\r\n\r\n foreach ($quoteOld as $item) {\r\n $arrIdItemOld[] = $item->getId();\r\n }\r\n // Zend_debug::dump($arrIdItemOld);die();\r\n return $arrIdItemOld;\r\n }" ]
[ "0.8330658", "0.7985419", "0.77382225", "0.76747614", "0.7654739", "0.7560241", "0.7375885", "0.73395884", "0.73022985", "0.73022985", "0.7288595", "0.72762406", "0.72695196", "0.7265569", "0.7203442", "0.71824473", "0.7160177", "0.7155635", "0.712711", "0.71102655", "0.7083708", "0.7019675", "0.70193946", "0.6986093", "0.69541615", "0.68958026", "0.6895482", "0.6895482", "0.68613535", "0.6858309", "0.68342894", "0.6832676", "0.6786695", "0.6772023", "0.67329645", "0.6725724", "0.6725724", "0.6725724", "0.6725724", "0.6725724", "0.6725724", "0.6725724", "0.6725724", "0.67132014", "0.67063004", "0.66987467", "0.6689942", "0.6671", "0.6651723", "0.6641412", "0.6630971", "0.659878", "0.657853", "0.65733135", "0.6550385", "0.65069634", "0.6502928", "0.6502", "0.64576685", "0.64378816", "0.643243", "0.6426307", "0.6400349", "0.63954055", "0.63889265", "0.63844925", "0.63702923", "0.6354426", "0.63470554", "0.6344559", "0.6315041", "0.63091755", "0.6305951", "0.62927485", "0.6262413", "0.6260216", "0.62581474", "0.6255765", "0.6253844", "0.62346303", "0.6234584", "0.62336814", "0.6208839", "0.6202638", "0.61992794", "0.619789", "0.6189401", "0.61751115", "0.6172685", "0.61648315", "0.6163884", "0.6163768", "0.61496735", "0.61430347", "0.6132619", "0.61309046", "0.6123365", "0.61042064", "0.6094853", "0.6093319" ]
0.7736977
3
Returns total cost all items from the cart
public function getTotalCost() { $this->loadItems(); return $this->calculator->getCost($this->items); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}", "public function get_total_cost()\n\t{\n\t\t$num = '0.00';\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\t#if there are items to display \n\t\t\t\n\t\t\t#get product ids\n\t\t\t$ids = $this->get_ids();\n\t\t\t\n\t\t\t#get product prices\n\t\t\tglobal $Products;\n\t\t\t$prices = $Products->get_prices($ids);\n\t\t\t\n\t\t\t#loop throih adding the cost of each item and timesing it by the number of item in the cart. \n\t\t\tif($prices != NULL)\n\t\t\t{\n\t\t\t\tforeach($prices as $price)\n\t\t\t\t{\n\t\t\t\t\t$num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public function get_total_cost()\n {\n $num = \"0.00\";\n\n if (isset($_SESSION['cart'])) {\n // if there are items to display\n $ids = $this->get_ids();\n\n // get product ids\n global $products;\n $prices = $products->get_prices($ids);\n\n // loop through, adding the cost of each item * the number of item\n // in the cart to $num each time\n\n if ($prices != null) {\n foreach ($prices as $price) {\n $num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n }\n }\n }\n return $num;\n }", "public function getTotalCost()\n {\n $totalCost = 0.00;\n\n foreach ($this->getItems() as $cartItem) {\n $totalCost += ($cartItem->price * $cartItem->count);\n }\n\n return $totalCost;\n }", "public function getProductsCostTotal()\n {\n return $this->getProducts()->sum('price');\n }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function calculateTotalPrice($items){\n $total = 0;\n foreach($items as $item){\n $total += $item['subtotal'];\n }\n return $total;\n }", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "public function getTotalAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n }", "public static function getCartTotal(){\n $totalAmount=0;\n $cart = self::getCartContent();\n foreach ($cart as $key => $value) {\n if(is_numeric($value['amount']))\n $totalAmount += $value['amount'];\n }\n return $totalAmount;\n }", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}", "function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}", "public function getTotalCost()\n\t{\n\t\t$tprice = $this->getPrice();\n\n\t\tforeach ($this->options as $o)\n\t\t{\n\t\t\t$tprice += $o->getPrice() * $o->getQuantity();\n\t\t}\n\n\t\treturn $tprice;\n\t}", "public function getSubTotalCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->SubTotal) {\n $total += $item->SubTotal;\n }\n }\n \n return $total;\n }", "public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "public function getCartTotal()\n {\n }", "public function getTotalPrice()\n\t{\n\t\t$total = 0.0;\n\n\t\tforeach ($this->items as $item)\n\t\t{\n $total += $item->getPrice() + $item->getExtrasPrice();\n }\n\n\t\treturn $total;\n\t}", "function getPrice($cart) {\n $cart = $cart['items'];\n\n $totalCost = 0;\n\n /**\n * Sums the cost of each product in the user's cart.\n */\n for ($i = 0; $i < sizeof($cart); $i++) {\n $quantity = ['dvdQuantity' => (int)$cart[$i]['dvdQuantity'], 'bluRayQuantity' => (int)$cart[$i]['bluRayQuantity']];\n\n foreach ($quantity as $key => $value) {\n $isDVD = ($key) === 'dvdQuantity';\n\n if ($value > 0) {\n $totalCost += ($value * (float)$cart[$i][($isDVD) ? 'dvdPrice' : 'bluRayPrice']);\n }\n }\n }\n\n /**\n * The total cost summary is calculated.\n */\n $priceBreakdown = ['subTotal' => bcdiv($totalCost, 1, 2),\n 'vat' => bcdiv((0.20 * $totalCost), 1, 2),\n 'postAndPackaging' => 'Free',\n 'grandTotal' => bcdiv(($totalCost + (0.20 * $totalCost)), 1, 2)\n ];\n\n return $priceBreakdown;\n}", "public function get_cart_total() {\n\t\treturn apply_filters( 'woocommerce_cart_contents_total', wc_price( wc_prices_include_tax() ? $this->get_cart_contents_total() + $this->get_cart_contents_tax() : $this->get_cart_contents_total() ) );\n\t}", "function getTotalPrice()\n {\n $total = 0;\n foreach ($_SESSION['cart'] as $key => $value) {\n $total += $_SESSION['cart'][$key]['total'];\n }\n return $total;\n }", "public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "public function getTotalPrice() {\n return $this->getQuantity()*$this->getPrice();\n }", "public function total_items()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.total_items', 0);\n\t}", "function totalPrice(){\n \n global $conn;\n\n $ip_add = getUserIp();\n $total = 0;\n\n $select_cart = \"SELECT * FROM cart WHERE ip_address = '$ip_add'\";\n $run_select_cart = mysqli_query($conn, $select_cart) or die(\"Total Price Query Failed\");\n while($row_select_cart = mysqli_fetch_assoc($run_select_cart)){\n $pro_id = $row_select_cart['cart_id'];\n $product_qty = $row_select_cart['qty'];\n\n $get_price = \"SELECT * FROM products WHERE product_id = '$pro_id'\";\n $run_get_price = mysqli_query($conn, $get_price);\n while($row_get_price = mysqli_fetch_assoc($run_get_price)){\n $price_qty = $row_get_price['product_price'] * $product_qty;\n\n $total = $total + $price_qty; \n }\n }\n\n echo $total; \n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "function total_price($cart){\n $price = 0.0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $bookprice = getbookprice($isbn);\n if($bookprice){\n $price += $bookprice * $qty;\n }\n }\n }\n return $price;\n }", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "public function getCost()\n {\n return round($this->price * $this->quantity, 2);\n }", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "public function getSumCartWithCartDetailsAttribute()\n {\n $price = $this->cart_detials->sum('TotalCartDetails') + $this->getTotalCartAttribute();\n return $price;\n }", "public function calculateOrderTotal($items)\n {\n $total = 0;\n foreach ($items as $key => $item) {\n $total += $item['quoted_price'];\n }\n return $total;\n }", "public function calculate_cart_total()\r\n\t{\r\n\t\t$cart_total = 0;\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['shipping_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['surcharge_total'];\r\n\t\t$cart_total += (! $this->flexi_cart->cart_prices_inc_tax()) ? $this->flexi->cart_contents['summary']['tax_total'] : 0; \r\n\t\t\r\n\t\t$this->flexi->cart_contents['summary']['total'] = $this->format_calculation($cart_total);\r\n\t\t\t\t\r\n\t\treturn TRUE; \r\n\t}", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "function total_price(){\r\n\t\t$total = 0;\r\n\t\tglobal $con;\r\n\t\t$ip=getIp();\r\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\";\r\n\t\t$run_price = mysqli_query($con,$sel_price);\r\n\t\twhile($p_price=mysqli_fetch_array($run_price)){\r\n\t\t\t\r\n\t\t\t$painting_id = $p_price['painting_id'];\r\n\t\t\t$painting_price = \"select * from painting where painting_id='$painting_id'\";\r\n\t\t\t$run_painting_price = mysqli_query($con,$painting_price);\r\n\t\t\twhile($pp_price = mysqli_fetch_array($run_painting_price)){\r\n\t\t\t\t\r\n\t\t\t\t$painting_price = array($pp_price['painting_price']);\r\n\t\t\t\t$values = array_sum($painting_price);\r\n\t\t\t\t\r\n\t\t\t$total += $values;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\techo \"$\".$total;\r\n\t\t\r\n\t}", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "public function getTotalCart($cart)\n {\n $products = $cart->getProducts(true);\n $total_products = 0;\n foreach ($products as &$product) {\n $price_item_with_tax = Product::getPriceStatic(\n $product['id_product'],\n true,\n $product['id_product_attribute']\n );\n $price_item_with_tax = (float)number_format(\n $price_item_with_tax,\n 2,\n '.',\n ''\n );\n $total_products += ($price_item_with_tax * $product['cart_quantity']);\n }\n \n $total_shipping = $cart->getOrderTotal(true, Cart::ONLY_SHIPPING);\n $total_wrapping = $cart->getOrderTotal(true, Cart::ONLY_WRAPPING);\n \n $amount = number_format(\n $total_products + $total_wrapping + $total_shipping,\n 2,\n '.',\n ''\n );\n return $amount;\n }", "public function calculateTotalPrice()\n {\n $this->price = CartHelper::getTotalPrice();\n\n if ($this->shippingCarrierId) {\n $shippingCarrier = ShippingCarrier::find($this->shippingCarrierId);\n if ($shippingCarrier) {\n $this->price += TaxesHelper::calcPriceWithTax($shippingCarrier->price);\n }\n }\n\n if ($this->paymentMethodId) {\n $paymentMethod = PaymentMethod::find($this->paymentMethodId);\n if ($paymentMethod) {\n $this->price += TaxesHelper::calcPriceWithTax($paymentMethod->price);\n }\n }\n\n $this->taxes = TaxesHelper::calcTaxPrice($this->price);\n }", "public static function total()\n {\n $total = 0;\n if (isset($_SESSION['cart']) && $_SESSION['cart'] != null) {\n foreach ($_SESSION['cart'] as $cart) {\n $total += $cart['qty'];\n }\n }\n return $total;\n }", "public function getTotalcost()\n {\n return $this->totalcost;\n }", "public function cartTotalAmount()\n {\n $cartPrice = 0;\n\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); // check if user has any cart or not\n if($userCartExistence) //if user has any cart then calculate total amount of items\n {\n $cartPrice = Cart::CartTotalPrice(Auth::id());\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart) //if there is a cart in the session then calculate total price of cart\n {\n $cartPrice = $Cart->totalPrice;\n }\n }\n\n return $cartPrice;\n }", "function totalPrice(){\n $ip_add=getRealIpAddr();\n global $db;\n $total = 0;\n $sel_price = \"SELECT * FROM cart where ip_add = '$ip_add'\";\n $run_price = mysqli_query($db, $sel_price);\n while ($record = mysqli_fetch_array($run_price)) {\n $pro_id = $record['p_id'];\n $pro_price = \"SELECT * FROM products where product_id = '$pro_id'\";\n $run_pro_price = mysqli_query($db, $pro_price);\n while ($p_price = mysqli_fetch_array($run_pro_price)) {\n $product_price = array($p_price['product_price']);\n $values = array_sum($product_price);\n $total += $values;\n }\n }\n echo \"$\" . $total;\n}", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function getTotalSumAmountConvertedCarts()\n {\n $sumAmount = Mage::getModel('abandonment/orderflag')->getResource()->getSumAmountConvertedCarts();\n return $sumAmount;\n }", "public function getItemCost()\n {\n return $this->itemCost;\n }", "function custom_calculated_total( $total, $cart ){\n\n\t$packages = WC()->cart->get_shipping_packages();\n\t$cost = 0;\n\tif(count($packages) > 1){\n\t\t$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' )[0];\n\t\t$shipping_methods = WC()->session->get('shipping_for_package_0')['rates'];\n\t\tforeach ( $packages as $package ) {\n\t\t\tif($package[\"recurring_cart_key\"] === false){\n\t\t\t\t// Loop through the array\n\t\t\t\tforeach ( $shipping_methods as $method_id => $shipping_rate ){\n\t\t\t\t\t$cost = $shipping_rate->cost;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn round( $total - $cost, $cart->dp );\n\t}\n\n\t/*echo '<pre>';\n\tvar_dump($cost);\n\tvar_dump($total);\n\techo '</pre>';*/\nreturn $total;\n\n}", "public function getTotalValue()\n {\n $totalValue = 0.0;\n $cartItems = $this->cart->getCartItems();\n\n foreach ($cartItems as $cartItem) {\n $totalValue += $cartItem['price'] * $cartItem['quantity'];\n }\n\n return $totalValue;\n }", "function total_price(){\n\t\n\t\t$total = 0;\n\t\t\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp(); \n\t\t\n\t\t\n\t\tif(isloggedin()){\n\t\t $c_id=$_SESSION['cid'];\n\t\t \n\t\t $sel_price = \"select * from cart where customer_id='$c_id'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t \n\t\t }\n\t\t}\n\t\telse{\n \t\t \n \t\t$sel_price = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t\n\t\t }\n\t\t\n\t\t}\n\t\t\n\t\techo \" €\" . $total.\" \";\n\t\t\n\t}", "public function testCartTotalAmount()\n {\n $items = new MollieLineItemCollection([\n new MollieLineItem(\n '',\n '',\n 1,\n new LineItemPriceStruct(2.73, 2.73, 0.44, 19),\n '',\n '',\n '',\n ''\n ),\n new MollieLineItem(\n '',\n '',\n 2,\n new LineItemPriceStruct(1, 2, 0.47, 19),\n '',\n '',\n '',\n ''\n ),\n ]);\n\n $this->assertEquals(4.73, $items->getCartTotalAmount());\n }", "function price(){\n\n\t\t$total = 0; //initialize to 0 lest error\n\n\t\tglobal $con;\n\n\t\t$ip=getIP();\n\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\"; //get price from what is in the cart for whoevers ip address\n\n\t\t$run_price = mysqli_query($con, $sel_price);\n\n\t\twhile ($p_price = mysqli_fetch_array($run_price)){\n\n\t\t\t$pro_id = $p_price['p_id'];\n\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\n\t\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\n\t\t\t//link to the products table to get prices\n\t\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){\n\n\t\t\t\t$product_price = array($pp_price['product_price']);\n\t\t\t\t//array to get all the prices in one\n\n\t\t\t\t$values = array_sum($product_price);\n\n\t\t\t\t$total +=$values; //sum\n\n\t\t\t}\n\t\t}\n\n\t\techo \"Ksh\" . $total;\n\n\t}", "public function subtotal()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->subtotal();\n });\n }", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\n }", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "public function subtotal()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['price'] * $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }", "function total_price(){\n\t$total = 0; // agei instantiate kore dilam j zero\n\tglobal $con;\n\t$ip=getIp();\n\t$sel_price = \"select * from cart where ip_add='$ip'\";\n\t$run_price=mysqli_query($con, $sel_price);\n\twhile($p_price=mysqli_fetch_array($run_price)){\n\t\t$pro_id=$p_price['p_id'];//ip address wise product er id ta dibe, from there we can tell what is the prrice of product\n\t\t$pro_price=\"select * from products where product_id='$pro_id'\"; // cart table theke product id ta niye seta k product table er product ider sathe match kortese\n\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){// product table theke product id wise product price ta niye ashtese\n\t\t\t\t$product_price= array($pp_price['product_price']); //that certain user joto product cart a add korsilo segula sob k akta array te rakhlam\n\t\t\t\t$values= array_sum($product_price); //oi uporer array er sumation kore show korbe akta value..like total value \n\t\t\t\t$total+=$values;\n\t\t\n\t\t}\n\n\t}\n\techo $total;\n}", "public static function totalItem(){\n if(Auth::check()){\n $cart = cart::Where('user_id', Auth::id() )\n ->Where('order_id',NULL)\n ->get();\n }\n else{\n $cart = cart::Where('ip_address', request()->ip() )\n ->Where('order_id',NULL)\n ->get();\n }\n $totalItem=0;\n foreach ($cart as $value) {\n $totalItem += $value->product_quantity;\n }\n return $totalItem;\n\n}", "public function total(): float\n {\n return $this->itemsPrice()->sum(fn (array $item) => $item['price']);\n }", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "function total_price(){\n\t\t//total price starts from 0\n\t\t$total=0;\n\tglobal $connection;\n\t\t$ip=getIp();\n\t\t//taken data from cart table using the customers ip address\n\t\t$select_price = \"select * from cart where ip_address='$ip'\";\n\t\t$run_price = mysqli_query($connection,$select_price);\n\t\t//this while loop takes data from product table according to the product id \n\t\twhile($product_price=mysqli_fetch_array($run_price)){\n\t\t\t$product_id=$product_price['product_id'];\n\t\t\t$product_price=\"select * from products where product_id='$product_id'\";\n\t\t\t$run_product_price=mysqli_query($connection, $product_price);\n\t\t\t//used an array to get all data into a single variable \n\t\t\twhile($pp_price=mysqli_fetch_array($run_product_price)){\n\t\t\t\t//product prices set in the array to add up\n\t\t\t\t$product_price=array($pp_price['product_price']);\n\t\t\t\t$values=array_sum($product_price);\n\t\t\t\t//total price \n\t\t\t\t$total +=$values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo \"LKR. \" . $total;\n\t}", "function total_price(){\n\nglobal $db;\n\n$ip_add = getRealUserIp();\n\n$total = 0;\n\n$select_cart = \"select * from cart where ip_add='$ip_add'\";\n\n$run_cart = mysqli_query($db,$select_cart);\n\nwhile($record=mysqli_fetch_array($run_cart)){\n\n$pro_id = $record['p_id'];\n\n$pro_qty = $record['qty'];\n\n\n$sub_total = $record['p_price']*$pro_qty;\n\n$total += $sub_total;\n\n\n\n\n\n\n}\n\necho \"$\" . $total;\n\n\n\n}", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "public function get_current_amount()\n\t{\n\t\t$sum = 0;\n\t\tforeach ($this->get_cart_items() as $key => $value) {\n\t\t\tif (isset($value['price']))\n\t\t\t\t$sum += ($value['price'] * $value['qty']);\n\t\t}\n\t\treturn $sum;\n\t}", "private function calculatePrice($items)\n {\n //creating new ShoppingCartVisitorImpl object\n $visitor = new ShoppingCartVisitorImpl();\n\n $sum = 0; //creating local variable and assigning 0 to it\n\n //looping over till the end of the array\n for ($j = 0; $j < count($items); $j++) {\n //calling accept function of class that has implemented ItemElement and getting the values and adding\n $sum = $sum + $items[$j]->accept($visitor);\n }\n return $sum;\n }", "function get_cart_discount_total() {\n\t\t\treturn $this->discount_cart;\n\t\t}", "public function getSumCartDetailsAttribute()\n {\n $price = $this->cart_detials->sum('TotalCartDetails');\n return $price;\n }", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }", "public function itemTotal(): float;", "function total_items(){\n \n \tglobal $con; \n\t$ip = getIp(); \n\t$count_items=0;\n\tif(isloggedin()){\n\t $c_id=$_SESSION['cid'];\n\t \n\t $get_items = \"select * from cart where customer_id='$c_id'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t\n\t}\n\telse{\n\t\t$get_items = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t \n\t}\n \n\techo $count_items.\" \";\n\t}", "function total_price(){\n\t\t\n\t global $db;\n\t \n $ip_add = getRealIpAddr(); /* saving ip address in local variable*/\n\t \n\t $total = 0; /*price should start from 0*/\n\n\t $sel_price =\"SELECT * FROM cart WHERE ip_add = '$ip_add'\"; /* when user is online,detect its ip address by selecting it from cart table*/\n\t\t\n\t$run_price = mysqli_query($db,$sel_price);\n\t\n\twhile($record=mysqli_fetch_array($run_price)) {\n\t\t\n\t$pro_id = $record['p_id'];\t /* We fetched p_id from cart table in database with fetch array.fetchimg all ids that are selected bu user till now*/\n\t /* relation between two tables.we are running another query cos price is not included in cart table.its in products table.so we are making relation between two tables to fetch price from another table*/\n\t$pro_price =\"SELECT * FROM products WHERE product_id= '$pro_id'\"; /* Now we are finding id in products table in database,those id that are present in cart table in database.only then we would able to get price of products*/\n\t\t\n\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\n\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\n\t\t\n\t\t$product_price = array($p_price['product_price']); /* We need product_price from products table.we used array because we need multiple prices of products in array form like,500,400,300 and so on*/ \n\t\n\t $values = array_sum($product_price); /* we added prices of all products with the help of array_sum.its easy to add 2 things in php.but if things are more than 2 then arraysum is used to add sum of arrays.it will add price of records one by one as user click add cart button */\n\t\n\t $total += $values; /* we added values variable to total variable that was zero.if you delete products it will show 0*/\n\t\n\t}\n\t\n\t\n\t}\n\t\n\t echo \"$\" . $total; /* \"$\" currency*/\n\t}", "public function getGrandTotalAttribute() {\n $total = $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n\n if ($this->userPromotion) {\n $total *= ($this->userPromotion->promotion->discount / 100);\n }\n\n $total += $this->deliveryOption->cost;\n\n return $total;\n\n }", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function cartAmount()\r\n\t\t{\r\n\t\t\t//Validate request method\r\n\t\t\tif($this->getRequestMethod() != \"GET\"){\r\n\t\t\t\t$this->methodNotAllowed();\r\n\t\t\t}\r\n\r\n\t\t\t$this->validation(array('target'));\r\n\r\n\t\t\t$arrAllowed=array('total','total-discount','total-tax');\r\n\t\t\t$sTarget=$this->_arrRequest['target'];\r\n\r\n\t\t\tif(!in_array($sTarget, $arrAllowed)) $this->methodNotFound();\r\n\r\n\t\t\t$sField=\"\";\r\n\t\t\tif($sTarget=='total') $sField='iGrandTotal';\r\n\t\t\tif($sTarget=='total-discount') $sField='iTotalDiscount';\r\n\t\t\tif($sTarget=='total-tax') $sField='iTotalTax';\r\n\r\n\t\t\t$arrResult = $this->getCartAmount($this->_sCartTable,$sField);\r\n\t\t\t$iStatus \t= (count($arrResult)>0) ? 'Success' : 'False';\r\n\t\t\t$arrData \t= (count($arrResult)>0) ? $arrResult : \"Record not found.\";\r\n\r\n\t\t\t$arrResponse['status'] = $iStatus;\r\n\t\t\t$arrResponse['data'] = $arrData;\r\n\t\t\t$this->response($this->json($arrResponse), 200);\r\n\t\t}", "public function getTotalCost()\n {\n $subtotal = $this->SubTotalCost;\n $discount = $this->DiscountAmount;\n $postage = $this->PostageCost;\n $tax = $this->TaxCost;\n\n return ($subtotal - $discount) + $postage + $tax;\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function get_rows_total_price()\n\t{\n\t\t// TODO: This price should be stored not calculated every time!\n\t\t$total = 0;\n\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$total += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t}\n\n\t\treturn $total;\n\t}", "public function getBaseTotalInvoicedCost();", "function total_price()\n{\n global $db;\n $ip_add = getRealUserIp();\n $total = 0;\n $select_cart = \"select * from cart where ip_add='$ip_add'\";\n $run_cart = mysqli_query($db, $select_cart);\n while ($record = mysqli_fetch_array($run_cart)) {\n $pro_id = $record['p_id'];\n $pro_qty = $record['qty'];\n $sub_total = $record['p_price'] * $pro_qty;\n $total += $sub_total;\n }\n echo \"Rs.\" . $total;\n}", "function getSubTotal()\n {\n return $this->_cart->getQuote()->getSubtotal();\n }", "public function cost()\n {\n return $this->beverage->cost() + $this->cost;\n }" ]
[ "0.8022281", "0.77250654", "0.7674297", "0.76469654", "0.76270336", "0.7526365", "0.7493104", "0.7448445", "0.7321985", "0.72973824", "0.72194195", "0.7181885", "0.7154182", "0.71482825", "0.7148271", "0.71408683", "0.71266395", "0.7116544", "0.7110881", "0.70966923", "0.7084024", "0.70574063", "0.7051673", "0.70403117", "0.7030323", "0.7027564", "0.7025028", "0.70053756", "0.70003635", "0.6997542", "0.6986237", "0.69839025", "0.6972704", "0.6971844", "0.6968212", "0.696404", "0.689426", "0.68743277", "0.685889", "0.6852641", "0.6844109", "0.6837591", "0.6833318", "0.68246406", "0.6814154", "0.6793204", "0.67728186", "0.6771909", "0.6768944", "0.67630047", "0.675336", "0.67514724", "0.6741663", "0.6739383", "0.67347085", "0.6722431", "0.67134976", "0.67064", "0.66973734", "0.66748565", "0.66647583", "0.66632795", "0.665495", "0.6654586", "0.66508806", "0.6646543", "0.6638159", "0.6635741", "0.6625666", "0.66188884", "0.66158885", "0.66158277", "0.66045696", "0.66038126", "0.65957206", "0.65781945", "0.6571488", "0.65656596", "0.65608555", "0.65599865", "0.6549301", "0.6545806", "0.6511948", "0.65107363", "0.64953226", "0.6493737", "0.6493255", "0.64919144", "0.647991", "0.6476622", "0.64647144", "0.6458341", "0.6457203", "0.645129", "0.645129", "0.64289635", "0.6423722", "0.6423327", "0.64100236", "0.6404899" ]
0.75893563
5
Returns total count all items from the cart
public function getTotalCount() { $this->loadItems(); return $this->calculator->getCount($this->items); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "public function getCartItemsCount ($cart_id);", "public function get_total_items()\n {\n $num = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $item) {\n $num = $num + $item;\n }\n }\n return $num;\n }", "public function total_items()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.total_items', 0);\n\t}", "public function get_total_items()\n\t{\n\t\t$num = 0;\n\t\t\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\tforeach($_SESSION['cart'] as $item)\n\t\t\t{\n\t\t\t\t$num = $num + $item;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public static function countItems()\n {\n $count = 0;\n if (isset($_SESSION['cart'])) {\n $count = count($_SESSION['cart']);\n }\n \n return $count;\n }", "function cart_count(){\n\t\tif(isset($_SESSION['cart'])){\n\t\t\t$cart = $_SESSION['cart'];\n\t\t\t$item_count = 0;\n\t\t\tforeach($cart as $item_id => $item_quantity){\n\t\t\t\t$item_count += $item_quantity;\n\t\t\t}\n\t\t\treturn $item_count;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "public function getTotalItemCount();", "public static function getCartCount()\n {\n $count = 0;\n $key = Config::get('catalog.cart_session');\n\n if(isset($_SESSION[$key]) && $items = $_SESSION[$key])\n {\n foreach($items as $id => $qty)\n $count += $qty;\n }\n\n return $count;\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public function list_items_total()\n\t{\n\t\t$cnt = $this->list_items(NULL, NULL, NULL, NULL, TRUE);\n\t\tif (is_array($cnt))\n\t\t{\n\t\t\treturn count($cnt);\n\t\t}\n\t\treturn $cnt;\n\t}", "function total_items(){\n\t\tif(isset($_GET['add_cart'])){\n\t\t\tglobal $connection;\n\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection,$get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t}else{\n\t\t\tglobal $connection;\n\t\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection, $get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t\t}\n\t\t\techo $count_items;\n\t\t}", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "function totalItems(){\n\tif (isset($_GET['addCart'])) {\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}else{\n\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}\n\n\techo $countItems;\n}", "public function countTotalItems()\n\t{\n\t\t$sql = \"SELECT * FROM items\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->num_rows();\n\t}", "public function count()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n }, 0);\n }", "public static function total()\n {\n $total = 0;\n if (isset($_SESSION['cart']) && $_SESSION['cart'] != null) {\n foreach ($_SESSION['cart'] as $cart) {\n $total += $cart['qty'];\n }\n }\n return $total;\n }", "public function get_cart_count()\n\t{\n\t\t$this->initiate_cart();\n\t\treturn sizeof($this->ci->session->cart_items);\n\t}", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "function total_items(){\n \n \tglobal $con; \n\t$ip = getIp(); \n\t$count_items=0;\n\tif(isloggedin()){\n\t $c_id=$_SESSION['cid'];\n\t \n\t $get_items = \"select * from cart where customer_id='$c_id'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t\n\t}\n\telse{\n\t\t$get_items = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t \n\t}\n \n\techo $count_items.\" \";\n\t}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = array_reduce($items->all(), function ($a, ItemCollection $item) {\n return $a += $item->quantity;\n }, 0);\n\n return $count;\n }", "function total(){\n\n\tif(isset($_GET['add_cart'])){\n\n\t\tglobal $con;\n\n\t\t$ip = getIp();\n\n\t\t$get_items = \"select * from cart where ip_add='$ip'\";\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\n}\n\t\telse{\n\n\t\t\tglobal $con;\n\n\t\t\t$ip = getIp();\n\n\t\t\t$get_items = \"select * from cart where ip_add='$ip'\";\n\n\t\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\t}\n\n\t\techo $count_items;\n\t}", "function getTotalItems() { return $this->m_totalItems; }", "public function getTotalItems()\n\t{\n\t\treturn $this->totalItems;\n\t}", "public function totalCount();", "public function totalCount();", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}", "function totalItems() {\n if(isset($_GET['add_cart'])) {\n\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\");\n\n $count_items = mysqli_num_rows($run_items);\n\n } else {\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\") or die(mysqli_error($con));\n\n $count_items = mysqli_num_rows($run_items);\n\n while($get_items = mysqli_fetch_array($run_items)) {\n\n $pro_qty = $get_items['qty'];\n if($pro_qty > 1) {\n $count_items = $count_items + $pro_qty - 1;\n }\n }\n }\n\n echo $count_items;\n\n }", "public function totalUniqueItems()\n {\n return $this->totalItems(true);\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function get_cart_contents_count() {\n\t\treturn apply_filters( 'woocommerce_cart_contents_count', array_sum( wp_list_pluck( $this->get_cart(), 'quantity' ) ) );\n\t}", "public function total(): int\n {\n return count($this->all());\n }", "public function cartCountAction()\n\t{\n\t\t$uid = $this->getRequest()->getPost('uid');\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n $count = number_format($rowArray['items_qty'],0);\n $entity_id = $rowArray['entity_id'];\n\n $response = array();\n\n if($count > 0) {\n $response['msg'] = '';\n $response['status'] = 1;\n $response['count'] = $count;\n $response['entity_id'] = $entity_id;\n }\n else{\n $response['msg'] = '';\n $response['status'] = 1;\n $response['count'] = 0;\n $response['entity_id'] = 0;\n }\n\n\t\techo json_encode($response);\n\t}", "public static function getCartTotal(){\n $totalAmount=0;\n $cart = self::getCartContent();\n foreach ($cart as $key => $value) {\n if(is_numeric($value['amount']))\n $totalAmount += $value['amount'];\n }\n return $totalAmount;\n }", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function cartCount()\n {\n if(Auth::check()) //if user is logged in then count number of items in user's cart ofcourse if user has any pending cart.\n {\n $cartCount = Cart::CartCount(Auth::id());\n }\n else //if user is not logged in then get cart count from session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cartCount = $oldCart->totalQty;\n }\n\n return response()->json(['cartCount' => $cartCount]);\n }", "function getCartCount(){\n $count = 0;\n \n foreach($_SESSION[\"cart\"] as $value){\n $count++;\n }\n return $count;\n}", "abstract public function countTotal();", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = $items->sum(function ($item) {\n return $item['quantity'];\n });\n\n return $count;\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "public function countItems();", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }", "public function cart_count() {\n\t\treturn '<span class=\"current-cart-count info badge\">' . wc()->cart->cart_contents_count . '</span>';\n\t}", "public function getTotalItems()\n {\n if ($this->totalItems === null) {\n $this->totalItems = count($this->list ?? []);\n }\n\n return $this->totalItems;\n }", "public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function total_sold()\n\t{\n\t\t$sold = self::$_ci->cart_item_m->count_by(array('status' => 'pg-success'));\n\t\t\n\t\treturn (int) $sold;\n\t\t\n\t}", "public function totalQuantity(): int\n {\n return $this->items->sum(function ($item) {\n return $item->quantity;\n });\n }", "public function getNumTotalItems()\n {\n return $this->numTotalItems;\n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function getTotalSumNbConvertedCarts()\n {\n $nbFlaged = Mage::getModel('abandonment/orderflag')->getResource()\n ->getSumNbConvertedCarts();\n return $nbFlaged;\n }", "public function getTotalItemCount()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public function getTotal():int{\r\n\t return (int)$this->_vars['total_items']??0;\r\n\t}", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function totalAmountOfShops()\n {\n return Shop::getTotalAmountOfShops();\n\n }", "public function getCartTotal()\n {\n }", "public function getTotalAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n }", "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function get_cart_total($id=0) {\n\t\t$query = \"SELECT COUNT(oid) AS numitems FROM orders WHERE oid = ?\";\n\t\t$values = array($id);\n\t\t// numitems is returned in this row_array\n\t\treturn $this->db->query('', array($id))->row_array();\n\t}", "public function getTotal()\n\t{\n\t\t\n\t\treturn count($this->findAll());\n\t}", "function items() {\n\t\n if(isset($_GET['add_cart'])){\n\t\n\t global $db;\n\t \n\t $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); /* Counting how many items user has added to cart*/\n\t }\t\n\t\n\telse \n\t{\n\t global $db;\n\t \n $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); \t \n\t\t\n\t\t\n\t}\n\n\t echo $count_items;\n\t}", "public function getTotalQty()\n {\n $qty = 0;\n foreach ($this->lineItems as $item) {\n $qty += $item->qty;\n }\n\n return $qty;\n }", "public function qty()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->getQty();\n });\n }", "function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}", "public function getInventoryCount()\n {\n return $this->where('quantity', '<>', '0')->get()->fetch('quantity')->sum();\n }", "protected function getTotItems()\n {\n if ($this->exportableHandler !== null) {\n return $this->exportableHandler->getTotItems();\n } else {\n return 0;\n }\n }", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "public function getTotal()\n {\n// $store = $this->getStoreId('getTotal');\n//\n// // Try to load the data from internal storage.\n// if (isset($this->cache[$store]))\n// {\n// return $this->cache[$store];\n// }\n\n // Load the total.\n $query = $this->getItems();\n $total = (int) $this->_getListCount($query);\n\n // Check for a database error.\n if ($this->_db->getErrorNum())\n {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n\n // Add the total to the internal cache.\n// $this->cache[$store] = $total;\n\n return $total;\n }", "function total_items(){\n\n\tif(isset($_GET['add_cart'])){\n\t\tglobal $con;\n\t\t$ip=getIp();\n\n\t\t$get_items = \"select * from cart where ip_add='$ip'\"; //this statement will get the ip address using the getip function above and match it with the database to see if any products are there corresponding to this ip\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items= mysqli_num_rows($run_items);\n\t}\n\t\telse{\n\t\t\t$ip=getIp();\n global $con;\n\t\t$get_items = \"select * from cart where ip_add='$ip'\";//the ip address will have the products that the user added into the cart and show it using this function\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items= mysqli_num_rows($run_items);\n\n\t\t}\n\t\techo $count_items;\n\n}", "function items(){\n\tif(isset($_GET['add_cart'])){\n\t\t\n\t\tglobal $db;\n\t\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\n\t}\n\telse {\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\t\t}\n\t\n\techo $count_items;\n\t\n}", "public function getTotalQuantity()\n {\n $quantity = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $quantity = $quantity + $basketProduct->getQuantity();\n }\n }\n \n return $quantity;\n }", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "public function getTotalSumAmountConvertedCarts()\n {\n $sumAmount = Mage::getModel('abandonment/orderflag')->getResource()->getSumAmountConvertedCarts();\n return $sumAmount;\n }", "function getTotal() {\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}", "public function getItemsCount()\n {\n return count($this->items);\n }", "function total_itineraries()\n\t{\n\t\treturn $this->_tour_cart_contents['total_itineraries'];\n\t}", "function getTotal() {\r\n\t\tif (empty ( $this->_total )) {\r\n\t\t\t$query = $this->_buildQuery ();\r\n\t\t\t$this->_total = $this->_getListCount ( $query );\r\n\t\t}\r\n\t\treturn $this->_total;\r\n\t}" ]
[ "0.8276823", "0.8246973", "0.81573355", "0.8098745", "0.8087005", "0.8017282", "0.7999781", "0.79988486", "0.79161435", "0.7842966", "0.78372025", "0.7836386", "0.7818407", "0.78020567", "0.77706397", "0.7731166", "0.7711051", "0.7702444", "0.7698584", "0.768706", "0.76610065", "0.7630467", "0.76290095", "0.76274925", "0.757641", "0.7575233", "0.75640583", "0.7560964", "0.7560964", "0.7558032", "0.75310344", "0.7445492", "0.7435457", "0.7435457", "0.7435457", "0.74305344", "0.7368915", "0.7347488", "0.73414606", "0.7336563", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.73348296", "0.7334584", "0.7333102", "0.732831", "0.7314045", "0.7311449", "0.7311291", "0.73035794", "0.7291897", "0.72861123", "0.7276886", "0.7264762", "0.7263604", "0.7259655", "0.7254982", "0.7252665", "0.725166", "0.7249219", "0.72477615", "0.72402775", "0.722979", "0.72176445", "0.72063136", "0.72051984", "0.7202722", "0.7186639", "0.7164305", "0.71640086", "0.7156775", "0.71505004", "0.7138838", "0.71295786", "0.7129446", "0.7127228", "0.71068984", "0.7101427", "0.70962375", "0.70945513", "0.70830834", "0.7075323", "0.7064613", "0.7062023", "0.70524186", "0.7049257", "0.7035005", "0.7030868", "0.70289236", "0.70278853", "0.7026894" ]
0.7486349
31
Find all the Resources used
public function findAll() { try { // Create the MySQL Statement $result = $this->conn->prepare("SELECT * FROM `resource`"); $result->execute(); // Check if the Result has any rows if($result->rowCount() >= 1) { // Return the result object // MyLogger2::info("Exit UserDataService.findByUser() with true"); return $result->fetchAll(); } else { // Return the boolean value false if there was no verification // MyLogger2::info("Exit UserDataService.findByUser() with false"); return false; } } catch(DatabaseException $dbe) { /* MyLogger2::error("DatabaseException: ", array( "message" => $e->getMessage() )); */ throw $dbe->getMessage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllResources() {\n\t\t\t$res=array();\n\t\t\t$res=$this->resources;\n\n\t\t\tforeach ($this->categories as $category)\n\t\t\t\t$res=array_merge($res,$category->getAllResources());\n\n\t\t\treturn $res;\n\t\t}", "abstract protected function getResources();", "public function getResources()\n {\n return $this->resources;\n }", "public function getResources()\n {\n return $this->resources;\n }", "public function getResources()\n {\n return $this->resources;\n }", "public function getResources()\n {\n return $this->resources;\n }", "public function getResources(): array {\n\t\tif (is_null($this->resources)) {\n\t\t $this->loadResources();\n\t\t}\n\t\treturn $this->resources;\n\t}", "public function getResourceSets();", "public function findAll() {\r\n\t\t$stmt = $this->db->query(\"SELECT * FROM resources\");\r\n\t\t$resources_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$resources = array();\r\n\r\n\t\tforeach ($resources_db as $resource) {\r\n\t\t\tarray_push($resources, new Resource($resource[\"id\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t$resource[\"nombre\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t$resource[\"aforo\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t$resource[\"descripcion\"]));\r\n\t\t}\r\n\r\n\t\treturn $resources;\r\n\t}", "public function getResources(): array\n {\n return $this->resources;\n }", "protected function getResources()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCES_ARGUMENT_NAME)->getValue();\n\t}", "public function getResources()\n {\n// 18.02.2015 php 5.2\n// $resources = array_map(function ($resource) {\n// return is_array($resource) ? $resource : array($resource);\n// }, $this->getRawResources());\n//\n $resources = array_map(array(\"FikenHal\", \"inner\"), $this->getRawResources());\n\n return $resources;\n }", "public function getRegisteredResources()\n {\n $result = array();\n foreach ($this->getResourcesTypes() as $type) {\n $result[$type] = $this->getRegisteredResourcesByType($type);\n }\n\n return $result;\n }", "function readableResources(){\n\n return $this->resourcesByPermission('read');\n }", "public function resources() {\n $resources = array();\n foreach ($this->relFullOperations() as $op) {\n foreach($op->resources() as $resource) {\n if (!in_array ($resource, $resources, true)) {\n array_push($resources, $resource);\n }\n }\n foreach($op->phaseOperations() as $phase) {\n foreach($phase->resources() as $phase_res) {\n if (!in_array ($phase_res, $resources, false)) {\n array_push($resources, $phase_res);\n }\n }\n }\n }\n return collect($resources);\n }", "public function loadResources() {}", "protected function _initResources () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aResourceListing = $oAclCache->load(self::CACHE_IDENTIFIER_RESOURCES)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Resources from the Database\r\n\t\t\t$oDaoResource = Kwgl_Db_Table::factory('System_Resource'); /* @var $oDaoResource Dao_System_Resource */\r\n\t\t\t//$aResourceListing = $oDaoResource->fetchAll();\r\n\t\t\t$aResourceListing = $oDaoResource->getResources();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aResourceListing, self::CACHE_IDENTIFIER_RESOURCES);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aResourceListing as $aResourceDetail) {\r\n\t\t\t$sResourceName = $aResourceDetail['name'];\r\n\t\t\tif (is_null($aResourceDetail['parent'])) {\r\n\t\t\t\t// Add the Resource if it hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Parent Resource assigned\r\n\t\t\t\t$sResourceParentName = $aResourceDetail['parent'];\r\n\t\t\t\t// Add the Parent Role if the Parent Role hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceParentName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceParentName));\r\n\t\t\t\t}\r\n\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName), $sResourceParentName);\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t}", "public static function get_resources() {\n if (self::$resource_list === NULL) {\n $base = self::$base_url;\n if (!self::$js_path) {\n self::$js_path = $base . 'media/js/';\n }\n elseif (substr(self::$js_path, -1) != \"/\") {\n // Ensure a trailing slash.\n self::$js_path .= \"/\";\n }\n if (!self::$css_path) {\n self::$css_path = $base . 'media/css/';\n }\n elseif (substr(self::$css_path, -1) != '/') {\n // Ensure a trailing slash.\n self::$css_path .= \"/\";\n }\n global $indicia_theme, $indicia_theme_path;\n if (!isset($indicia_theme)) {\n // Use default theme if page does not specify it's own.\n $indicia_theme = 'default';\n }\n if (!isset($indicia_theme_path)) {\n // Use default theme path if page does not specify it's own.\n $indicia_theme_path = preg_replace('/css\\/$/', 'themes/', self::$css_path);\n }\n // Ensure a trailing slash.\n if (substr($indicia_theme_path, -1) !== '/') {\n $indicia_theme_path .= '/';\n }\n self::$resource_list = [\n 'indiciaFns' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"indicia.functions.js\"],\n ],\n 'jquery' => [\n 'javascript' => [\n self::$js_path . 'jquery.js',\n self::$js_path . 'ie_vml_sizzlepatch_2.js',\n ],\n ],\n 'datepicker' => [\n 'deps' => ['jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'indicia.datepicker.js',\n self::$js_path . 'date.polyfill/better-dom/dist/better-dom.min.js',\n self::$js_path . 'date.polyfill/better-dateinput-polyfill/dist/better-dateinput-polyfill.min.js',\n ]\n ],\n 'sortable' => [\n 'javascript' => ['https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.js'],\n ],\n 'openlayers' => [\n 'javascript' => [\n self::$js_path . (function_exists('iform_openlayers_get_file') ? iform_openlayers_get_file() : 'OpenLayers.js'),\n self::$js_path . 'proj4js.js',\n self::$js_path . 'proj4defs.js',\n self::$js_path . 'lang/en.js',\n ],\n ],\n 'graticule' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'indiciaGraticule.js'],\n ],\n 'clearLayer' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'clearLayer.js'],\n ],\n 'hoverControl' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'hoverControl.js'],\n ],\n 'addrowtogrid' => [\n 'deps' => ['validation'],\n 'javascript' => [self::$js_path . \"addRowToGrid.js\"],\n ],\n 'speciesFilterPopup' => [\n 'deps' => ['addrowtogrid'],\n 'javascript' => [self::$js_path . \"speciesFilterPopup.js\"],\n ],\n 'indiciaMapPanel' => [\n 'deps' => ['jquery', 'openlayers', 'jquery_ui', 'jquery_cookie', 'hoverControl'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMapPanel.js\"],\n ],\n 'indiciaMapEdit' => [\n 'deps' => ['indiciaMap'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.js\"],\n ],\n 'postcode_search' => [\n 'javascript' => [self::$js_path . \"postcode_search.js\"],\n ],\n 'locationFinder' => [\n 'deps' => ['indiciaMapEdit'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.locationFinder.js\"],\n ],\n 'createPersonalSites' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"createPersonalSites.js\"],\n ],\n 'autocomplete' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$css_path . \"jquery.autocomplete.css\"],\n 'javascript' => [self::$js_path . \"jquery.autocomplete.js\"],\n ],\n 'addNewTaxon' => [\n 'javascript' => [self::$js_path . \"addNewTaxon.js\"],\n ],\n 'import' => [\n 'javascript' => [self::$js_path . \"import.js\"],\n ],\n 'indicia_locks' => [\n 'deps' => ['jquery_cookie', 'json'],\n 'javascript' => [self::$js_path . \"indicia.locks.js\"],\n ],\n 'jquery_cookie' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.cookie.js\"],\n ],\n 'jquery_ui' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [\n self::$css_path . 'jquery-ui.min.css',\n \"$indicia_theme_path$indicia_theme/jquery-ui.theme.min.css\",\n ],\n 'javascript' => [\n self::$js_path . 'jquery-ui.min.js',\n self::$js_path . 'jquery-ui.effects.js',\n ]\n ],\n 'jquery_ui_fr' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . \"jquery.ui.datepicker-fr.js\"]\n ],\n 'jquery_form' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.form.min.js\"],\n ],\n 'reportPicker' => [\n 'deps' => ['treeview', 'fancybox'],\n 'javascript' => [self::$js_path . \"reportPicker.js\"],\n ],\n 'treeview' => ['deps' => ['jquery'], 'stylesheets' => [self::$css_path.\"jquery.treeview.css\"], 'javascript' => [self::$js_path.\"jquery.treeview.js\"]],\n 'treeview_async' => ['deps' => ['treeview'], 'javascript' => [self::$js_path.\"jquery.treeview.async.js\", self::$js_path.\"jquery.treeview.edit.js\"]],\n 'googlemaps' => [\n 'javascript' => [\"https://maps.google.com/maps/api/js?v=3\" . (empty(self::$google_maps_api_key) ? '' : '&key=' . self::$google_maps_api_key)],\n ],\n 'fancybox' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.css'],\n 'javascript' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.js'],\n ],\n 'treeBrowser' => [\n 'deps' => ['jquery', 'jquery_ui'],\n 'javascript' => [self::$js_path . 'jquery.treebrowser.js']\n ],\n 'defaultStylesheet' => [\n 'deps' => [''],\n 'stylesheets' => [\n self::$css_path . 'default_site.css',\n self::$css_path . 'theme-generic.css'\n ],\n 'javascript' => []\n ],\n 'validation' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jquery.metadata.js',\n self::$js_path . 'jquery.validate.js',\n self::$js_path . 'additional-methods.js',\n ],\n ],\n 'plupload' => [\n 'deps' => ['jquery_ui', 'fancybox'],\n 'javascript' => [\n self::$js_path . 'jquery.uploader.js',\n self::$js_path . 'plupload/js/plupload.full.min.js',\n ]\n ],\n 'uploader' => [\n 'deps' => ['jquery', 'dmUploader'],\n 'javascript' => [\n self::$js_path . 'uploader.js',\n ],\n ],\n 'dmUploader' => [\n 'stylesheets' => [\n self::$js_path . 'uploader/dist/css/jquery.dm-uploader.min.css',\n ],\n 'javascript' => [\n self::$js_path . 'uploader/dist/js/jquery.dm-uploader.min.js',\n ]\n ],\n 'jqplot' => [\n 'stylesheets' => [self::$js_path . 'jqplot/jquery.jqplot.min.css'],\n 'javascript' => [\n self::$js_path . 'jqplot/jquery.jqplot.min.js',\n '[IE]' . self::$js_path . 'jqplot/excanvas.js'\n ],\n ],\n 'jqplot_bar' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.barRenderer.js',\n ],\n ],\n 'jqplot_pie' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.pieRenderer.js',\n ],\n ],\n 'jqplot_category_axis_renderer' => [\n 'javascript' => [self::$js_path . 'jqplot/plugins/jqplot.categoryAxisRenderer.js'],\n ],\n 'jqplot_canvas_axis_label_renderer' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.canvasTextRenderer.js',\n self::$js_path . 'jqplot/plugins/jqplot.canvasAxisLabelRenderer.js',\n ],\n ],\n 'jqplot_trendline' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.trendline.js',\n ],\n ],\n 'reportgrid' => [\n 'deps' => ['jquery_ui', 'jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'jquery.reportgrid.js',\n ]\n ],\n 'reportfilters' => [\n 'deps' => ['reportgrid'],\n 'stylesheets' => [self::$css_path . 'report-filters.css'],\n 'javascript' => [self::$js_path . 'reportFilters.js'],\n ],\n 'tabs' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . 'tabs.js'],\n ],\n 'wizardprogress' => [\n 'deps' => ['tabs'],\n 'stylesheets' => [self::$css_path . 'wizard_progress.css']\n ],\n 'spatialReports' => [\n 'javascript' => [self::$js_path . 'spatialReports.js'],\n ],\n 'jsonwidget' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jsonwidget/jsonedit.js',\n self::$js_path . 'jquery.jsonwidget.js',\n ],\n 'stylesheets' => [self::$css_path . 'jsonwidget.css'],\n ],\n 'timeentry' => [\n 'javascript' => [self::$js_path . 'jquery.timeentry.min.js'],\n ],\n 'verification' => [\n 'javascript' => [self::$js_path . 'verification.js'],\n ],\n 'control_speciesmap_controls' => [\n 'deps' => [\n 'jquery',\n 'openlayers',\n 'addrowtogrid',\n 'validation',\n ],\n 'javascript' => [\n self::$js_path . 'controls/speciesmap_controls.js',\n ],\n ],\n 'complexAttrGrid' => [\n 'javascript' => [self::$js_path . 'complexAttrGrid.js'],\n ],\n 'footable' => [\n 'stylesheets' => [self::$js_path . 'footable/css/footable.core.min.css'],\n // Note, the minified version not used as it does not contain bugfixes.\n // 'javascript' => [self::$js_path.'footable/dist/footable.min.js']\n 'javascript' => [self::$js_path . 'footable/js/footable.js'],\n 'deps' => ['jquery'],\n ],\n 'footableSort' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.sort.min.js'],\n 'deps' => ['footable'],\n ],\n 'footableFilter' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.filter.min.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableReport' => [\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableReport.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableChecklist' => [\n 'stylesheets' => [self::$css_path . 'jquery.indiciaFootableChecklist.css'],\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableChecklist.js'],\n 'deps' => ['footable']\n ],\n 'html2pdf' => [\n 'javascript' => [\n self::$js_path . 'html2pdf/dist/html2pdf.bundle.min.js',\n ],\n ],\n 'review_input' => [\n 'javascript' => [self::$js_path . 'jquery.reviewInput.js'],\n ],\n 'sub_list' => [\n 'javascript' => [self::$js_path . 'sub_list.js'],\n ],\n 'georeference_default_geoportal_lu' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/geoportal_lu.js'],\n ],\n 'georeference_default_nominatim' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/nominatim.js'],\n ],\n 'georeference_default_google_places' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/google_places.js'],\n ],\n 'georeference_default_indicia_locations' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/indicia_locations.js'],\n ],\n 'sref_handlers_2169' => [\n 'javascript' => [self::$js_path . 'drivers/sref/2169.js'],\n ],\n 'sref_handlers_4326' => [\n 'javascript' => [self::$js_path . 'drivers/sref/4326.js'],\n ],\n 'sref_handlers_osgb' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osgb.js'],\n ],\n 'sref_handlers_osie' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osie.js'],\n ],\n 'font_awesome' => [\n 'stylesheets' => ['https://use.fontawesome.com/releases/v5.15.4/css/all.css']\n ],\n 'leaflet' => [\n 'stylesheets' => ['https://unpkg.com/[email protected]/dist/leaflet.css'],\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/leaflet.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket.min.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket-leaflet.min.js',\n self::$js_path . 'leaflet.heat/dist/leaflet-heat.js',\n ],\n ],\n 'leaflet_google' => [\n 'deps' => [\n 'googlemaps'\n ],\n 'javascript' => [\n 'https://unpkg.com/leaflet.gridlayer.googlemutant@latest/dist/Leaflet.GoogleMutant.js',\n ],\n ],\n 'datacomponents' => [\n 'deps' => [\n 'font_awesome',\n 'indiciaFootableReport',\n 'jquery_cookie',\n ],\n 'javascript' => [\n self::$js_path . 'indicia.datacomponents/idc.core.js',\n self::$js_path . 'indicia.datacomponents/idc.controlLayout.js',\n self::$js_path . 'indicia.datacomponents/idc.esDataSource.js',\n self::$js_path . 'indicia.datacomponents/idc.pager.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.customScript.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.runCustomVerificationRulesets.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.cardGallery.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.dataGrid.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.esDownload.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.leafletMap.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordsMover.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordDetailsPane.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.templatedOutput.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.verificationButtons.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.filterSummary.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.permissionFilters.js',\n 'https://unpkg.com/@ungap/url-search-params',\n ],\n ],\n 'file_classifier' => [\n 'deps' => [\n 'plupload',\n 'jquery_ui',\n ],\n 'javascript' => [\n self::$js_path . 'jquery.fileClassifier.js',\n ],\n ],\n 'brc_atlas' => [\n 'deps' => [\n 'd3',\n 'bigr',\n 'leaflet',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.min.js',\n ],\n ],\n 'brc_charts' => [\n 'deps' => [\n 'd3',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.min.js',\n ],\n ],\n 'd3' => [\n 'javascript' => [\n 'https://d3js.org/d3.v5.min.js',\n ],\n ],\n 'bigr' => [\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/bigr.min.umd.js',\n ],\n ],\n ];\n }\n return self::$resource_list;\n }", "public function getResources()\n {\n $allResources = [];\n\n /** @var ResourceProviderInterface $resourceProvider */\n foreach ($this->resourceProviders as $resourceProvider) {\n $providerId = $resourceProvider->getProviderId();\n $resources = $this->cache->getProviderResources($providerId);\n if ($resources === null) {\n $resources = $resourceProvider->getResources();\n foreach ($resources as $key => $resourceData) {\n $resource = $this->aclResourceBuilder->build($resourceData);\n // @todo Not required\n $resource->setProviderId($providerId);\n $this->cache->set($resource);\n $resources[$key] = $resource;\n }\n $this->cache->setProviderResources($providerId, $resources);\n }\n\n $allResources = array_merge($allResources, $resources);\n }\n\n return $allResources;\n }", "public function resources()\n {\n foreach ($this->index as $subject => $properties) {\n if (!isset($this->resources[$subject])) {\n $this->resource($subject);\n }\n }\n\n foreach ($this->revIndex as $object => $properties) {\n if (!isset($this->resources[$object])) {\n $this->resource($object);\n }\n }\n\n return $this->resources;\n }", "public function useful_resources(){\r\n\t\t\r\n\t\t/* Get model */\r\n\t\t$itemsModel = $this->getModel('items');\r\n\t\t$itemsModel->set('category', $this->get('category'));\r\n\t\t\r\n\t\t/* Get data */\r\n\t\t$resources = $itemsModel->getResources();\r\n\t\t\r\n\t\t/* No data? */\r\n\t\tif (!DEBUG && !Utility::iterable($resources)){\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\t/* Load template */\r\n\t\tinclude(BLUPATH_TEMPLATES.'/site/modules/useful_resources.php');\r\n\t\t\r\n\t}", "public function getResourceList()\n {\n $data = array();\n $resources = Kronolith::getDriver('Resource')\n ->listResources(Horde_Perms::READ, array(), 'name');\n foreach ($resources as $resource) {\n $data[] = $resource->toJson();\n }\n\n return $data;\n }", "public function getResources(): ?array\n {\n return collect(Filament::getResources())\n ->unique()\n ->filter(function ($resource) {\n if (Utils::isGeneralExcludeEnabled()) {\n return ! in_array(\n Str::of($resource)->afterLast('\\\\'),\n Utils::getExcludedResouces()\n );\n }\n\n return true;\n })\n ->reduce(function ($resources, $resource) {\n $name = $this->getPermissionIdentifier($resource);\n\n $resources[\"{$name}\"] = [\n 'resource' => \"{$name}\",\n 'model' => Str::of($resource::getModel())->afterLast('\\\\'),\n 'fqcn' => $resource,\n ];\n\n return $resources;\n }, collect())\n ->sortKeys()\n ->toArray();\n }", "public static function bkap_get_all_resources() {\n\t\t\n\t\t$args \t\t\t\t= array('post_type' => 'bkap_resource','posts_per_page'=> -1,);\n\t\t$resources \t\t\t= get_posts( $args );\t\t\n\t\t\n\t\treturn $resources;\n\t}", "function scf_resources_dir() {\n $res_modules = array('gene', 'antibody', 'modelorganism', 'researchstatement');\n\n $nodes = array();\n $pagers = array();\n\n $elt = 0;\n foreach ($res_modules as $mod) {\n if (module_exists($mod)) {\n list($n, $pager) = module_invoke($mod, 'load_recent_nodes', 5, $elt++);\n $nodes[$mod] = $n;\n $pagers[$mod] = $pager;\n }\n }\n\n return theme('bio_resources', $nodes, $pagers);\n}", "public function loadResources(): void {\n\t\t$sql = \"SELECT * FROM `npc_resource` WHERE `id_npc` = ?\";\n\t\t$this->db->query($sql, [$this->get('id')]);\n\t\t$resources = [];\n\t\twhile ($res = $this->db->next()) {\n\t\t\t$npc_resource = new NPCResource();\n\t\t\t$npc_resource->update($res);\n\t\t\t$npc_resource->loadResource($this->get('margin'));\n\n\t\t\tarray_push($resources, $npc_resource);\n\t\t}\n\t\t$this->setResources($resources);\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 getResources($inherited = true, $create = false, $entryKey = null) {}", "public function getResourceURIs()\n {\n $resources = array();\n\n $resources['logo'] = $this->getUrl('/resources/logo.png');//URI\n $resources['requestHandlerUrl'] = $this->getUrl('requestHandler.php');//URI //TODO: this should be an API URI (not sure if that will break something)\n $resources['self_apiUrl'] = self::$apiUrl;//URI\n\n return $resources;\n }", "public function getResourceTypeIds();", "public function getRawResources()\n {\n return $this->resources;\n }", "public function checkResources()\n {\n if (empty($GLOBALS['conf']['resource']['driver'])) {\n return array();\n }\n\n if ($this->vars->i) {\n $event = $this->_getDriver($this->vars->c)->getEvent($this->vars->i);\n } else {\n $event = Kronolith::getDriver()->getEvent();\n }\n // Overrite start/end times since we may be checking before we edit\n // an existing event with new times.\n $event->start = new Horde_Date($this->vars->s);\n $event->end = new Horde_Date($this->vars->e);\n $event->start->setTimezone(date_default_timezone_get());\n $event->end->setTimezone(date_default_timezone_get());\n $results = array();\n foreach (explode(',', $this->vars->r) as $id) {\n $resource = Kronolith::getDriver('Resource')->getResource($id);\n $results[$id] = $resource->getResponse($event);\n }\n\n return $results;\n }", "public function findAllLoaded() {}", "function SI_getResources() {\n\tglobal $SI_tables, $SI_display;\n\t\n\t$query = \"SELECT resource, referer, COUNT(resource) AS 'requests' \n\t\t\t FROM $SI_tables[stats]\n\t\t\t WHERE \n\t\t\t resource NOT LIKE '%/inc/%' \n\t\t\t GROUP BY resource\n\t\t\t ORDER BY requests DESC \n\t\t\t LIMIT 0,36\";\n\t\n\tif ($result = mysql_query($query)) {\n\t\t$ul = \"<table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t\t$ul .= \"\\t<tr><th>Resource</th><th class=\\\"last\\\">Requests</th></tr>\\n\";\n\t\twhile ($r = mysql_fetch_array($result)) {\n\t\t\t$resource = ($r['resource']==\"/\")?$SI_display[\"siteshort\"]:SI_truncate($r['resource'],24);\n\t\t\t$referer = (!empty($r['referer']))?$r['referer']:'No referrer';\n\t\t\t$ul .= \"\\t<tr><td><a href=\\\"http://\".SI_trimReferer($_SERVER['SERVER_NAME']).\"$r[resource]\\\" title=\\\"$referer\\\">\".$resource.\"</a></td><td class=\\\"last\\\">$r[requests]</td></tr>\\n\";\n\t\t\t}\n\t\t$ul .= \"</table>\";\n\t\t}\n\treturn $ul;\n\t}", "public function getResources($key=null)\n {\n return $this->retrieve('resources', $key);\n }", "function getResources($type){\n\t\t$return = array (\n\t\t\t\t'error' => false,\n\t\t\t\t'message' => ''\n\t\t\t);\n\t\t$db = New Database();\n\t\t$db->connect();\n\t\t$sql = \"SELECT * FROM resources WHERE resource_type = '$type' AND resource_id IN (SELECT resource_id FROM user_resources WHERE user_id = '\".$_SESSION['user_id'].\"') ORDER BY created_on ASC\";\n\t\t$result = $db->query($sql);\n\t\tif(mysqli_num_rows($result['result']) == 0){\n\t\t\t$return['error'] = true;\n\t\t\t$return['message'] = \"No Resources available\";\n\t\t}else {\n\t\t\treturn $result;\n\t\t} \n\t\treturn $return;\n\t}", "function _resource_list($resource){\n\t_resource_list_offset($resource, '1', '20');\n}", "public function getResources()\n {\n $this->_limit = $this->getProperty('limit', 100);\n $this->_offset = $this->getProperty('offset', 0);\n $c = $this->modx->newQuery('modResource');\n\n $conditions = [\n 'modResource.id = sfUrls.page_id'\n ];\n if (!$this->indexSeoEmpty) {\n $conditions[] = 'sfUrls.total > 0';\n }\n if (!empty($this->indexSeoRules)) {\n $excludeSeoRules = array_map('abs', array_filter($this->indexSeoRules, function ($val) {\n return (int)$val < 0;\n }));\n $includeSeoRules = array_map('abs', array_filter($this->indexSeoRules, function ($val) {\n return (int)$val > 0;\n }));\n if (!empty($excludeSeoRules)) {\n $conditions[] = 'sfUrls.multi_id NOT IN ('.implode(',', $excludeSeoRules).')';\n }\n if (!empty($includeSeoRules)) {\n $conditions[] = 'sfUrls.multi_id IN ('.implode(',', $includeSeoRules).')';\n }\n }\n $c->leftJoin('sfUrls', 'sfUrls', $conditions);\n $c->leftJoin('sfRule', 'sfRule', 'sfRule.id = sfUrls.multi_id');\n $c->select($this->modx->getSelectColumns('modResource', 'modResource', '', $this->resourceFields));\n $c->select($this->modx->getSelectColumns('sfUrls', 'sfUrls', 'seo_', $this->seoFields));\n $c->select($this->modx->getSelectColumns('sfRule', 'sfRule', 'rule_', $this->ruleFields));\n $c->groupby('modResource.id, sfUrls.id');\n $c->sortby('modResource.id', 'ASC');\n $c->sortby('sfUrls.id', 'ASC');\n $c = $this->prepareQuery($c);\n $this->_total = $this->modx->getCount('modResource', $c);\n $c->limit($this->_limit, $this->_offset);\n $collection = [];\n if ($c->prepare() && $c->stmt->execute()) {\n $collection = $c->stmt->fetchAll(PDO::FETCH_ASSOC);\n } else {\n $this->modx->log(modX::LOG_LEVEL_ERROR,\n '[mSearch2] Could not retrieve collection of resources: '.$c->stmt->errorInfo());\n }\n\n return $collection;\n }", "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}", "private function getUserResources()\n {\n $result = array();\n $userdata = $this->get('security.context')->getToken()->getUser();\n $groups = $userdata->getUserGroups()->toArray();\n foreach ($groups as $grp) {\n $resources = $grp->getResources();\n foreach ($resources as $res) {\n $result[$res->getId()] = $res->getName();\n }\n }\n\n return $result;\n }", "protected function makeResourcesCollection()\n {\n return collect($this->load())->map(function ($item, $key) {\n $item['slug'] = $key;\n\n $item['name'] = Str::studly($key);\n\n $item['is_global'] = (isset($item['is_global']) && $item['is_global']);\n\n return $item;\n });\n }", "public function getResources($where = null)\n {\n $values = [];\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n $stmt = $this->db->prepare('select * from resources ' . $cond);\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get resources list.'), E_APP_GET_RESOURCES);\n }\n\n $rows = [];\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $e['id'] = intval($e['id']);\n $rows[] = $e;\n }\n\n return $rows;\n }", "public function recurs(){\r\n\t\t$stmt = $this->db->query(\"SELECT * FROM resources\");\r\n\t\t$recursos_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$recursos = array();\r\n\r\n\t\tforeach($recursos_db as $recurso_db){\r\n\t\t\tarray_push($recursos, new Resource($recurso_db[\"id\"], $recurso_db[\"nombre\"]));\r\n\t\t}\r\n\r\n\t\treturn $recursos;\r\n\t}", "public static function availableObjects() {\n\t\treturn self::$registeredObjects;\n\t}", "private function resource_type_list() {\n\n\t\t$this->load_site_settings();\n\n\t\tif($this->res_list != false) {\n\t\t\treturn $this->res_list;\n\t\t}\n\n\t\tif(is_array($this->settings['eeck_resourcetypes'])) {\n\t\t\t$this->res_list = array();\n\n\t\t\tforeach($this->settings['eeck_resourcetypes'] as $res) {\n\t\t\t\t$this->res_list[] = $res['name'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->res_list;\n\t}", "public function getResourceSet()\r\n {\r\n return $this->_resourceSet;\r\n }", "public static function getCurrentAclResources()\n {\n return self::$currentAclResources;\n }", "public function getAclResources()\n {\n $resources = $this->aclResourceProvider->getAclResources();\n\n if (isset($resources[self::MAGIC_INDEX_WHERE_RESOURCES_ARE]['children'])) {\n return $resources[self::MAGIC_INDEX_WHERE_RESOURCES_ARE]['children'];\n } else {\n // give up, you don't know where it's at now.\n return [];\n }\n }", "private function getAclResources()\n {\n if ($this->aclResources !== null) {\n return $this->aclResources;\n }\n $aclFiles = Files::init()->getConfigFiles('acl.xml', []);\n $xmlResources = [];\n array_map(function ($file) use (&$xmlResources) {\n $config = simplexml_load_file($file[0]);\n $nodes = $config->xpath('.//resource/@id') ?: [];\n foreach ($nodes as $node) {\n $xmlResources[(string)$node] = $node;\n }\n }, $aclFiles);\n $this->aclResources = $xmlResources;\n return $this->aclResources;\n }", "public static function getAll() {}", "static public function getThemeResourceTypes();", "function getAvailableResources($type)\n\t {\n\t \trequire_once('./modules/mysql_connect.php');\n\t \t$resources = new MyCollection();\n\t\t\n\t\t// check all the resources for this time and find out how many of each are being used\n\t\t$q = \"select d.id, d.name, d.price, d.total, count(a.id) as used from resource_descriptions as d left join resources_used as u on d.id=u.description_id left join appointments as a on a.id=u.apt_id and ('$this->startDate'>=start_time and '$this->startDate'<end_time or '$this->endDate'>start_time and '$this->endDate'<=end_time) where d.type='$type' group by d.id;\";\n\t\t\n\t\t$result = @mysql_query($q);\t\t\t\t\n\t\t$i=0;\n\t\twhile($availableResource = @mysql_fetch_assoc($result)) {\n\t\t\t// if the number being used at this time exceeds the total number of that resource, don't add it\t\n\t\t\tif($availableResource['used']<$availableResource['total']) {\n\t\t\t\t$i++;\t\n\t\t\t\t$usedResource = new UsedResource($availableResource['id'], $availableResource['name'], $availableResource['price'], $availableResource['total'], $availableResource['used']);\n\t\t\t\t$resources->add($usedResource);\n\t\t\t}\n\t\t}\n\t\tif($i==0)\n\t\t\treturn null;\n\t\telse return $resources;\n\t }", "public function loadResources()\n {\n $resources = Resource::query();\n\n return Datatables::of($resources)\n ->editColumn('file', function(Resource $resource) {\n return '<a href=\"'.route('get.resource', $resource->file).'\" />'.$resource->file.'</a>';\n })\n ->addColumn('action', function (Resource $resource) {\n return '<a class=\"btn btn-info btn-sm\" href=\"'.route('admin.resources.edit', $resource->id).'\"> <i class=\"fas fa-fw fa-pencil-alt\"></i>Edit</a>\n <button class=\"btn btn-danger btn-sm delete-resource\" data-remote=\"'.route('admin.resources.destroy', $resource->id).'\"> <i class=\"fas fa-fw fa-trash-alt\"></i>Delete</button>';\n })\n ->rawColumns(['action','file'])\n ->make(true);\n }", "function Assets() {\r\n\t\t\treturn $this->QueryPublic( 'Assets' );\r\n\t\t}", "public function add_resources()\n\t{\n\t\t\n\t}", "public function get_requestable_resources() {\n $sql = 'SELECT id, name\n FROM resource_types\n LEFT JOIN (SELECT resource_type_id, COUNT(*) AS c\n FROM resources\n WHERE is_allocated = 1\n GROUP BY resource_type_id)\n resource_join ON (resource_types.id = resource_join.resource_type_id)\n WHERE (resource_types.maximum > resource_join.c OR c IS NULL)\n ORDER BY name';\n\n $resources = [];\n foreach ($this->pdo->query($sql) as $row) {\n $resources[] = [\n 'id' => $row['id'],\n 'name' => $row['name'],\n ];\n }\n\n return $resources;\n }", "public function all(): array\n {\n $data = $this->dot->all();\n\n $result = [];\n foreach ($data as $k => $row) {\n $result[$k] = new Resource($row);\n }\n\n return $result;\n }", "public static function bkap_get_resource_ids() {\n\t\t\n\t\t$all_resource_ids \t= array();\n\t\t$args \t\t\t\t= array('post_type' => 'bkap_resource','posts_per_page'=> -1,);\n\t\t$resources \t\t\t= get_posts( $args );\n\t\t\n\t\tif( count( $resources ) > 0 ){\n\t\t\tforeach ( $resources as $key => $value ) {\n\t\t\t\t$all_resource_ids[] = $value->ID;\n\t\t\t}\n\t\t}\n\t\treturn $all_resource_ids;\n\t}", "protected function initResources()\n {\n $chain = $this->_config->configChain();\n // Remove default config\n $default = array_pop($chain);\n $default = $default['directories'];\n $namespaces = array_keys($chain);\n Utils_ResourceLocator::setResourcesConfig($default, $namespaces);\n }", "private static function initializeResources()\n {\n if (self::$initialized) {\n return;\n }\n\n Resource::init();\n\n Resources\\User::init();\n Resources\\Application::init();\n Resources\\Identity::init();\n Resources\\Processor::init();\n Resources\\Merchant::init();\n Resources\\PaymentInstrument::init();\n Resources\\PaymentCard::init();\n Resources\\BankAccount::init();\n Resources\\Authorization::init();\n Resources\\Transfer::init();\n Resources\\Reversal::init();\n Resources\\Dispute::init();\n Resources\\Webhook::init();\n Resources\\Settlement::init();\n Resources\\Verification::init();\n Resources\\Evidence::init();\n Resources\\Token::init();\n Resources\\InstrumentUpdate::init();\n\n self::$initialized = true;\n }", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "public function getResourceType() {}", "function searchResources( $q )\n {\n try\n {\n $params = ( is_array($q) && isset($q['q']) ) ? $q : array( 'q' => $q );\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources.json\",$params);\n return $this->createResponse($result,'search Resources','Search Criteria');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function resources()\n {\n return $this->belongsToMany(\\Hydrofon\\Resource::class)\n ->orderBy('name');\n }", "protected function getGetImgResourceHookObjects() {}", "public static function getAllResources($type){\n\t\t$template = themesDB::getThemeName();\n\t\t$folder = TEMPLATES_PATH.$template.'/'.$type.'/';\n\t\t$typePom = explode('_',$type);\n\t\t$files = baseFile::getFilesList($folder,$typePom[0]);\t\n\t\t$finalArr = array();\n\t\tforeach ($files as $file){\n\t\t\tif (preg_match('/main.css/', $file->path) or preg_match('/main.js/', $file->path) or preg_match('/less.css/', $file->path)) {\n\t\t\t\t$main[] = $file->path;\n\t\t\t}else{\n\t\t\t\t$finalArr[] = $file->path;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (is_array($main) and is_array($finalArr)) {\n\t\t\t$finalArr = array_merge($finalArr,$main);\n\t\t}elseif (is_array($main)){\n\t\t\t$finalArr = $main;\n\t\t}\n\n\t\treturn $finalArr;\n\t}", "public function get_assets_all()\n {\n return $this->assets;\n }", "public final function get_all()\n {\n }", "public static function allBundles(): Collection;", "public function getDotmailerResources();", "private function packResources()\n {\n $resources = include_once __DIR__ . '/elements/resources.php';\n if (!is_array($resources)) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'Cannot build resources');\n } else {\n foreach ($resources as $resource) {\n $this->builder->putVehicle($this->builder->createVehicle($resource, [\n xPDOTransport::UNIQUE_KEY => 'id',\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true\n ]));\n }\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($resources) . ' resources.');\n }\n }", "public static function getAll();", "public static function getAll();", "public function getResourceType();", "public function getResourceType();", "public function getResourceType();", "public function getResourceType();", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function getExpandResources()\n {\n return $this->expand_resources;\n }", "public function all()\n {\n return $this->resource::collection(\n $this->repository->all()\n );\n }", "function resources() {\n\t\t$t_font_family = config_get('font_family', null, null, ALL_PROJECTS);\n\n\t\tif (isset($this->fonts[$t_font_family])) {\n\t\t\t$spec\t= $this->fonts[$t_font_family];\n\t\t\t$url\t= \"https://fonts.googleapis.com/css2?family={$spec}&display=swap\";\n\n\t\t\tprintf('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" crossorigin=\"anonymous\" />', htmlspecialchars($url));\n\t\t}\n\t}", "public function getRegisteredResourcesByType($type)\n {\n $result = array();\n foreach ($this->getPreparedResources() as $subresources) {\n if (!empty($subresources[$type])) {\n foreach ($subresources[$type] as $path => $file) {\n if (isset($result[$path])) {\n unset($result[$path]);\n }\n $result[$path] = $file;\n }\n }\n }\n\n return $result;\n }", "public function all()\r\n {\r\n return $this->themes;\r\n }", "public function resourcesProvider()\n {\n return [\n 'roles' => [\n 'roles',\n ['name', 'description', 'unchangeable'],\n ],\n 'applications' => [\n 'applications',\n ['api_key', 'name', 'description'],\n ],\n ];\n }", "function testPropertyResourcesFind() {\n\t\t// initialize the factory\n\t\t$factory = new TechDivision_Resources_PropertyResourcesFactory();\n\t\t// load the resources\n\t\t$propertyResources = $factory->getResources(\n\t\t new TechDivision_Lang_String('TestResources'),\n\t\t new TechDivision_Lang_String(\n\t\t \t'TechDivision/Resources/data/testresources'\n\t\t )\n\t\t);\n\t\t// check the correct values to load\n\t\t$this->assertEquals(\n\t\t\t\"Testwert\",\n\t\t $propertyResources->find(\n\t\t \t\"test.key\",\n\t\t TechDivision_Util_SystemLocale::create(\n\t\t TechDivision_Util_SystemLocale::GERMANY)\n\t\t )\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t\"Testvalue\",\n\t\t $propertyResources->find(\n\t\t \t\"test.key\",\n\t\t TechDivision_Util_SystemLocale::create(\n\t\t TechDivision_Util_SystemLocale::US\n\t\t )\n\t\t )\n\t\t);\n\t\t// release the resources\n\t\t$factory->release();\n\t}", "public function getResources($icid) {\n $result = $this->connector->run(\"MATCH (:Identity {id: '{$icid}'})-[:RRELATION]->(r:Resource)\n return r.id as id, r.title as title, r.href as href order by r.title\");\n $resources = [];\n\n foreach ($result->getRecords() as $record) {\n $id = $record->get('id');\n $title = $record->get('title');\n $href = $record->get('href');\n $resources[] = [\"id\" => $id, \"title\" => $title, \"href\" => $href];\n }\n return $resources;\n }", "public function getResources(string $type) : array {\n if(isset($this->resources[$type])) {\n return $this->resources[$type];\n }\n return array();\n }", "public static function loadAll();", "static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}", "static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}", "static function findAll() {$finder = self::getFinder( __CLASS__ ); return $finder->findAll();}", "function creatableResources(){\n\n return $this->resourcesByPermission('create');\n }", "public function myResources()\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $data['resources'] = $this->resourceRepository->getResourcesByUserId($currentUser['id']);\n return APIHandler::response(1, \"My Resources\", $data);\n }", "public static function getAll () {\n\t\treturn self::$registered;\n\t}", "function Define_Resources() : void\n {\n for($i = 0;$i < count($this->Scripts);$i++)\n {\n if($this->Scripts[$i] instanceof stdClass)\n {\n wp_enqueue_script($this->Scripts[$i]->Handle,$this->Scripts[$i]->Src,$this->Scripts[$i]->Deps,$this->Scripts[$i]->Ver,$this->Scripts[$i]->InFooter);\n }\n }\n for($i = 0;$i < count($this->Styles);$i++)\n {\n if($this->Styles[$i] instanceof stdClass)\n {\n wp_enqueue_style($this->Styles[$i]->Handle,$this->Styles[$i]->Src,$this->Styles[$i]->Deps,$this->Styles[$i]->Ver,$this->Styles[$i]->Media);\n }\n }\n }" ]
[ "0.6978817", "0.69781786", "0.6936818", "0.6936818", "0.6936818", "0.6936818", "0.6859763", "0.68049616", "0.67791265", "0.6761215", "0.6751364", "0.6675676", "0.65873057", "0.6580867", "0.65629035", "0.64078796", "0.63622993", "0.6342821", "0.6325454", "0.63215613", "0.6290277", "0.62736547", "0.62206674", "0.6161539", "0.6142668", "0.6137225", "0.6126565", "0.6120213", "0.6107332", "0.6027625", "0.60234845", "0.60163903", "0.60162777", "0.6003075", "0.59917337", "0.59623", "0.5957704", "0.59460634", "0.5940841", "0.59324056", "0.5919376", "0.58882517", "0.58831346", "0.5861605", "0.5853773", "0.58331186", "0.58283395", "0.5815474", "0.5810772", "0.578832", "0.5784483", "0.57694113", "0.5754576", "0.57252187", "0.57079047", "0.5707", "0.569096", "0.5686149", "0.568515", "0.5685055", "0.56737775", "0.56737775", "0.56737775", "0.56737775", "0.56737775", "0.56737775", "0.56737775", "0.56737775", "0.5671171", "0.56536716", "0.5651418", "0.56482714", "0.5646803", "0.5624746", "0.5619132", "0.56096387", "0.5600083", "0.55922526", "0.55922526", "0.5574553", "0.5574553", "0.5574553", "0.5574553", "0.5573814", "0.55706024", "0.5569625", "0.55433035", "0.5542779", "0.5540302", "0.553183", "0.55206555", "0.55190974", "0.5514759", "0.55116117", "0.55080944", "0.55080944", "0.55080944", "0.54927003", "0.54854286", "0.5479524", "0.5478304" ]
0.0
-1
Before action instructions for to do before call actions
public function beforeAction($action) { if ($this->checkBadAccess($action->id)) { return $this->redirect(['/']); } $bitacora = new Bitacora(); $bitacora->register( Yii::t( 'app', 'showing the view' ), 'beforeAction', MSG_INFO ); return parent::beforeAction($action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeAction () {\n\t}", "protected function before(){}", "protected abstract function before();", "abstract protected function before();", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "protected function _before()\n\t{\n\t\t\n\t}", "protected function beforeAction() {\n\n }", "public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}", "public function preAction()\n {\n }", "abstract function before();", "public function preAction()\n {\n // Nothing to do\n }", "public function preAction() {\n\n }", "public function before()\n\t{\n\t}", "public static function _before() : void {\n\t}", "public function before_run(){}", "protected function _before()\n {\n }", "public function before() {}", "public function before() {}", "protected function before()\n {\n }", "public function _before()\n {\n }", "private function before_execute()\n {\n }", "protected function before(): void\n {\n }", "public function before_run() {}", "protected function before() {\n }", "protected function beforeProcess() {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "protected function before() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "public function before()\n {\n parent::before();\n\n // Get the HTTP status code\n $action = $this->request->action();\n\n if ($this->request->is_initial())\n {\n // This controller happens to exist, but lets pretent it does not\n $this->request->action($action = 404);\n }\n else if ( ! method_exists($this, 'action_'.$action))\n {\n // Return headers only\n $this->request->action('empty');\n }\n\n // Set the HTTP status code\n $this->response->status($action);\n }", "public function before( $action_name = false ) {\n\n\t\t$this->do_appropriate_action( $action_name, 'before' );\n\n\t}", "function before() {\n\t\tparent::before();\n\t\t$this->_activity_result[] = $this->request->param(\"id\");\n\t}", "public function beforeAction( $request )\r\n\t\t{\r\n\r\n\t\t}", "abstract protected function beforeRun($data);", "public function before()\n\t{\n\t\tif ($this->request->action === 'login' OR $this->request->action === 'logout')\n\t\t{\n\t\t\t$this->requires_login = FALSE;\n\t\t}\n\t}", "public function beforeAction($action){\n\t\treturn parent::beforeAction($action);\n\t}", "public function setup_actions() {}", "protected function beforeMethod()\n {\n }", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "public function before()\n {\n }", "function before_enable() { }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n }\n }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n } \n }", "public function before()\n\t{\n\t\t// Check method Support\n\t\tif ( ! isset($this->_method_map[$this->request->method()]))\n\t\t\tthrow HTTP_Exception::factory(405)->allowed($this->_method_map);\n\n\t\t// Generate the action name based on the HTTP Method of the request, and a supplied action\n\t\t$action_name = ($this->request->action() === 'index')\n\t\t\t? Arr::get($this->_method_map, $this->request->method())\n\t\t\t: Arr::get($this->_method_map, $this->request->method()).'_'.$this->request->action();\n\n\n\t\t$this->request->action($action_name);\n\t}", "protected function beforeDoAction() {\n return true;\n }", "public function before()\n\t{\n\t\tif ($this->request->is_initial())\n\t\t{\n\t\t\t$this->request->action(404);\n\t\t}\n\t\t\n\t\treturn parent::before();\n\t}", "protected function before(){\n\n }", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "public function beforeStart()\n {\n }", "public function preExecute(){\n\n\t\n\t}", "protected function __preAction($action, &$params)\n {\n }", "public function beforeSetup()\n {\n }", "public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}", "public function preDispatch();", "public function beforeStart () {\n }", "public function before()\n\t{\n\t\tif (User::is_guest())\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(403, 'Permission denied! You must login!');\n\t\t}\n\n\t\t$id = $this->request->param('id', FALSE);\n\n\t\tif ($id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('view');\n\t\t}\n\t\tif ( ! $id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('inbox');\n\t\t}\n\n\t\tAssets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));\n\n\t\tparent::before();\n\t}", "public function preDispatch() { }", "function charity_before() {\n do_action('charity_before');\n}", "public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}", "public function preTesting() {}", "public function preDispatch() {\n\t\t\n\t\t}", "protected function preProcess() {}", "protected function _beforeInit() {\n\t}", "public function preDispatch()\n {\n\n }", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "public function preDispatch()\n {\n //...\n }", "protected function _before()\n {\n parent::_before();\n\n $this->setUpEnvironment();\n }", "public function before()\n\t{\n\t\t$this->redirect_user(TRUE);\n\t\t\n\t\t/*\n\t\t * Create TMP user for login\n\t\t */\n\t\t$user = ORM::factory('User');\n\t\t//unique id for user\n\t\t$unique_id = uniqid();\n\t\t\n\t\t$user->username \t= 'BrunoMars' . substr($unique_id, 0, 4);\n\t\t$user->email \t\t= $user->username . '@' . $_SERVER['HTTP_HOST'] . '.pl';\n\t\t$user->password \t= $unique_id;\n\t\t\n\t\n\t\t$user->save();\n\t\t\n\t\t//add role for login action\n\t\t$manager = Manager::factory('User', $user);\n\t\t$manager->add_role('login');\n\t\t\n\t\t/*\n\t\t * Execute the controller action (it also sends technical\n\t\t * \tcookies for client API)\n\t\t */\n\t\tRequest::factory(\r\n\t\t\t\tRoute::get('default')->uri(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'controller'\t=> 'user',\r\n\t\t\t\t\t\t\t\t'action' \t\t=>'login'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t)\r\n\t\t->post(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t\t'login_identificator' \t=> $user->username,\r\n\t\t\t\t\t\t'password' \t\t\t \t=> $unique_id\r\n\t\t\t\t)\r\n\t\t)\r\n\t\t->execute();\n\t\t\n\t\t//fake message\n\t\tBlinker::start_blink();\n\t\t\n\t\tparent::before();\n\t}", "public function beforeRules(): void\n {\n }", "protected function processBeforeHooks()\n {\n foreach ($this->beforeHooks as $hook) {\n if (is_callable($hook)) {\n $this->documents = call_user_func($hook);\n }\n\n if (is_string($hook)) {\n $this->documents = $this->app->call($hook, [$this->documents]);\n }\n }\n }", "public function beforeAction($action)\n {\n \\Yii::trace($action->id, __CLASS__ . \"::\" . __FUNCTION__);\n if (!parent::beforeAction($action)) return false;\n return true;\n }", "protected function runBeforeResponseSet(&$actionResult) {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "public function beforeDispatch(\\Magento\\Framework\\Interception\\InterceptorInterface $controller)\r\n {\r\n $this->benchmark->start(__METHOD__);\r\n $actionName = $controller->getRequest()->getActionName();\r\n $fullActionName = $controller->getRequest()->getFullActionName();\r\n\r\n $this->processor->init($fullActionName, $actionName);\r\n $this->processor->addPageVisitLog($controller->getRequest()->getModuleName());\r\n $this->benchmark->end(__METHOD__);\r\n }", "public function before()\r\n\t{\r\n\t\tif ( ! Auth::instance()->logged_in('admin'))\r\n\t\t{\r\n\t\t\tif ($this->request->route() != Route::get('cms-session-login') && $this->request->route() != Route::get('cms-password-forgot') && $this->request->route() != Route::get('cms-password-sent') && $this->request->route() != Route::get('cms-password-change'))\r\n\t\t\t\t$this->request->redirect(Route::get('cms-session-login')->uri());\r\n\t\t}\r\n\r\n\t\t// Remember last visited page\r\n\t\tif ($this->request->method() == Request::GET && Session::instance()->get('back') != $this->request->referrer())\r\n\t\t{\r\n\t\t\tSession::instance()->set('back', $this->request->referrer());\r\n\t\t}\r\n\r\n\t\t// Set default number of records per page\r\n\t\tif (isset($_GET['per_page']))\r\n\t\t{\r\n\t\t\tSession::instance()->set('per_page', $this->request->query('per_page') == 'all' ? 2147483647 : $this->request->query('per_page'));\r\n\r\n\t\t\t$this->request->redirect(Request::detect_uri());\r\n\t\t}\r\n\r\n\t\tparent::before();\r\n\r\n\t\t$this->template\r\n\t\t\t->set('current_user', Auth::instance()->get_user())\r\n\t\t\t->set('affected_ids', Session::instance()->get('affected_ids'));\r\n\t}", "public function before() {\n\t\t$this->_model_name = $this->request->param('model');\n\t\tparent::before();\n\t}", "function test_init_action_is_run() {\n\t}", "public function beforeAction($action)\n {\n // which are triggered on the [[EVENT_BEFORE_ACTION]] event, e.g. PageCache or AccessControl\n\n if (!parent::beforeAction($action)) {\n return false;\n }\n\n // other custom code here\n\n return true; // or false to not run the action\n }", "public function preTest() {}", "public function preExec()\n {\n }", "protected function before_foo($params)\n {\n }", "protected function _beforeCallback($action, array $arguments = array())\n {\n if (true === method_exists($this, 'onBefore' . ucwords($action)))\n {\n //forward_static_call_array(array(get_class($this), 'onBefore' . ucwords($action)), (array) $arguments);\n call_user_func_array(array($this, 'onBefore' . ucwords($action)), (array) $arguments);\n }\n }", "protected function before()\n {\n $this->requireLogin();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "public function beforeAction($action)\n\t{\n\t\t$x=new ExtraFunctions;\n\t\t$x->beforeActionTimeLanguage();\n\t\treturn parent::beforeAction($action);\n\t}", "public function preExecute() {\n }", "abstract protected function _preProcess();", "public function preProcess();", "public function preProcess();", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t\t//\n\t\t$this->view->title = \"Codini\";\n\t}", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function before()\n\t{\n\t\t// Inform tht we're in admin section for themers/developers\n\t\tTheme::$is_admin = TRUE;\n\n\t\tif($this->request->action() != 'login')\n\t\t{\n\t\t\tACL::redirect('administer site', 'admin/login');\n\t\t}\n\n\t\tparent::before();\n\t}", "protected function before()\n\t{\n\t\tparent::before();\n\t\t$this->user = Auth::getUser();\n\t}", "public function preDispatch()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n\n if (!$config->isTestMode()) {\n die('Access Denied.');\n }\n\n return parent::preDispatch();\n }", "protected function processBeforeAction(Main\\Engine\\Action $action)\n\t{\n\t\tif (parent::processBeforeAction($action))\n\t\t{\n\t\t\tif (!$this->checkCommonErrors($action))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function _preExec()\n {\n }", "public function beforeAction($action)\n {\n if (parent::beforeAction($action)) {\n return true; // or false if needed\n } else {\n return false;\n }\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ( true );\n\t\t$this->startup = new Startup ();\n\t\tEventsManager::start ();\n\t\tTranslatorManager::start ( 'fr_FR', 'en' );\n\t\t$this->_initRequest ( 'RestApiController', 'GET' );\n\t}", "public function pre()\n {}", "public function preExecute() {\n // initialise the facebook api variables\n $app_id = sfConfig::get('app_facebook_app_id');\n $secret = sfConfig::get('app_facebook_secret');\n\n // initialise the facebook SDK object and make it available for all\n // other actions\n $this->facebook = new Facebook(array('appId' => $app_id,\n 'secret' => $secret,\n 'cookie' => true));\n\n // define the current action\n $this->action_name = $this->getActionName();\n }", "protected function onBeforeExecute(array $arguments) {}" ]
[ "0.7926384", "0.78209543", "0.7800114", "0.7618145", "0.756786", "0.75388455", "0.75350845", "0.75129116", "0.74888945", "0.74783844", "0.7478383", "0.7379843", "0.7358584", "0.7286", "0.72693646", "0.72387", "0.7183379", "0.7183379", "0.71614164", "0.71326107", "0.7097502", "0.705292", "0.70508593", "0.7049255", "0.7024532", "0.69869447", "0.69867384", "0.6986542", "0.6922235", "0.69190246", "0.691297", "0.6903489", "0.6898524", "0.68918175", "0.68551993", "0.68193614", "0.6813696", "0.6799063", "0.6798328", "0.67918843", "0.6766834", "0.67592597", "0.6754702", "0.6747819", "0.67461014", "0.6721672", "0.66921085", "0.6678065", "0.66514623", "0.66184175", "0.660877", "0.660744", "0.65848994", "0.65608245", "0.6559624", "0.6555157", "0.6534809", "0.65260136", "0.65108484", "0.6496186", "0.64942324", "0.64754003", "0.6473467", "0.64647156", "0.64350224", "0.64188445", "0.6412892", "0.6411906", "0.6402154", "0.63956726", "0.6393738", "0.6360655", "0.6360516", "0.63601065", "0.6350031", "0.6349835", "0.63490385", "0.6347913", "0.63475144", "0.63422716", "0.63365066", "0.6329875", "0.6329875", "0.63249236", "0.63063186", "0.62987196", "0.629087", "0.629087", "0.62896794", "0.6269576", "0.6269576", "0.6268645", "0.62577766", "0.6252397", "0.62468386", "0.6224982", "0.622125", "0.6220811", "0.6219559", "0.62154526", "0.6209447" ]
0.0
-1
Creates a new Permission model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Permission(); if ($model->load(Yii::$app->request->post())) { $this->_saveRecord($model, 'permission_id'); } return $this->render(ACTION_CREATE, [MODEL => $model, 'titleView' => 'Create']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new PermissionForm();\n $post = Yii::$app->request->post();\n unset($this -> menuList[0]);\n if ($model->load($post) && $model->save()) {\n $model->menu_id = $post['PermissionForm']['menu_id'];\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'menuList' => $this -> menuList,\n ]);\n }\n }", "public function create()\n {\n \n \n return view('permissions.create');\n }", "public function create()\n {\n return view('permissions.create_permission');\n }", "public function create()\n {\n $this->authorize('create', Permission::class);\n\n return view('laralum_permissions::create');\n }", "public function create()\n {\n return view('back_end.createPermission');\n }", "public function create()\n {\n abort_if(Gate::denies('permission_create'), Response::HTTP_FORBIDDEN, 'Forbidden');\n\n return view('admin.permissions.create');\n }", "public function create()\n {\n $title = 'Add Permission';\n return view('admin.permission.create', compact('title') );\n }", "public function create()\n {\n return view(\"role_permission.permission\");\n }", "public function create()\n {\n // \n return view('admin.permission.createP');\n }", "public function create()\n {\n return view('permission.create');\n }", "public function create()\n {\n return view('permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create()\n {\n return view('UserCenter.Permissions.create');\n }", "public function create()\n {\n// -----------------------------\n $pageTitle = $this->getPageTitle() . \" - ایجاد\";\n// -----------------------------\n return view('Dashboard.Permission.create', compact('pageTitle'));\n }", "public function create()\n {\n if (Auth::user()->ability('superadministrator', 'create-permissions')){\n return view('permission.create',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'添加',\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function create()\n {\n return view('permission.permissionadd');\n }", "public function create()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n return view('admin.permissions.create');\n }", "public function create(): View\n {\n return view('permissions.create');\n }", "public function create() {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.create'))) return redirect()->route('home');\n Log::debug('create');\n\n\t\treturn view('pages.permission.create');\n\t}", "public function create()\n {\n return view('admin.permission.add');\n }", "public function create()\n {\n\n return view('layouts.dashboard.admin.crud.permissions.create');\n\n }", "public function create()\n {\n $user = UserDetail::findOrFail(Session::get('id'));\n return view('admin.permissions.create', compact('user'));\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function create()\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n return view('admin.permissions.create');\n }", "public function create() {\r\n $this->db->insert(\"assets_permissions\", array());\r\n\r\n $this->model->setId($this->db->lastInsertId());\r\n\r\n return $this->save();\r\n }", "public function create()\n {\n //\n return view('admin.permissions.create', [\n 'title' => 'Создание разрешения',\n 'page_title' => 'Создание нового разрешения',\n ]);\n }", "public function store(CreatePermissionRequest $request)\n {\n Permission::create([\n 'name' => str_slug($request->input('display_name'), '-'),\n 'display_name' => $request->input('display_name'),\n 'description' => $request->input('description')\n ]);\n\n flash()->success('Success');\n\n return redirect('admin/permissions');\n }", "public function create()\n {\n /* Permission CREATE form */\n if (Auth::user()->hasRole('superadmin')) {\n return view('superadmin.permission.create');\n }\n abort(403);\n \n }", "public function create()\n {\n $modules = Module::pluck('name','id')->all();\n return view('permissions.create', compact('modules'));\n }", "public function actionCreate()\n {\n $model = new denied();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store()\n {\n request()->flash();\n \n $data = request()->all();\n $data['route'] = 'App\\\\Http\\\\Controllers\\\\'.$data['controller'].'Controller@'.$data['action'];\n //$data['controller_name'] = $data['controller'];\n PermissionModel::create($data);\n return redirect($this->mainIndex)->with('alert', $this->alert('success', '添加成功.'));\n }", "public function create()\n {\n $menu_control = view()->shared('menu_control');\n $menu_control['page'] = 'all_permissions';\n $menu_control['category'] = 'users';\n\n $permission = '';\n\n return view('users::permissions.create', compact('menu_control', 'permission'));\n }", "public function create()\n\t{\n $permissionsArray = Permission::lists('permission_description','permission_id');\n\n return view('users.create',compact('permissionsArray'));\n\t}", "function add()\n {\n if($this->checkAccess('permission.add') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n {\n $this->load->model('permission_model');\n \n $this->global['pageTitle'] = 'School : Add New Permission';\n\n $this->loadViews(\"permission/add\", $this->global, NULL, NULL);\n }\n }", "public function create() {\n\n //Check Create Access Permission\n $this->CreateAccess = Permit::AccessPermission('permissions-create');\n if (!$this->CreateAccess)\n return redirect('errors/401');\n\n //Get all Admin Modules\n $admin_modules = DB::table('admin_modules')\n ->where('status', 1)\n ->orderBy('sort_order', 'ASC')\n ->get();\n\n\n return view('admin.permissions.create')\n ->with('admin_modules', $admin_modules);\n }", "public function store(CreatePermissionRequest $request)\n {\n $data = $request->all();\n if ($this->permission->create($data)) {\n Toastr::success('添加成功');\n return redirect('/permission');\n }\n Toastr::error('添加失败');\n return redirect('/permission');\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function actionCreate()\n {\n $model = new RoleForm();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $role = new \\yii\\rbac\\Role();\n $role->description = $model->description;\n $role->type = $model->type;\n $role->ruleName = empty($model->rule_name) ? null : $model->rule_name;\n $role->data = $model->data;\n\n $this->authManager->add($role);\n if(is_array($model->child) && count($model->child)){\n foreach($model->child as $name){\n $this->authManager->addChild($role,$this->authManager->getPermission($name));\n }\n }\n return $this->redirect(['update', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'permissions' => $this->authManager->getPermissions()\n ]);\n }\n }", "public function create()\n {\n return view('admin.pages.spatie.permission.create')\n ->with(['menu'=>'user_permission']);\n }", "public function create()\n {\n $permission = Permission::get();\n\n\n $res = $this->arr2tree($permission);\n\n\n\n return view('admin/permission/create',compact('res'));\n\n\n }", "public function create()\n {\n $validator = Validator::make(Request::all(), ['permType' => 'exists:perm_types,id']);\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator);\n }\n $permType = PermType::find(Request::get('permType'));\n return view('dashboard.perms.create', compact('permType'));\n }", "function addNewPermission()\n {\n if($this->checkAccess('permission.add') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n {\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('code','Code','trim|required');\n $this->form_validation->set_rules('description','Description','trim|required');\n \n if($this->form_validation->run() == FALSE)\n {\n $this->add();\n }\n else\n {\n $code = $this->security->xss_clean($this->input->post('code'));\n $description = $this->security->xss_clean($this->input->post('description'));\n \n $permissionInfo = array('code'=>$code,'description'=>$description);\n \n $this->load->model('permission_model');\n $result = $this->permission_model->addNewPermission($permissionInfo);\n \n if($result > 0)\n {\n $this->session->set_flashdata('success', 'New Permission created successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Permission creation failed');\n }\n \n redirect('/setup/permission/list');\n }\n }\n }", "public function create()\n {\n if (Gate::allows('permissions.create')) {\n $modules=Module::all();\n return view('permissions.from', compact('modules'));\n }else{\n return back();\n }\n }", "public function actionCreate()\n {\n $model = new User(['scenario' => User::SCENARIO_SAVE_USER]);\n $model->loadDefaultValues();\n $model->verified = true;\n $positions = new LogPosition();\n\n $roleForm = new RoleForm();\n $permission = Yii::$app->authManager->getPermissions();\n $permissions = $roleForm->getPermissions($permission);\n $rolePermissions = [];\n $registration = new LogRegistration();\n\n $salary = new LogSalary();\n\n $randomKey = \"ok\";\n $post = Yii::$app->request->post('User');\n $model->saveLog(Json::decode($post['log']));\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $newPermissions = Yii::$app->request->post('Permission');\n $roleForm->removePermission($permission, new AccessUserApplicant($model->id));\n $roleForm->savePermission($newPermissions, new AccessUserApplicant($model->id));\n $positions->saveLogPosition(Json::decode($post['log']), $model->id);\n $registration->saveLogRegistration(Json::decode($post['log']), $model->id);\n $salary->saveLogSalary(Json::decode($post['log']), $model->id);\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'randomKey' => $randomKey,\n 'model' => $model,\n 'permissions' => $permissions,\n 'rolePermissions' => $rolePermissions,\n ]);\n }\n }", "public function create()\n {\n $permissions = Permission::get()->pluck('name','name');\n return view('role-permission.role.create', compact('permissions'));\n }", "public function store(CreatePermissionRequest $request)\n {\n //crea el permiso con los datos recibidos\n $this->permissions = Permission::create($request->all());\n // guarda un mensaje en el archivo de log\n Log::info('Permisos, Store, Se almaceno el permiso: '.$this->permissions->id, [$request->all()]);\n Flash::success('Permiso creado correctamente.');\n\n return redirect(route('admin.permisos.show',['id' => $this->permissions->id]) );\n }", "public function store(PermissionsFormRequest $request)\n\t{\n\t\t$perm = Permission::create($request->all());\n\t\treturn redirect('permisos');\n\t}", "public function create()\n {\n $permissions = $this->permission->all();\n return view('admin.role.create', compact('permissions'));\n }", "public function create()\n {\n $permissions = Permission::where('status',0)->get();\n return view('role.add',[\n 'permissions'=>$permissions\n ]);\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $permissions = Permission::all();\n\n return view('role.create', compact('permissions'));\n }", "public function create()\n {\n $permission = Permission::get();\n return view('role.create',compact('permission'));\n }", "public function create() {\n $roles = Role::get(); //Get all roles\n\n return view('permissions.create')->with('roles', $roles);\n }", "public function store(PermissionRequest $request)\n {\n try {\n $permission = $this->model->create($request->all());\n\n flash('新增操作成功', 'success');\n return redirect()->back();\n } catch (ValidationException $e) {\n return $this->toException($e);\n }\n }", "public function create() {\n $permissions = Permission::all();\n return view('cpanel.role.create', compact('permissions'));\n }", "public function actionCreate()\n {\n if(!Yii::$app->role->isOwner())\n {\n throw new ForbiddenHttpException('You do not have permission to access this page.');\n }\n\n $model = new UserRoles();\n $permissions_size = count($model->permissions);\n if ($model->load(Yii::$app->request->post())) {\n $post = Yii::$app->request->post()['UserRoles'];\n $model->id = GlobalFunctions::generateUniqueId();\n $model->company_id = Yii::$app->company->getCompanyID();\n if($model->save())\n {\n if($post['module_clients'])\n {\n $permissions_clients = new RolePermissions();\n $permissions_clients->user_role_id = $model->id;\n $permissions_clients->module = \"clients\";\n $permissions_clients->crud = $this->getCrud($post, \"clients\");\n $permissions_clients->save();\n }\n if($post['module_users'])\n {\n $permissions_users = new RolePermissions();\n $permissions_users->user_role_id = $model->id;\n $permissions_users->module = \"users\";\n $permissions_users->crud = $this->getCrud($post, \"users\");\n $permissions_users->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function create()\n {\n //权限添加\n return view('Admin.Auth.authCreate');\n }", "public function actionCreate()\n {\n $model = new Role();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name'=> 'required|unique:permissions'\n ]);\n Permission::create($request->all());\n return redirect()->route('permissions.index')->with('success','Permiso agregado correctamente');\n }", "public function create() {\n $permissions = Permission::all();//sve permissione\n\n return view('admin.roles.create', ['permissions'=>$permissions]);\n }", "public function create()\n {\n //$this->authorize('haveaccess','roles.create');\n $action = route('roles.store');\n $role = new Role();\n $permissions_role=[];\n $permissions=Permission::get();\n return view('roles.create',compact('permissions','action','role','permissions_role'));\n }", "public function newAction(Request $request)\n {\n $this->get('Services')->setMenuItem('Permission');\n\n $permission = new Permission();\n $form = $this->createForm('Wbc\\AdministratorBundle\\Form\\PermissionType', $permission);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($permission);\n $em->flush();\n\n $this->get('Services')->addFlash('success', $this->get('translator')->trans('Permission created!'));\n\n return $this->redirectToRoute('permission_index');\n }\n\n return $this->render('permission/new.html.twig', array(\n 'permission' => $permission,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data2=User::all();\n return view('userPermission.addnew')->with('user',$data2);\n }", "public function store(StorePermissionRequest $request)\n {\n if (Auth::user()->ability('superadministrator', 'create-permissions')){\n //insert into database\n $permission=new Permission();\n $permission->name=$request->input('name');\n $permission->display_name=$request->input('display_name');\n $permission->description=$request->input('description');\n $bool=$permission->save();\n //redirection after insert\n if ($bool){\n return redirect()->route('permissions.index')->with('success','well done!');\n }else{\n return redirect()->back()->with('error','Something wrong!!!');\n }\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function create()\n {\n\n // 取出所有的权限数据\n $priData = (new Privilege)->getTree();\n //dd($priData);\n return view('admin.privilege.add')->with(['page_btn_link'=>\"/admin/privilege\",'page_btn_name'=>'权限列表','page_btn_title'=>'添加权限', 'priData'=>$priData]);\n }", "public function store(PermissionRequest $request) {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.create'))) return redirect()->route('home');\n Log::info('save new:', $request->all());\n\n\t\t/*\n\t\t * retrieve all the request form field values\n\t\t * and pass them into create to mass update the new Permission object\n\t\t * Can replace Request::all() in the call to create, because we added validation.\n\t\t */\n\t\t$permission = $this->permissionRepository->create($request->all());\n\n\t\t// to see our $permission, we could Dump and Die here\n\t\t// dd(__METHOD__.'('.__LINE__.')',compact('permission'));\n\t\treturn redirect()->route('permission.show', ['id' => $permission->objectID]);\n\t}", "public function actionCreate()\n {\n $model = new PerfilUsuario();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n // check authentication\n if (!Auth::user()->can('role.create')){\n abort(403,'Unauthorized Action to create');\n }\n\n $data['permissions'] = Permission::all();\n $data['permission_groups'] = User::getPermissionGroups();\n // dd($permission_groups);\n return view('backend.roles.create',$data);\n }", "public function create()\n {\n \t$permissions = Permission::all();\n \treturn view('admin.roles.createrole',compact('permissions'));\n }", "public function create()\n {\n return view('dashboard.permTypes.create');\n }", "public function store(PermissionsRequest $request)\n {\n $module_name = $this->module_name;\n\n Permission::create($request->all());\n\n return redirect(\"admin/$module_name\")->with('flash_success', \"$module_name added!\");\n }", "public function actionCreate()\n\t{\n\t\t$type = $this->getType();\n\t\t\n\t\t// Create the authorization item form\n\t\t$formModel = new AuthItemForm('create');\n\n\t\tif( isset($_POST['AuthItemForm'])===true )\n\t\t{\n\t\t\t$formModel->attributes = $_POST['AuthItemForm'];\n\t\t\tif( $formModel->validate()===true )\n\t\t\t{\n\t\t\t\t// Create the item\n\t\t\t\t$item = $this->_authorizer->createAuthItem($formModel->name, $type, $formModel->description, $formModel->bizRule, $formModel->data);\n\t\t\t\t$item = $this->_authorizer->attachAuthItemBehavior($item);\n\n\t\t\t\t// Set a flash message for creating the item\n\t\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\t\tRights::t('core', ':name created.', array(':name'=>$item->getNameText()))\n\t\t\t\t);\n\n\t\t\t\t// Redirect to the correct destination\n\t\t\t\t$this->redirect(Yii::app()->user->getRightsReturnUrl(array('authItem/permissions')));\n\t\t\t}\n\t\t}\n\n\t\t// Render the view\n\t\t$this->render('create', array(\n\t\t\t'formModel'=>$formModel,\n\t\t));\n\t}", "public function create()\n {\n $permission = Permission::get();\n return view('roles.create',compact('permission')); \n }", "public function store(Request $request)\n {\n $permission = Permission::create($request->all());\n return redirect()->route('bk-permissions');\n }", "public function create()\n {\n\n $permissionsList = Permission::all();\n\n return view( 'modals.create-user', compact('permissionsList') );\n }", "public function store(PermissionCreateRequest $request)\n {\n $permission = $this->repository->create($request->all());\n return $this->response->withCreated('权限创建成功');\n }", "public function create()\n {\n return view('permission_categories.create');\n }", "public function create()\n {\n $permissions = Permission::orderBy('group_permission','asc')->get();\n $permissions = $this->arrayGroupPermission($permissions);\n $groups = $this->getGroupPermission();\n // tạo mảng trống để khỏi check\n $permissionActive = [];\n $viewData = [\n 'permissions' => $permissions,\n 'groups' => $groups,\n 'permissionActive' => $permissionActive\n\n ];\n return view('admin::pages.acl.role.create',$viewData);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name' =>'required|max:50|unique:permissions',\n 'permission_for' =>'required'\n ]);\n $permissions = new Permission;\n $permissions->name = $request->name;\n $permissions->permission_for = $request->permission_for;\n $permissions->save();\n return redirect(route('permission.index'));\n }", "public function create()\n\t{\n\t\t$consultperm = AclPermission::where('main_module','=','consultant')->get();\n\t\t$awardedperm = AclPermission::where('main_module','=','awarded')->get();\n\t\t$akdnperm = AclPermission::where('main_module','=','akdn')->get();\n\t\t$languageperm = AclPermission::where('main_module','=','language')->get();\n\t\t$skillperm = AclPermission::where('main_module','=','skill')->get();\n\t\t$roleperm = AclPermission::where('main_module','=','role')->get();\n\t\t$specperm = AclPermission::where('main_module','=','specialization')->get();\n\t\t$userperm = AclPermission::where('main_module','=','adminuser')->get();\n\t\t$firewallperm = AclPermission::where('main_module','=','firewall')->get();\n\t\t$agency = AclPermission::where('main_module','=','agency')->get();\n\t\t$mails = AclPermission::where('main_module','=','mails')->get();\n\t\treturn View::make('admin.role.create',compact('mails','agency','consultperm','awardedperm','akdnperm','languageperm','skillperm','roleperm','userperm','specperm','firewallperm'));\n\t}", "public function create()\n {\n return $this->permissionService->create();\n }", "public function store(CreatePermissionsRequest $request)\n {\n $input = $request->all();\n\n $permissions = $this->permissionsRepository->create($input);\n\n Flash::success('Permissions saved successfully.');\n\n return redirect(route('permissions.index'));\n }", "public function create()\n {\n //\n $data = [];\n $permissions = Permission::get(); \n $data['permissions'] = $permissions;\n return view('admin.roles.create', $data);\n }", "public function actionCreate()\n {\n $model = $this->elementAccessForm;\n $tree = $this->authTree->getArrayAuthTreeStructure($this->authTree->getAuthTree());\n\n if ($model->load(Yii::$app->request->post()) && $saveId = $model->save()) {\n return $this->redirect(['view', 'id' => $saveId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'tree' => $tree,\n ]);\n }\n }", "public function create()\n {\n //\n return view('privilege.create');\n }", "public function create()\n {\n $permissions = Permission::all();\n return view('portfolio.role.create', compact('permissions'));\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "public function store(PermissionsFormRequest $request)\n {\n try {\n \n $data = $request->getData();\n \n Permission::create($data);\n\n return redirect()->route('permissions.permission.index')\n ->with('success_message', trans('permissions.model_was_added'));\n\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => trans('permissions.unexpected_error')]);\n }\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $permission = Permission::get(); \n $pageTitle = self::$pageTitle;\n $pageDescription = self::$pageTitle . ' Add Data';\n $page_breadcrumbs = [\n url(self::$folderPath . '/') => \"List \" . self::$pageTitle,\n url(self::$folderPath . '/create') => $pageDescription\n ];\n $permissionName = self::$folderPath;\n return view('roles.create',compact('permission','pageTitle', 'pageDescription', 'page_breadcrumbs', 'permissionName'));\n }", "public function create()\n {\n // ตรวจสอบ permission\n ChkPerm('user-create', 'setting/user');\n\n return view('setting.user.create');\n }" ]
[ "0.80862355", "0.74901825", "0.74845266", "0.74669313", "0.74579203", "0.74530274", "0.7448191", "0.7389891", "0.7350964", "0.734821", "0.7344983", "0.730681", "0.730681", "0.7271402", "0.7271402", "0.7264901", "0.7261882", "0.72546726", "0.7240605", "0.71993816", "0.71978396", "0.71722066", "0.7151991", "0.7112827", "0.70957816", "0.7081241", "0.7081241", "0.70481986", "0.70305973", "0.69792855", "0.6970385", "0.69236016", "0.6918962", "0.6916455", "0.6913561", "0.69090486", "0.6897971", "0.6892081", "0.68817025", "0.6878254", "0.68401664", "0.6831675", "0.6806928", "0.67974484", "0.6768984", "0.6764139", "0.6761192", "0.6745417", "0.6737907", "0.6689321", "0.6688363", "0.6630465", "0.66285187", "0.6613909", "0.6613512", "0.66093105", "0.65712285", "0.65466213", "0.6542395", "0.6540883", "0.65382475", "0.65246034", "0.6523693", "0.6518032", "0.65163845", "0.65134245", "0.65067697", "0.6504956", "0.65038383", "0.6468426", "0.6449975", "0.6448845", "0.64473355", "0.6443857", "0.64320314", "0.642618", "0.6419373", "0.64081985", "0.639805", "0.6397138", "0.6389048", "0.63851666", "0.6373515", "0.6366504", "0.63575864", "0.63536644", "0.6348769", "0.6343197", "0.63417834", "0.6337889", "0.6335323", "0.6328463", "0.6328463", "0.6328463", "0.6328463", "0.63244206", "0.6317734", "0.6314965", "0.63106334", "0.62998027" ]
0.84697866
0
Deletes an existing row of Permission model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $deleteRecord = new DeleteRecord(); if (!$deleteRecord->isOkPermission(ACTION_DELETE)) { return $this->redirect([ACTION_INDEX]); } $model = $this->findModel($id); try { $common = new Common(); $status = $common->transaction($model, ACTION_DELETE); $deleteRecord->report($status); } catch (Exception $exception) { $bitacora = new Bitacora(); $bitacora->registerAndFlash( $exception, 'actionDelete', MSG_ERROR ); } return $this->redirect([ACTION_INDEX]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }", "function delete_permission() {\n\t\t$this->db->where('permission_id', $_POST['id']);\n\t\t$this->db->delete('system_security.permission');\n\t\techo \"{error: '',msg: '\" . sprintf(lang('success_delete'), 'permission') . \"'}\";\n\t\t\n }", "function delete()\n {\n if($this->checkAccess('permission.delete') == 1)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $permissionId = $this->input->post('permissionId');\n $permissionInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->permission_model->deletePermission($permissionId, $permissionInfo);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete() {\n $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\n\n $this->redirect('default');\n }", "public function DeletePermission() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idUser = $_REQUEST['data']['idUser'];\n\n try {\n $sql = $this->db->prepare(\"DELETE FROM permission WHERE idUser = :idUser \");\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n $sql->execute();\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully one record deleted.\");\n $this->response($this->json($success), 200);\n }\n } catch (PDOException $ex) {\n if ($ex->getCode() === '23000') {\n $error = array('status' => \"Failed\", \"msg\" => \"Impossible de supprimé cette permission\");\n $this->response($this->json($error), 400);\n } else {\n $error = array('status' => \"Failed\", \"msg\" => $ex->getMessage());\n $this->response($this->json($error), 400);\n }\n }\n }\n }", "public function actionDelete($id)\n {\n $params = Yii::$app->request->get();\n if($params['id']){\n PermissionForm::deleteAll(['name' => $params['id']]);\n }\n return $this->render('create');\n //$this->findModel($id)->delete();\n\n //return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "function admin_delete_rp($model, $row_id, $permission_id) {\r\n if (!isSet($model, $row_id, $permission_id)) {\r\n $this->Session->setFlash(__('Nieprawidłowe wywołanie'));\r\n $this->redirect($this->referer());\r\n }\r\n if ($this->RequestersPermission->deleteAll(array(\r\n 'RequestersPermission.permission_id' => $permission_id,\r\n 'RequestersPermission.row_id' => $row_id,\r\n 'RequestersPermission.model' => $model\r\n ))) {\r\n $this->Session->setFlash(__('Uprawnienie zostało usunięte'));\r\n $this->redirect($this->referer());\r\n }\r\n $this->Session->setFlash(__('Uprawnienie nie zostało usunięte'));\r\n $this->redirect($this->referer());\r\n }", "public function actionDelete($id)\r\n {\r\n // $this->findModel($id)->delete();\r\n echo 'Not Allowed';\r\n exit();\r\n return $this->redirect(['index']);\r\n\r\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\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->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function delete(){\n\t\t\t$id = $_GET['id'];\n\t\t\t$result = $this->userrepository->delete($id);\n\t\t\tif($result = true){\n\t\t\t\theader(\"Location: index.php/admin/index/delete\");\n\t\t\t}\n\t\t}", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n if (Yii::$app->user->can('admin')){\n\n return $this->redirect(['index']);\n\n }\n return $this->redirect(['userindex']);\n }", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n /*Yii::$app->authManager->revokeAll($id);\n $this->findModel($id)->delete();*/\n $model = $this->findModel($id);\n $model->status = User::STATUS_DELETED;\n $model->save(false);\n\n return $this->redirect(['index']);\n }", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->is_delete = 1;\n\n if($model->save())\n {\n return $this->redirect(['admin']);\n }\n }", "public function deleteAction() : object\n {\n if ($_SESSION['permission'] === \"admin\") {\n $form = new DeleteForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Delete an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete($id)\n {\n if (empty(Yii::$app -> user -> identity)) {\n return $this -> redirect(['site/login']);\n }\n\t if (!Yii::$app -> user -> can('adminDelete')) {\n throw new ForbiddenHttpException('您没有该项操作的权限!');\n }\n\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "function delete() {\r\n\t\t$this->user_group_model->can_access(DELETE_MENU, null, null);\r\n\t\t$menuid = $this->uri->segment(3);\r\n\t\t$this->load->model('menu_model');\r\n\t\t$this->menu_model->deleteMenu($menuid);\r\n\t\t\t\r\n\t\tredirect('menu', 'lomenuion');\r\n\t}", "public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n\t{\n\t\t$user = User::model()->find('username=?',array(Yii::app()->user->name));\n\t\t$user_right_ID = $user->user_right_ID;\n\t\t$type_ID = $user->user_type_ID;\n\t\tif($user_right_ID == \"2\"){\n\t\t\t$this->loadModel($id)->delete();\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}else{\n\t\t\t\n\t\t\techo \"<script>alert('Sie sind nicht berechtigt, diese Aktion durchzuführen')</script>\";\n\t\t}\n\n\t}", "public function actionDelete($id)\n\t{\n\t\t//$this->loadModel($id)->delete();\n $model=$this->loadModel($id);\n $model->IdEstadoSolicitudCita = 3;\n $model->save();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete($id)\n\t{\n\t\tif ($id > 3) {\n\t\t\t$this->loadModel($id)->delete();\n\t\t} else {\n\t\t\tYii::app()->user->setFlash('failed','Cannot delete the administrators');\n\t\t}\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function deleteRecord() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-delete') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n \n $id = $this->uri->segment(3);\n\n if ($id != $this->user()->id) {\n $result = $this->UserModel->deleteRecordData($id);\n $this->UserModel->deleteUserType($id);\n if ($result == 1) {\n $this->session->set_flashdata('message', '2');\n redirect('UserCon/showAllRecordsPage');\n } else {\n echo \"Database error!\";\n }\n } else {\n $this->session->set_flashdata('message', '3');\n redirect('UserCon/showAllRecordsPage');\n }\n } else {\n echo \"access denied\";\n }\n }", "public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\tif ($model) {\n\t\t\t$model->delete();\n\t\t}\n\n // if AJAX request (triggered by deletion via list grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t}", "function deletePermission($permission) {\n\tglobal $errors;\n\t$i = 0;\n\t$db = DB::getInstance();\n\tforeach($permission as $id){\n\t\tif ($id == 1){\n\t\t$errors[] = lang(\"CANNOT_DELETE_NEWUSERS\");\n\t\t}\n\t\telseif ($id == 2){\n\t\t\t$errors[] = lang(\"CANNOT_DELETE_ADMIN\");\n\t\t}else{\n\t\t\t$query1 = $db->query(\"DELETE FROM permissions WHERE id = ?\",array($id));\n\t\t\t$query2 = $db->query(\"DELETE FROM user_permission_matches WHERE permission_id = ?\",array($id));\n\t\t\t$query3 = $db->query(\"DELETE FROM permission_page_matches WHERE permission_id = ?\",array($id));\n\t\t\t$i++;\n\t\t}\n\t}\n\treturn $i;\n\n\t//Redirect::to('admin_permissions.php');\n}", "public function actionDelete()\n {\n return $this->findModel(Yii::$app->request->post('id'))->delete(false);\n }", "public function deleteAction() {\r\n if (isset($_SESSION['Connected']))\r\n if (($_SESSION['Connected'] == 1) and ($_SESSION['admin'] == 1))//secure\r\n Users::deleteMember($_GET['id']);\r\n\r\n $this->redirect(\"/Members/index\");\r\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\tif (!($model = $this->loadModel()))\n\t\t\t\treturn;\n\t\t\t$model->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete() {\n\t\tif (isset($_POST) && $_POST['isAjaxRequest'] == 1) {\n\t\t\t$response = array('status' => '1');\n\t\t\t$model = $this->loadModel($_POST['id']);\n\t\t\t$model->is_deleted = 1;\n\t\t\tif ($model->save()) {\n\t\t\t\techo CJSON::encode($response);\n\t\t\t} else {\n\t\t\t\t$response = array('status' => '0', 'error' => $model->getErrors());\n\t\t\t\techo CJSON::encode($response);\n\t\t\t}\n\t\t}\n\t}", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function deletePermission ($id) {\n $user_auth = Auth::user();\n if (!$user_auth) \n {\n return response()->json(['error'=>'Unauthorised'], 401);\n } \n \tif (tbl_permission::where('id', $id)->exists())\n\t\t {\n\t\t $tbl_permission = tbl_permission::where('user_id', $id);\n\t\t $tbl_permission->delete();\n\n\n\t\t return response()->json([\"message\" => \"records deleted successfully\"], 200);\n\t\t }\n\t\t else \n\t\t {\n\t\t return response()->json([\"message\" => \"permission not found\"], 404);\n\t\t \n\t\t }\n }", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n if(!Yii::$app->user->can('admin')){\n if($model->id_user !== Yii::$app->user->id)\n throw new ForbiddenHttpException();\n }\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success','Pekerjaan Berhasil Dihapus');\n return $this->redirect(['/admin/user/index']);\n }", "public function destroy($id)\n {\n Permission::find($id)->delete();\n\n return redirect()->route('permisos.index')\n ->with('success','Permiso eliminado exitosamente');\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $this->checkPermissionByModelsUserId($model->user_id);\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n\t{\n\t\tif(Yii::app()->user->user_type==4){\n\t\t\t$this->layout='teacher';\n\t\t}\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t\t\n\t}", "public function destroy($id)\n {\n $permission = AdminPermission::find($id);\n $result = $permission->delete();\n if ($result){\n return redirect()->back()->with('success','Permission deleted');\n }else{\n return redirect()->back()->with('fault','Permission not deleted');\n }\n }", "public function delete()\n\t{\n\t\tJSession::checkToken() or JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));\n\t\t$this->_result = $result = parent::delete();\n\t\t$model = $this->getModel();\n\n\t\t//Define the redirections\n\t\tswitch ($this->getLayout() . '.' . $this->getTask())\n\t\t{\n\t\t\tcase 'default.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tcase 'modal.delete':\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t), array(\n\t\t\t\t\t'cid[]' => null\n\t\t\t\t));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->applyRedirection($result, array(\n\t\t\t\t\t'stay',\n\t\t\t\t\t'com_papiersdefamilles.reservations.default'\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function destroy($id)\n {\n UserPermission::find($id)->delete();\n return redirect()->route('user_permission.index')\n ->with('success','Permission deleted successfully')\n ->with(['menu'=>'user_permission']);\n }", "public function deleteAction(){\n\t\t$this->view->isLoggedIn = $this->isLoggedIn;\n\t\t\n\t\t$id = (int)$this->_request->getParam('id');\n\t\t\n\t\tif(is_numeric($id)){\n\t\t\t$notificationTable = new Zend_Db_Table('notifications');\n\t\t\t$where = array(\n\t\t\t\t\t\t'user_id = ?' => $this->user_id_seq,\n\t\t\t\t\t\t'id = ?' => $id\n\t\t\t\t\t\t);\n\t\t\t$notificationTable->delete($where);\n\t\t}\n\t}", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n if(!PermissionUtils::checkModuleActionPermission(\"Users\",PermissionUtils::DELETE)){\n\t\t\t\tthrow new ForbiddenHttpException('You are not allowed to perform this action.');\n }\t\n $model = $this->findModel($id);\n $model->updatedBy= yii::$app->user->identity->userID;\n\t $model->active = StatusCodes::INACTIVE;\n\t $model->passwordStatusID = 6;\n\n\t if($model->save())\n\t \tYii::$app->session->addFlash( 'success',\"Users has been deleted \" );\n\t\telse\n\t\tYii::$app->session->addFlash( 'error',\"Error on deleting Users \" );\n\n return $this->redirect(['index']);\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success','Prefactura eliminada correctamente');\n return $this->redirect(['index']);\n }", "public function deleteAction() {\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t$controller = Zend_Controller_Front::getInstance ()->getRequest ()->getControllerName ();\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\tif(ProductsAttributes::deleteAttribute($id)){\n\t\t\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Attribute deleted' ), 'status' => 'information' ) );\t\n\t\t\t}\n\t\t}\n\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Unable to process the request at this time.' ), 'status' => 'danger' ) );\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->isDelete = 1;\n $model->save();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n\t{\n\t \n\t\n\t\t$model = $this->loadModel($id);\n\t\t$role = $model->role;\n\t\tif($model->role=='2')\n\t\t{\n\t\tReviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\tReviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\tCart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='3')\n\t\t{\n\t\t Guide::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Guidetemple::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='4')\n\t\t{\n\t\t Iyer::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Iyerpoojas::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t}\n\t\t$model->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('/user/manage/role/'.$role));\n\t}", "public function actionDelete($id)\n {\n if (!\\Yii::$app->user->can('manager')) {\n throw new ForbiddenHttpException('Вам не разрешено производить данное действие. ');\n }\n\n $oldModel = $this->findModel($id);\n $this->findModel($id)->delete();\n\n (new History())->setRow(Yii::$app->controller, $oldModel, [], 'Удален клиент '.$oldModel['user_name']);\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->checkPrivilege();\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $model=$this->findModel($id);\n\t\t$id_operacion=$model->id_operacion;\n\t\t$model->delete();\n\t\t\n\t\treturn $this->redirect(['index', 'id_operacion' => $id_operacion]);\n //return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n //如果不是超级管理员\n if( $this->role_id != 1 ) {\n return 800;\n }\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n if($this->isAuthenticate())\n {\n $model = $this->findModel($id);\n $type = $model->IdEntityType;\n $model->delete();\n\n return $this->redirect(['index','type' => $type]);\n }\n }", "public function actionDelete($id) {\n\t\t$this -> loadModel($id) -> delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif (!isset($_GET['ajax']))\n\t\t\t$this -> redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n Configs::authManager()->remove($model->item);\n Helper::invalidate();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\t\t\\Yii::$app->session->setFlash('updated',\\Yii::t('admin', 'Данные успешно удалены'));\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n \t\n \ttry{\n \t\t//$model = $this->findModel($id)->delete();\n \t\t$UserInfo = User::find()->where(['id' => $id])->one();\n \t\t$UserInfo->status = 0;\n \t\t$UserInfo->update();\n \t\tYii::$app->getSession()->setFlash('success', 'You are successfully deleted Nursing Home.');\n \t\n \t}\n \t \n \tcatch(\\yii\\db\\Exception $e){\n \t\tYii::$app->getSession()->setFlash('error', 'This Nursing Home is not deleted.');\n \t\n \t}\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDels() {\n foreach ($_POST['ck'] as $value) {\n $name = trim($value);\n //Returns the named permission.\n $permission = Yii::$app->authManager->getPermission($name);\n //Removes a permission or rule from the RBAC system.\n Yii::$app->authManager->remove($permission);\n }\n return $this->redirect([ 'index']);\n }", "public function actionDelete($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$this->loadModel($id)->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n \n\t}", "public function actionDelete($id)\n { \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n \n try {\n $model = $this->findModel($id);\n \n $this->deshacer_renglones($model);\n\n $model->delete();\n \n $transaction->commit();\n \n return $this->redirect(['index']);\n\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n if(file_exists(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path))\n unlink(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path);\n \n $this->loadModel($id)->delete();\n \n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}", "public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}", "public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}", "public function actionDelete($id)\r\n\t{\r\n\t\t$this->loadModel($id)->delete();\r\n\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n\t\tif(!isset($_GET['ajax']))\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n\t}", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $model->IsDelete=1;\n $model->save();\n Yii::$app->session->setFlash('success', \"Your message to display.\");\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n //$this->findModel($id)->delete();\n \n if(Yii::$app->request->isAjax){\n return true;\n }else{\n return $this->redirect(['index']);\n }\n }", "public function actionDelete($id) {\r\n $this->loadModel($id)->delete();\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if (!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }", "public function actionDelete($id) {\r\n $this->loadModel($id)->delete();\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if (!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }", "public function deleteAction(){\r\n\t\t$this->getHelper('viewRenderer')->setNoRender();\r\n\t\t$this->_helper->layout->disableLayout();\t\r\n\t\t$id = $this->_getParam('id');\r\n\t\t//\"UPDATE `user` SET `active`=abs(`active`-1) WHERE user_id='$id'\";\r\n\t\t$sql =\"DELETE FROM `user` WHERE `user_id` = '\".$id.\"'\";\r\n\t\t//echo $sql;die();\r\n\t\t$del = Zend_Registry::get(\"db\")->query($sql);\r\n\t\t\r\n\t\tif($del){\r\n\t\t\t$this->_flashMessenger->addMessage('Selected record deleted');\r\n\t\t\t$this->_redirect('/admin/user/');\t\r\n\t\t}\r\n\t}", "public function DeleteAction()\r\n\t{\r\n\t\t// If form has been submitted\r\n\t\tif(isset($_GET['id']))\r\n\t\t{\r\n\t\t\t// Save data to table\r\n\t\t\t$this->View->status = $this->Author->delete($_GET['id']);\r\n\t\t}\r\n\t}", "public function actionMenutouserdelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['menutouserindex']);\r\n }", "public function actionDelete()\r\n {\r\n $id = intval($_GET['id']);\r\n $this->loadModel($id)->delete();\r\n $this->redirect('/app/IconConfig/index');\r\n }", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->loadModel($id)->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif (!isset($_GET['ajax'])) {\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\n\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n $model = Pengalaman::findOne($id);\n var_dump($model);die();\n return $this->redirect(['//keterangan/updatepencaker','id'=>$model->id_daftar]);\n }", "public function actionDelete($id)\n {\n $this->checkPrivilege();\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n if(isset($_REQUEST['id']))\n {\n $model = $this->findModel($_REQUEST['id']);\n $model->is_deleted = \"Y\";\n $model->u_by = Yii::$app->user->id;\n $model->u_date = time();\n $model->save(false);\n }\n //$this->findModel($id)->delete();\n\n //return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }" ]
[ "0.753896", "0.742335", "0.7336915", "0.72244364", "0.7154113", "0.7144295", "0.70152587", "0.70063823", "0.6976089", "0.6938195", "0.68631756", "0.6841392", "0.68153137", "0.68074036", "0.67905515", "0.6753169", "0.6728657", "0.6713335", "0.6701199", "0.66810846", "0.66751134", "0.6672054", "0.6626983", "0.66151464", "0.6610838", "0.6598912", "0.65829206", "0.65822345", "0.65756416", "0.65689784", "0.6568457", "0.65555555", "0.65555555", "0.6553075", "0.6551289", "0.6551164", "0.6550633", "0.6540347", "0.65375894", "0.6536468", "0.6532863", "0.65320724", "0.6528191", "0.652431", "0.6522575", "0.65172285", "0.6515707", "0.6514353", "0.65059906", "0.65038645", "0.6502758", "0.6502582", "0.6502582", "0.65015596", "0.64827156", "0.648187", "0.6481242", "0.64806795", "0.6469477", "0.6459304", "0.64560515", "0.64553696", "0.64537907", "0.6451464", "0.64490205", "0.6448752", "0.6448063", "0.64464533", "0.64464533", "0.64415556", "0.6439221", "0.64352345", "0.64324254", "0.64311105", "0.64311093", "0.6425123", "0.6422234", "0.6420673", "0.6419768", "0.64193255", "0.6414534", "0.6414526", "0.6412556", "0.6412556", "0.6412556", "0.6412556", "0.6411201", "0.6410091", "0.64091885", "0.64091885", "0.6402283", "0.6394845", "0.63937724", "0.63934", "0.63886565", "0.63822246", "0.63690203", "0.63624245", "0.6360787", "0.6354219", "0.6349859" ]
0.0
-1
Finds the Permission model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($permissionId) { $permissionId = self::stringDecode($permissionId); if (($model = Permission::findOne($permissionId)) !== null) { return $model; } $event = Yii::t( 'app', 'The requested page does not exist {id}', [ 'id' => $permissionId ] ); $bitacora = new Bitacora(); $bitacora->register($event, '', MSG_ERROR); throw new NotFoundHttpException( Yii::t( 'app', 'The requested page does not exist.' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find(int $id): Permission\n {\n return Permission::find($id);\n }", "public function findPermissionById($permissionId);", "protected function _getPermissionModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Permission');\n\t}", "protected function findModel($id)\n {\n if (($model = PermissionForm::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public abstract function find($primary_key, $model);", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function findPermission($permissionName);", "protected function findModel($id)\n {\n $auth = Configs::authManager();\n $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);\n if ($item) {\n return new AuthItem($item);\n } else {\n $this->send($this->fail('数据不存在'));\n }\n }", "public function find($id)\n {\n return response(Permission::findById($id),HTTP_OK);\n }", "public function find($id)\n {\n $query=\"SELECT permissionId,\".\n \"permissionName \". \t\t \n\t \"FROM permission \".\n\t \"WHERE permissionId=\".$id;\n\n return($this->selectDB($query, \"Permission\"));\n }", "public function findByName(string $name)\n {\n return Permission::whereName($name)->first();\n }", "public function permission($permission)\n {\n if (is_numeric($permission)) {\n return $this->permissionModel->find((int) $permission);\n }\n\n return $this->permissionModel->like('name', $permission, 'none', null, true)->first();\n }", "protected function findModel($id)\n {\n if (($model = UserRoles::find()->where(['id' => $id, 'company_id' => Yii::$app->company->getCompanyID()])->joinWith('permissions')->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT id, permission, role_id, can FROM candle_role_permission WHERE id = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildCandleRolePermission $obj */\n $obj = new ChildCandleRolePermission();\n $obj->hydrate($row);\n CandleRolePermissionTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function getById($id = null) {\r\n if ($id) {\r\n $this->model->setId($id);\r\n }\r\n\r\n $data = $this->db->fetchRow(\"SELECT * FROM assets_permissions WHERE id = ?\", $this->model->getId());\r\n $this->assignVariablesToModel($data);\r\n }", "protected function findModel($id)\n {\n if (($model = SecurityEntities::findOne($id)) !== null) \n {\n return $model;\n } else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel()\n\t{\n\t\tif( $this->_model===null )\n\t\t{\n\t\t\t$itemName = $this->getItemName();\n\t\t\t\n\t\t\tif( $itemName!==null )\n\t\t\t{\n\t\t\t\t$this->_model = $this->_authorizer->authManager->getAuthItem($itemName);\n\t\t\t\t$this->_model = $this->_authorizer->attachAuthItemBehavior($this->_model);\n\t\t\t}\n\n\t\t\tif( $this->_model===null )\n\t\t\t\tthrow new CHttpException(404, Rights::t('core', 'The requested page does not exist.'));\n\t\t}\n\n\t\treturn $this->_model;\n\t}", "protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "public static function findByName($name) {\n $permission = static::where('name', $name)->first();\n\n if (!$permission) {\n throw new PermissionDoesNotExist();\n }\n\n return $permission;\n }", "public function permission()\n {\n return $this->hasOne('App\\Models\\Permission', 'id', 'permission_fk');\n }", "public static function getPermissionModel()\n {\n return static::getModel('Permissions');\n }", "function model()\n {\n return Permission::class;\n }", "protected function findModel($id)\n {\n if (($model = denied::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AcRole::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }", "public function findOrFail($id)\n {\n $permission = $this->model->find($id);\n\n if (! $permission) {\n throw ValidationException::withMessages(['message' => trans('permission.could_not_find')]);\n }\n\n return $permission;\n }", "protected function findModel($id, $accessCheck = true)\n {\n if (($model = Category::findOne($id)) !== null) {\n \n if ($accessCheck && ! ($model->isAllowed()))\n throw new HttpException(403, Yii::t('app', 'You are not allowed to access this page.'));\n \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getPermission($id) {\n \t$user_auth = Auth::user();\n if (!$user_auth) \n {\n return response()->json(['error'=>'Unauthorised'], 401);\n } \n\t\t if (tbl_permission::where('user_id', $id)->exists()) \n\t\t {\n\t\t \t $tbl_permission = tbl_permission::where('user_id', $id)->get()->first(); \n return response()->json(['success' => $tbl_permission], $this-> successStatus); \n\t\t \n\t\t } \n\t\t else \n\t\t {\n\t\t return response()->json([\"message\" => \"Menu not found\"], 404);\n\t\t \n\t\t }\n\t\t \t\n }", "public function getById(int $id)\n {\n if (!$found = cache($id . '_userPermissionById')) {\n $found = $this->objectManager->where(['id' => $id])->load()->getRow();\n cache()->save($id . '_userPermissionById', $found, 3600);\n }\n\n return $found;\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = MenuToUser::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = CodeMember::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n try{\n $model = $this->roleRepository->get($id);\n } catch (\\DomainException $e){\n throw new NotFoundHttpException(Yii::t('t2cms/error', 'The requested page does not exist'));\n }\n\n return $model;\n }", "public function loadModel($id)\n {\n $model = CreditCardAuthorization::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function findPermissionFromCollection($permission)\n {\n return $this->getAllPermissions()->where('id', $permission->id)->first();\n }", "public function permission()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\PermissionModel', 'permission_id');\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "public function getPermissionById($id)\n {\n $res = false;\n if (clsCommon::isInt($id) > 0) {\n $res = $this->em->getRepository('entities\\AclPermission')->find(clsCommon::isInt($id));\n }\n return $res;\n }", "public function loadModel($id) {\n\t\t$model=Adminuser::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Role::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Role::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Role::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($model, $id);", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id, $del_status = '0') {\n $class = get_class($this->getPrimaryModel());\n if (($model = $class::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getPermission($permission);", "protected function findModel($id)\n {\n \tif (($model = User::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }", "protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "public function loadModel($id) {\n if ($id == Yii::app()->user->id || Yii::app()->user->isAdmin()) {\n $model = User::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }\n else {\n echo \"<h1>You Are Not Authorized to See Other Members Profile, DON'T DO IT AGAIN!!!</h1>\";\n exit;\n }\n }", "protected function findModel($id)\n {\n if (($model = Adminuser::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n if (($model = LoanItemPriority::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Package::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel()\n\t{\n\t\tif( $this->_model === null ) {\n\t\t\tif( Yii::app()->user->isAuthenticated() ) { // если пользователь авторизирован\n\t\t\t\t$this->_model = User::model()->findbyPk(Yii::app()->user->id);\n\t\t\t}\n\t\t\tif( $this->_model === null ) {\n\t\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\t\t}\n }\n return $this->_model;\n }", "static function getPermissionById(string $id) {\n $db = new Database();\n return $db->getColumnValueWhere('users', 'permission', 'id', $id);\n }", "protected function findModel($id)\n {\n if (($model = Admin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Admin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Admin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Admin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function returnFindByPK($id);", "public function getPermission($permission) {}", "public function getPermission($permission) {}", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = ClasscationAdmin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n$model = Users::findOne($id);\n\tif($model == null)\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']) or ($model->clientID == Yii::$app->user->identity->clientID)) {\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "protected function findModel($id)\n {\n if (($model = AppUser::findOne($id)) !== null) {\n if ($model->status !== 0) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Dirs::findOne($id)) !== null) {\n if($model->user->id != Yii::$app->user->identity->id){\n throw new ForbiddenHttpException('檔案禁止存取');\n }\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = $this->elementAccessRepository->findOneWithAuthItems($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = DsisSystemUserMenu::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function resolvePermission($permission): Permission\n {\n if (is_string($permission)) {\n $permission = Permission::search($permission);\n } elseif (is_int($permission)) {\n $permission = Permission::find($permission);\n }\n\n return $permission;\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getPermission($id) {\n try {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $permission = $objPermission->getPermission($id);\n return $permission;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($e);\n }\n }", "protected function findModel($id)\n {\n if (($model = ContentMenu::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = Menu::findOne($id)) !== NULL) {\n return $model;\n } else {\n \\Yii::error(\\Yii::t('akhdanihr', 'Data dengan kriteria yang anda cari tidak ditemukan!'));\n throw new \\Exception(\\Yii::t('akhdanihr', 'Data dengan kriteria yang anda cari tidak ditemukan!'));\n }\n }", "protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function getPermission($permission) {\n $params = self::getPermissionParts($permission);\n return static::where($params)->first();\n }", "protected function findModel($id)\n {\n if (($model = SanPham::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel() {\n if ($this->_model === null) {\n if (isset($_GET['id']))\n $this->_model = Project::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model = SystemUser::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel()\n {\n if ($this->_model === null)\n {\n if (isset($_GET['id']))\n $this->_model = User::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }", "protected function findModel($id)\n {\n $class = $this->userClassName;\n if (($model = $class::findIdentity($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function loadModel($id)\n\t{\n\t\t$model=Admin::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Accountholder::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = ListOrgKind::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id){\n if (($model = User::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id){\n if (($model = User::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=LicenceApplication::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "protected function findModel($id)\n {\n if (($model = Conlist::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.6860788", "0.67522484", "0.6621091", "0.6521287", "0.6306831", "0.6301965", "0.6232957", "0.6203481", "0.6186248", "0.6177765", "0.60999924", "0.6051429", "0.6030567", "0.60105306", "0.6010337", "0.60079485", "0.5969247", "0.59671825", "0.5952619", "0.5928692", "0.59280086", "0.5909901", "0.5898157", "0.5837155", "0.5789591", "0.5783395", "0.5775167", "0.5767735", "0.5762642", "0.57475835", "0.573407", "0.5733553", "0.57082963", "0.5704756", "0.57002985", "0.5699848", "0.5697612", "0.5697612", "0.5697612", "0.5697612", "0.5689017", "0.56849295", "0.5677417", "0.5659692", "0.56547606", "0.56408113", "0.56408113", "0.56408113", "0.56387436", "0.5626837", "0.5614906", "0.5611626", "0.56101054", "0.5606388", "0.56032616", "0.5601831", "0.56015503", "0.5601235", "0.5596712", "0.55851996", "0.5583819", "0.5583819", "0.5583819", "0.5583819", "0.5580242", "0.55738556", "0.55738556", "0.5565651", "0.5564654", "0.5564197", "0.5563984", "0.5557721", "0.5547733", "0.5544685", "0.55417717", "0.55334026", "0.5530907", "0.5530229", "0.55255425", "0.5524888", "0.55224586", "0.55224454", "0.5520182", "0.5516946", "0.5515741", "0.5509224", "0.55030954", "0.5500278", "0.5485679", "0.5485679", "0.5484016", "0.5481828", "0.5481593", "0.54793876", "0.54779077", "0.5473348", "0.5473348", "0.54726154", "0.5471844", "0.54717714" ]
0.67843777
1
Select object, loaded via ajax method
public function actionActiondropdown($id) { if (Yii::$app->request->isAjax) { echo Common::relatedDropdownList( Action::class, self::CONTROLLER_ID, $id, 'action_id', 'action_name', 'action_name' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectAjax(Request $request) {\n if($request->ajax()){\n \t\t$cost = Part::where('part_number',$request->part_id)->pluck(\"cost\")->all();\n \t\t$data = view('purchaseOrders.ajax-select',compact('cost'))->render();\n \t\treturn response()->json(['options'=>$data]);\n \t}\n }", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function loadAction() {\n \t// set no render\n \t$this->_helper->getHelper('viewRenderer')->setNoRender();\n \t// If you use layout, disable it\n \t$this->_helper->layout()->disableLayout();\n \n \t// Get the id from request\n \t$id = $_POST['id'];\n \tif($id != 0){\n\t \t// Query from database\n\t \t$data = Khcn_Api::_()->getDbTable('bo_mon','default')->getBoMonByDonViAssoc($id);\n\t \t$result = '';\n\t \tforeach ($data as $k=>$v)\n\t \t{\n\t \t\t$result .= '<option value=' . $k . '>' . $v .'</option>';\n\t \t}\n\t \techo $result;\n \t}else{\n \t\techo '<option value=\"0\">===== Chọn bộ môn =====</option>';\n \t}\n }", "public function mostrarSeleccionado(){\n\t\t//se recibe por metodo post el id del estado a mostar\n\t\t$idestado = $_POST['idestado'];\n\t\t$res = Estado::selectEstado($idestado);\n\t\techo json_encode($res);\n\t}", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "public function get_objetivos_estrategicos(){\n if($this->input->is_ajax_request() && $this->input->post()){\n $post = $this->input->post();\n $obj_id = $post['obj_id'];\n $obj_id = $this->security->xss_clean($obj_id);\n\n $dato_obj = $this->model_mestrategico->get_objetivos_estrategicos($obj_id);\n //caso para modificar el codigo de proyecto y actividades\n foreach($dato_obj as $row){\n $result = array(\n 'codigo' => $row['obj_codigo'],\n \"descripcion\" =>$row['obj_descripcion']\n );\n }\n echo json_encode($result);\n }else{\n show_404();\n }\n }", "private function load_selected()\r\n {\r\n $this->arSelected[\"ctx\"] = $this->get_by_id($this->idSelected);\r\n if($this->arSelected[\"ctx\"])\r\n $this->arSelected[\"ctx\"] = $this->arSelected[\"ctx\"][array_keys($this->arSelected[\"ctx\"])[0]];\r\n\r\n $this->arSelected[\"noconfig\"] = $this->get_noconfig_by(\"id\",$this->idSelected);\r\n //pr($this->arSelected,\"arSelected\");\r\n }", "public function select(){\n $records =10;\n $data = $this->repository->getObjects($records);\n $user = $this->returnTr($data);\n $area = Area::all();\n $select = $this->returnOption($area,\"Chọn khu vực\" );\n return response()->json(['user'=>$user,'select'=>$select]); \n }", "public function ajax_get_selected_demo_data() {\n\t\t\t$demo = $_GET['demo_name'];\n\n\t\t\tif ( ! wp_verify_nonce( $_GET['get_selected_demo_data_nonce'], 'get-selected-demo-data' ) ) {\n\t\t\t\tdie( 'This action was stopped for security purposes.' );\n\t\t\t}\n\n\t\t\t$this->init_demos_data();\n\n\t\t\t$this->plugin_installer = new WPEX_Plugin_Installer();\n\t\t\t$this->plugin_installer->set_plugins_data( $this->plugins );\n\n\t\t\t// Extract demo data\n\t\t\t$demo_data = $this->demos[ $demo ];\n\n\t\t\tinclude( 'views/selected.php' );\n\n\t\t\tdie();\n\t\t}", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "public function getSelected() {}", "public function getSelected() {}", "public function action_ajax_doc_as_option()\n\t{\n\n\t\t$option_list = NULL;\n\t\t$id = $this->request->query('c_id');\n\t\t$inner_directory = $this->request->query('inner_directory');\n\t\t$selected = $this->request->query('selected');\n\t\t$selected = explode(',', $selected);\n\n\t\t// Check to see if the directory structure is in place for this client\n\t\tself::quick_directory_check_autonomous($id);\n\n\t\t// Gets all the documents from KT for a given user\n\t\t$question_data = self::doc_acquire_documents($id, $inner_directory);\n\n\t\tif (!empty($question_data))\n\t\t{\n\t\t\t// Creates an array for the database\n\t\t\t$doc_array = self::document_table_builder($question_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$doc_array = NULL;\n\t\t}\n\t\t// Check to see if there are any documents\n\t\tif (empty($doc_array))\n\t\t{\n\t\t\t$option_list = \"<option>No Documents</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($doc_array['document'] as $id => $doc)\n\t\t\t{\n\t\t\t\tif (in_array($doc['id'], $selected))\n\t\t\t\t{\n\t\t\t\t\t$option_list .= '<option value=\"'.$doc['id'].'\" selected>'.$doc['filename'].'</option>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$option_list .= '<option value=\"'.$doc['id'].'\">'.$doc['filename'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo $option_list;\n\t}", "public function ajaxShow()\n {\n return Room::with($this->eagerLoad)->get();\n }", "public function selectSingleObject() {\n\t\t$Object = $this->urlParams['ID'];\n\t\t$ID = $this->urlParams['OtherID'];\n\t\tif($result = DataObject::get_by_id($Object,(int)$ID)) {\n\t\t\t$f = new JSONDataFormatter();\n\t\t\t$json = $f->convertDataObject($result);\n\t\t\treturn \"{\\\"success\\\":true, \\\"data\\\":[$json]}\";\n\t\t} else {\n\t\t\treturn '{\"success\": false, \"data\":[]}';\n\t\t}\n\t}", "public function select(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\tif($this->exists ()) {\r\n\t\t\t\r\n\t\t\t\t$sql = \"SELECT * FROM $this->sqlTable WHERE lp_id = ?\";\r\n\t\r\n\t\t\t\t$stmt = $ks_db->query ( $sql, $this->id );\r\n\t\t\t\t\r\n\t\t\t\t//record is found, associate columns to the object properties\r\n\t\t\t\twhile ( true == ($row = $stmt->fetch ()) ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->id = $row ['lp_id'];\r\n\t\t\t\t\t$this->userid = $row ['lp_userid'];\r\n\t\t\t\t\t$this->random = $row ['lp_random'];\r\n\t\t\t\t\t$this->deadline = $row ['lp_deadline'];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\techo \"No record found with id ($this->id) from table ($this->sqlTable).\";\r\n\t\t\t}\t\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function consultarTiposJSONSelectAction() {\n $select = \"<select>\";\n //$select = $select . \"<option value='' >Seleccione una Acción</option>\";\n $select = $select . \"<option value=\" . User::$VENDEDOR . \" >\" . User::$VENDEDOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$COMPRADOR . \" >\" . User::$COMPRADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$APROBADOR . \" >\" . User::$APROBADOR_TEXT . \"</option>\";\n $select = $select . \"<option value=\" . User::$DIGITADOR . \" >\" . User::$DIGITADOR_TEXT . \"</option>\";\n $select = $select . \"</select>\";\n\n $response = new Response($select);\n return $response;\n }", "function func_lista_motivos ($idmotivo) {\n $ids ['0'] = substr($idmotivo, 0, 1);\n $ids ['1'] = substr($idmotivo, 1, 2);\n $consulta_motivos = mysql_query (\"SELECT * FROM motivos ORDER BY 3\");\n $html_salida = '<select name=\"s_list_motivos\"\n onchange=\"xajax_busca_motivos(document.formulario.s_list_motivos.value);\n xajax_lista_color(document.formulario.s_list_motivos.value);\" >\n <option value=\"0\"> MOTIVOS </option>';\n while ($fila=mysql_fetch_array($consulta_motivos))\n {\n if (($fila['idmotivo'] == $ids['0']) && ($fila['idmotivo2'] == $ids['1']))\n $html_salida.= '<option selected=\"selected\" value=\"'.$fila['idmotivo'].''.$fila['idmotivo2'].'\" >'.$fila['desc'].'</option>';\n else\n $html_salida.= '<option value=\"'.$fila['idmotivo'].''.$fila['idmotivo2'].'\" >'.$fila['desc'].'</option>';\n }\n $html_salida.= '</select>';\n #--\n $html_pre_arribo = '\n <td colspan=\"\">\n <input type=\"button\" value=\"PRE-ARRIBO\" \n onClick=\"window.open(\\'pre_arribo.php?id_motivo=\\'+\\''.$idmotivo.'\\', \n\t\t\t\t \\'INSTRUCCIONES\\', \\'width=480,height=600,scrollbars=yes\\');\" \n />\n </td> ';\n \n\n $salida = $html_salida;\n $respuesta = new xajaxResponse();\n $respuesta->addAssign(\"div_lista_motivos\",\"innerHTML\",$salida);\n $respuesta->addAssign(\"div_pre_arribo\",\"innerHTML\",$html_pre_arribo);\n return $respuesta;\n}", "public function post_select(){\n\n\t\t$income_data \t\t= Filedb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$data \t\t\t\t= array();\n\t\t$data[\"media\"] \t\t= Media::order_by('created_at', 'desc')->get();\n\t\t$data[\"selected\"] \t= (isset($income_data[\"selected\"]) && !empty($income_data[\"selected\"])) ? explode(',', $income_data[\"selected\"]) : array();\n\t\t$data[\"column\"] \t= (isset($income_data[\"column\"])) ? $income_data[\"column\"] : null;\n\n\t\treturn View::make(($income_data['page']) ? $income_data['page'] : 'admin.media.select', $data);\n\t}", "function listadoSelect();", "function ajaxList() {\r\n $this->rdAuth->noStudentsAllowed();\r\n // Set up the list\r\n $this->setUpAjaxList();\r\n // Process the request for data\r\n $this->AjaxList->asyncGet();\r\n }", "#[Route('/ajax/select/maquette', name: 'ajax_select_maquette')]\n public function select(MaquetteRepository $repository, Request $request, RouteRepository $routeRepository)\n {\n\n //Find all maquette\n $allMaquette = $repository->findAll();\n\n $checkHeader = null;\n\n\n foreach($allMaquette as $oneMaquette){\n if($oneMaquette->getId() == $request->get('id')){\n $oneMaquette->setSelecting(true);\n $checkHeader = $oneMaquette->getHeader();\n $checkNavbar = $oneMaquette->getNavbar();\n $routes = $routeRepository->findAll();\n $this->getDoctrine()->getManager()->flush();\n }\n else{\n $oneMaquette->setSelecting(false);\n $this->getDoctrine()->getManager()->flush();\n }\n }\n \n\n \n return $this->json([\n 'html' => $this->renderView('ajax/create-maquette.html.twig', ['maquettes' => $allMaquette,\n 'display' => 'block']),\n 'htmlView' => $this->renderView('component/header.html.twig', ['header' => $checkHeader]),\n 'htmlNavbar' => $this->renderView('component/navbar.html.twig', ['navbar' => $checkNavbar, 'routes' => $routes]),\n ]);\n\n }", "protected function _getLoadSelect($field, $value, $object) {\n\t\t$select = parent::_getLoadSelect($field, $value, $object);\n\n\t\tif ($data = $object->getStoreId()) {\n\t\t\t$select->join(\n\t\t\t\t\tarray('store' => $this->getTable('wizard/wizard_store')), $this->getMainTable().'.group_id = `store`.group_id')\n\t\t\t\t\t->where('`store`.store_id in (0, ?) ', $data);\n\t\t}\n\t\tif ($data = $object->getPageId()) {\n\t\t\t$select->join(\n\t\t\t\t\tarray('page' => $this->getTable('wizard/wizard_page')), $this->getMainTable().'.group_id = `page`.group_id')\n\t\t\t\t\t->where('`page`.page_id in (?) ', $data);\n\t\t}\n\t\tif ($data = $object->getCategoryId()) {\n\t\t\t$select->join(\n\t\t\t\t\tarray('category' => $this->getTable('wizard/wizard_category')), $this->getMainTable().'.group_id = `category`.group_id')\n\t\t\t\t\t->where('`category`.category_id in (?) ', $data);\n\t\t}\n\t\t$select->order('title DESC')->limit(1);\n\n\t\treturn $select;\n\t}", "public function ajaxLoadFormDataAction()\n {\n \t//extract information\n \t$form_id = $this->params()->fromRoute(\"id\", \"\");\n\n \tif ($form_id == \"\")\n \t{\n \t\t//set error message\n \t\treturn new JsonModel(array(\"error\" => \"Field information could not be loaded. Field id or Field Type is not available\"));\n \t}//end if\n\n \t//load the form\n \t$objForm = $this->getFormAdminModel()->getForm($form_id);\n\n \treturn new JsonModel($objForm->getArrayCopy());\n }", "public function selectById($id);", "public function selectById($id);", "public function partysizeajax()\n\t{\n\t\t$vendor_details = $this->request->input('vendor_id');\n\t\t$array = explode(',', $vendor_details);\n\t\t$type = $array[0];\n\t\t$vendor_id =$array[1];\n\t\t$product_id =$array[2];\n\t\tif($type=='alacarte')\n\t\t{\n $aLaCarteID \t\t = $vendor_id;\n\t\t$data['reserveData'] = $this->alacarte_model->getAlacarteLimit($aLaCarteID); \n\t\t$min_people = $data['reserveData'][$aLaCarteID]['min_people'];\n \t\t$max_people = $data['reserveData'][$aLaCarteID ]['max_people'];\n \t\t echo '<select name=\"qty\" id=\"party_size1\" class=\"pull-right space hidden\">\n <option value=\"0\">SELECT</option>';\n for($i=$min_people;$i<=$max_people;$i++)\n {\n echo '<option value=\"'.$i.'\">'.$i.'People</option>';\n \t}\n \n echo '</select>';\n\t\t}\n\t\telse\n\t\t{\n\t\t$data['reserveData'] = $this->experiences_model->getExperienceLimit($product_id);\n\t\t$min_people = $data['reserveData'][$vendor_id]['min_people'];\n \t\t$max_people = $data['reserveData'][$vendor_id ]['max_people'];\n \t\t echo '<select name=\"qty\" id=\"party_size1\" class=\"pull-right space hidden\">\n <option value=\"0\">SELECT</option>';\n for($i=$min_people;$i<=$max_people;$i++)\n {\n echo '<option value=\"'.$i.'\">'.$i.'People</option>';\n \t}\n \n echo '</select>';\n\t\t}\n\t\t\n\t}", "public function Do_select_Example1(){\n\n\t}", "function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM aattribut WHERE aatribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->id_produit = $row->id_produit;\r\n\r\n$this->valeur = $row->valeur;\r\n\r\n}", "public function loadModelSelection($id)\n\t{\n\t\t$model=gSelectionProgress::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function select(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\tif($this->exists ()) {\r\n\r\n\t\t\t\t$sql = \"SELECT * FROM $this->sqlTable WHERE dsh_id = ?\";\r\n\r\n\t\t\t\t$stmt = $ks_db->query ( $sql, $this->id );\r\n\r\n\t\t\t\t//record is found, associate columns to the object properties\r\n\t\t\t\twhile ( true == ($row = $stmt->fetch ()) ) {\r\n\r\n\t\t\t\t\t$this->id = $row ['dsh_id'];\r\n\t\t\t\t\t$this->title = $row ['dsh_title'];\r\n\t\t\t\t\t$this->desc = $row ['dsh_desc'];\r\n\t\t\t\t\t$this->portlet = $row ['dsh_portlet'];\r\n\t\t\t\t\t$this->hide = $row ['dsh_hide'];\r\n\t\t\t\t\t$this->createdBy = $row ['dsh_created_by'];\r\n\t\t\t\t\t$this->modifiedBy = $row ['dsh_modified_by'];\r\n\t\t\t\t\t$this->createdDate = $row ['dsh_created_date'];\r\n\t\t\t\t\t$this->modifiedDate = $row ['dsh_modified_date'];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\techo \"No record found with primary column ($this->id) from table ($this->sqlTable).\";\r\n\t\t\t}\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function get_ajax_models()\n {\n\n $dealerId = get_option(\"at_dealer_id\");\n $dealers = explode(',', $dealerId);\n \n if(isset($_POST['brand_id'])){\n $brandId = $_POST['brand_id'];\n\n var_dump($brandId);\n \n $json = file_get_contents(\"http://auto.best4u.nl/\" . $dealers[0] . \"/brand/\".$brandId.\"/models/?dealers=\".$dealerId.\"\");\n\n var_dump($json);\n\n var_dump(\"http://auto.best4u.nl/\" . $dealers[0] . \"/brand/\".$brandId.\"/models/?dealers=\".$dealerId.\"\");\n\n $all_models = '';\n foreach (json_decode($json)->data as $key => $model) {\n $all_models .= \"<option value='\".$model->id.\"' class='modelOption'>\".$model->title.\"</option>\";\n }\n \n echo $all_models;\n\n }\n}", "public function ajax_load_available_items()\n {\n }", "public function getSelect();", "public function getSelect();", "function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM attribut WHERE attribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->nom = $row->nom;\r\n\r\n}", "public function ajax() {\n \n // Get action's get input\n $action = $this->CI->input->get('action');\n\n if ( !$action ) {\n $action = $this->CI->input->post('action');\n }\n \n try {\n\n // Call method if exists\n (new MidrubBaseAdminCollectionFrontendControllers\\Ajax)->$action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n }", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "public function ajaxCargarCategorias(){\n\n\t\t$item = \"id_area\";\n\t\t$valor = $this->id_area;\n\t\t\n\t\t$respuesta = ControladorCategorias::ctrMostrarCategoriasxArea($item, $valor);\n\t\n\t\t$categorias = '<option value=\"0\" id=\"editarListaCategoria\">Elige una Categoría</option>';\n\n\t\t\tforeach ($respuesta as $key => $res)\n\t\t\t{\n\t\t\t\t$categorias .= \"<option value='$res[id]'>$res[categoria]</option>\";\n\t\t\t}\n\t\techo $categorias ;\n\t}", "public function ajaxVisuaDocente(){\n $item =\"id\";\n $valor = $this->idDocente;\n $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor);\n echo json_encode($respuesta);\n\n}", "public function selectArticle()\n\t{\n\t}", "public function load_parent_category_item_field_ajax(){\r\n\t\t$rslt = $this->get_parent_categories();\r\n\r\n\t\techo json_encode($rslt);\r\n\t\tdie();\r\n\t}", "function selectzone() {\n if (isset($_POST['isactive'])) {\n $data = Zone::model()->isactive()->findAllByAttributes(array('country_id' => (int) $_POST['country_name']));\n } else {\n $data = Zone::model()->findAllByAttributes(array('country_id' => (int) $_POST['country_name']));\n }\n $data = CHtml::listData($data, 'zone_id', 'zone_Name');\n if (count($data)) {\n foreach ($data as $value => $name) {\n echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);\n }\n } else {\n echo CHtml::tag('option', array('value' => '0'), CHtml::encode('No Zone available'), true);\n }\n }", "function select($id)\n\t{\n\treturn parent::select($id);\n\t}", "function select($id)\n\t{\n\treturn parent::select($id);\n\t}", "public function ajaxGetAction()\n {\n $this->view->disable();\n $response = new \\Phalcon\\Http\\Response();\n if (!$this->request->isAjax()) {\n echo \"is not Ajax ! \";\n }\n if (!$this->request->isPost()) {\n echo \"is not Post ! \";\n }\n $tokuisaki_bunrui4 = TokuisakiBunrui4Kbns::find(array(\n 'order' => 'cd',\n 'conditions' => ' cd LIKE ?1 ',\n 'bind' => array(1 => $this->request->getPost('cd').'%')\n ));\n $res_flds = [\"id\",\"cd\",\"name\",];\n $resData = array();\n foreach ($tokuisaki_bunrui4 as $bunrui4) {\n $resAdata = array();\n foreach ($res_flds as $res_fld) {\n $resAdata[$res_fld] = $bunrui4->$res_fld;\n }\n $resData[] = $resAdata;\n }\n $response->setContent(json_encode($resData));\n return $response;\n }", "function listeRubrique_article($rub_selected)\n{\n\techo \"<select name='rubrique'>\";\n\t$req = mysql_query(\"SELECT * FROM RUBRIQUE WHERE `id_mere` is null;\");\n\twhile($rubrique=mysql_fetch_array($req))\n\t{\n\t\t$selected = \"\";\n\t\tif($rub_selected == $rubrique['id_rubrique'])\n\t\t\t$selected = \"selected='selected'\";\n\t\techo \"<option value='\".$rubrique['id_rubrique'].\"'\".$selected.\">\".$rubrique['titreFR_rubrique'].\"</option>\";\n\t\tgetChildRubrique_article($rubrique['id_rubrique'],0,$rub_selected);\n\t}\n\techo \"</select>\";\n}", "function selec_id_ajax_callback() {\n\t\tglobal $wpdb; // this is how you get access to the database\n\n\t\tif($_REQUEST['get'] == true){\n\n\n\t\t$fivesdrafts = $wpdb->get_results( \n\t\t\t\"\nSelect\n wp_posts.ID As id,\n wp_posts.post_title As text\nFrom\n wp_posts \nWhere\n wp_posts.ID = '\".$_REQUEST['q'].\"'\",\n\t\t\t\"ARRAY_A\"\n\t\t);\n\n\n\t\t} else {\n\n\n\t\t\t$fivesdrafts = $wpdb->get_results( \n\t\t\t\"\nSelect\n wp_posts.ID As id,\n wp_posts.post_title As text\nFrom\n wp_posts Inner Join\n wp_crm_clientes_datos_agencia On wp_crm_clientes_datos_agencia.post_id =\n wp_posts.ID\nWhere\n (wp_posts.ID Like '%\".$_REQUEST['q'].\"%' And\n wp_posts.post_type = 'clientes' And\n wp_posts.post_status = 'publish') Or\n (wp_posts.post_title Like '%\".$_REQUEST['q'].\"%') Or\n (wp_crm_clientes_datos_agencia.cliente_telefono_principal Like '%\".$_REQUEST['q'].\"%') Or\n (wp_crm_clientes_datos_agencia.cliente_email_principal Like '%\".$_REQUEST['q'].\"%') Or\n (wp_crm_clientes_datos_agencia.cliente_propietario Like '%\".$_REQUEST['q'].\"%')\n\t\t\t\",\n\t\t\t\"ARRAY_A\"\n\t\t);\n\n\n\t\t}\n\t\t\n\n\t\t$data = array();\n\n\t\t$data['id'] = 9;\n\t\t$data['text'] = 'Antonio';\n\n\t\techo apply_filters('remo/set_jsonp' , $fivesdrafts );\n\n\t\techo $wpdb->show_errors();\n\n\t\tdie(); // this is required to return a proper result\n\t}", "public function ajaxRequest()\n {\n $data['data'] = $this->db->get(\"balance_type\")->result();\n $this->load->view('ajax/itemlist', $data);\n }", "public function select_code(){\n\t\t$county_code = M( 'county_code' )->where( array('county_name'=> I('post.name') ) )->select();\n\t\t// $county_code_json = json_encode( $county_code );\n\t\t$code_return=$county_code['county_code'];\n\t\t$code_json = json_encode( $county_code );\n\t\t// $this->ajaxReturn( $county_code_json,'JSON' );\n\t\t$this->ajaxReturn( $code_json,'JSON' );\n\n\t}", "public function autoCompleteList(){\n $this->layout='ajax';\n $this->autoRender =false;\n if($this->request->is('ajax')){\n $result = $this->Technology->find('list');\n echo json_encode($result);\n }\n }", "public function bitorondropdown(){\n\t\tif(!empty($_REQUEST['id'])){\n\t\t\t$this->layout='ajax';\n\t\t\t//$this->loadModel('Maincategory');\n\t\t\t$childCatIds = $this->Childcategory->find('list',array('fields'=>array('id','name'),\n\t\t\t\t'conditions' =>array('maincategory_id' =>$_REQUEST['id'])));\n\n\t\t\t$this->set(compact('childCatIds'));\n\t\t}\n\n\t}", "public function ajaxProcessSearchProduct()\n {\n }", "public function load_states()\n {\n if (!$this->input->is_ajax_request()) {\n show_404();\n exit;\n }\n $data = $this->ajax_model->load_state();\n if($this->input->post('isSelected'))\n {\n $selected = ' selected=\"selected\" ';\n }\n else\n {\n $selected = '';\n }\n $op = '<option value=\"0\">انتخاب کنید...</option>';\n if($data AND is_array($data) AND count($data) > 0)\n {\n for($i = 0; $i < count($data); $i++)\n {\n if($this->input->post('isSelected') == $data[$i]['id'])\n {\n $op .= '<option value=\"' . $data[$i]['id'] . '\"' . $selected . '>' . $data[$i]['name'] . '</option>';\n }\n else\n {\n $op .= '<option value=\"' . $data[$i]['id'] . '\">' . $data[$i]['name'] . '</option>';\n }\n }\n }\n \n echo $op;\n }", "public function ajax_load() {\n\t\t$wrapper = new netxRestWrapper();\n\t\t$netx = $wrapper->getNetx();\n\t\t$cats = $netx->getCategoryTree();\n\t\t$options = get_option('netx_options');\n\t\t?>\n\t\t<form id=\"netx-form\" class=\"media-upload-form validate\" action=\"<?php echo get_bloginfo(\"url\"); ?>/wp-admin/media-upload.php?post_id=<?php echo $postID; ?>&tab=netx\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<div id=\"category-tree\">\n\t\t\t\t<ul>\n\t\t\t\t\t<?php $this->tree_node_view($this->getRootCategoryFromTree($cats['1']['children'], $options['netx_base_category_id']), $options['netx_base_category_id']); ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\n\t\t\t<div id=\"media-items\">\n\t\t\t\t<div class=\"netx-upload-loading-area\">\n\t\t\t\t\t<div class=\"netx-spinner\">\n\t\t\t\t\t\t<div class=\"netx-dot1\"></div>\n\t\t\t\t\t\t<div class=\"netx-dot2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"clear-fix\"></div>\n\t\t</form>\n\t\t<?php\n\t\twp_die();\n\t}", "public function action_user_selected()\n {\n $user = new Model_User();\n $user->find((int) $this->request->param('user_id'));\n $values = $user->values();\n $values['user_name'] = $user->name;\n $this->request->response = JSON_encode($values);\n }", "protected function _getLoadSelect($field, $value, $object)\n {\n $select = parent::_getLoadSelect($field, $value, $object);\n\t\t\n\t\t//Joins\n $select->join(\n\t\t\t\tarray('mtu' => $this->getTable('magebid/transaction_user')),\n\t\t\t\t $this->getMainTable().'.magebid_transaction_id = mtu.magebid_transaction_id');\n\n\t\t\t\t\n\t\treturn $select;\n\t}", "public function ajaxAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n $actionAjax = $this->_getParam('actionAjax');\n $oCategory = new CategoriesObject();\n switch($actionAjax)\n {\n case 'addCategory':\n\n break;\n case 'editCategory':\n break;\n default:\n break;\n }\n return $data;\n }", "public function action_lecturer_selected()\n {\n $lecturer = new Model_Lecturer();\n $lecturer->find((int) $this->request->param('lecturer_id'));\n $values = $lecturer->values();\n $values['lecturer_name'] = $lecturer->name;\n $this->request->response = JSON_encode($values);\n }", "function select($id)\n{\n\n$sql = \"SELECT * FROM test WHERE id = $id;\";\n$result = $this->database->query($sql);\n$result = $this->database->result;\n$row = mysql_fetch_object($result);\n\n\n$this->id = $row->id;\n\n$this->name = $row->name;\n\n$this->vorname = $row->vorname;\n\n$this->adresse = $row->adresse;\n\n$this->telefon = $row->telefon;\n\n$this->jahr = $row->jahr;\n\n}", "function getjsOnSelect () { return $this->readjsOnSelect(); }", "protected function _getLoadSelect($field, $value, $object)\n {\n $select = parent::_getLoadSelect($field, $value, $object);\n\n /*$select->joinLeft(\n ['admin_user' => $this->getTable('admin_user')],\n $this->getMainTable() . '.admin_id = admin_user.user_id',\n ['username']\n )->where(\n $this->getMainTable() . '.is_active = ?',\n 1\n )->limit(\n 1\n );*/\n\n return $select;\n }", "function getDataToSelectedSubcat($id = NULL) {\n $this->loadModel('ServicesUnitPrices');\n $this->loadModel('ServiceDjEventPrices');\n $this->loadModel('Xetras');\n $this->loadModel('Guests');\n $this->loadModel('Musics');\n $this->loadModel('AdditionalServices');\n\n $this->viewBuilder()->layout('ajax_front');\n\n if ($this->request->is('ajax')) {\n\n $musicsNameList = $this->Musics->find('list', ['keyField' => 'id', 'valueField' => ['music_name']])->where(['status' => Active, 'delete_status' => NotDeleted]);\n $additionalServicesNameList = $this->AdditionalServices->find('list', ['keyField' => 'id', 'valueField' => ['additional_services_name']])->where(['status' => Active, 'delete_status' => NotDeleted]);\n $equipmentProvidedList = array('The Venue' => 'The Venue', 'The DJ' => 'The DJ');\n $eventsPlaceList = array('Indoors' => 'Indoors', 'Outdoors' => 'Outdoors', 'Not sure yet' => 'Not sure yet');\n $this->set(compact('musicsNameList', 'noOfPeopleList', 'additionalServicesNameList', 'equipmentProvidedList', 'eventsPlaceList'));\n\n\n $servicesUnitPrices = $this->ServicesUnitPrices->find()->where(['ServicesUnitPrices.sub_services_id' => $id, 'status' => Active, 'delete_status' => NotDeleted])->hydrate(false)->toArray();\n $serviceDjEventPrices = $this->ServiceDjEventPrices->find()->where(['ServiceDjEventPrices.sub_services_id' => $id])->contain(['Events'])->hydrate(false)->toArray();\n $xetrasPrices = $this->Xetras->find()->where(['Xetras.sub_services_id' => $id, 'status' => Active, 'delete_status' => NotDeleted])->hydrate(false)->toArray();\n $noOfPeopleList = $this->Guests->find('list', ['keyField' => 'id', 'valueField' => ['no_of_people']])->where(['status' => Active, 'delete_status' => NotDeleted]);\n\n $this->set(compact('servicesUnitPrices', 'serviceDjEventPrices', 'xetrasPrices', 'noOfPeopleList'));\n if (!empty($servicesUnitPrices)) {\n $this->viewBuilder()->templatePath('Element' . DS . 'frontElements' . DS . 'servicesunitprice');\n $this->render('index');\n }\n if (!empty($serviceDjEventPrices)) {\n $this->viewBuilder()->templatePath('Element' . DS . 'frontElements' . DS . 'servicesdjeventprice');\n $this->render('index');\n }\n }\n }", "function montar_select_perfilPaciente(&$select_perfis, $objPerfilPaciente, $objPerfilPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_perfis = $objPerfilPacienteRN->listar($objPerfilPaciente);\n\n $select_perfis = '<select class=\"form-control selectpicker\" onchange=\"val()\" id=\"select-country idSel_perfil\"'\n . ' data-live-search=\"true\" name=\"sel_perfil\">'\n . '<option data-tokens=\"\" ></option>';\n\n foreach ($arr_perfis as $perfil) {\n $selected = '';\n if ($perfil->getIdPerfilPaciente() == $objPaciente->getIdPerfilPaciente_fk()) {\n $selected = 'selected';\n }\n\n $select_perfis .= '<option ' . $selected . ' value=\"' . $perfil->getIdPerfilPaciente() . '\" data-tokens=\"' . $perfil->getPerfil() . '\">' . $perfil->getPerfil() . '</option>';\n }\n $select_perfis .= '</select>';\n}", "function ajaxPhotographyDetails(){\n\t\n\t\t$this->loadModel('Photographer');\n\t\t$photographer = $this->Photographer->find('first',array('conditions'=>array('Photographer.id'=>$_POST['id'])));\n\t\t$photographerArr[\"name\"]= $photographer['Photographer']['name'];\n\t\t$photographerArr[\"mobile\"]= $photographer['Photographer']['mobile'];\n\t\t$photographerArr[\"website\"]= $photographer['Photographer']['website'];\n\t\t$photographerArr[\"email\"]= $photographer['User']['email'];\n\t\techo json_encode($photographerArr);\n\t\texit;\n\t\n\t}", "function parsePlayers(){\n $players = $this->Players->getPlayer();\n $x = array();\n foreach ($players as $player) {\n $x[$player['Player']] = $player['Player'];\n }\n //Parse selected player to a url and redirect it to show info accordingly\n $js = 'id=\"players\" onChange=\"select_player(this);\"';\n $this->data['players'] = form_dropdown('players',$x,$js);\n }", "function getOptionsByQuestionnaireIdInAJAX($qn_id)\n\t\t{\n\t\t\t$this->load->model('Options_model');\n\t\t\treturn $this->Options_model->getOptionsByQuestionnaireId( $qn_id );\n\t\t}", "public function ajaxTraerPrestamo(){\n\n\t\t$item = \"idPrestamo\";\n\t\t$valor = $this->idPrestamo;\n\n\t\t$respuesta = ControladorArticulos::ctrBuscarPrestamo($item, $valor);\n\n\t\techo json_encode($respuesta);\n\n\t}", "function get_selected()\n {\n }", "public function ajaxTraerEspecialidad(){\n\n\t\t$item = \"idEspecialidad\";\n\t\t$valor = $this->idEspecialidad;\n\t\t$respuesta = ControladorAdmision::ctrMostrarEspecialidad($item, $valor);\n\n\t\techo json_encode($respuesta);\n\n\t}", "function selectproduct() {\n\n\n $data = array();\n //\t$data['body']=\"Select products from the dropdown\";\n $data['data'] = $this->Leads_model->get_products();\n // print_r($data); die;\n $this->load->view('product/selectproducts', $data);\n }", "public function busca_ajax($texto='')\n\t{\n\t\t$modelClass \t= $this->modelClass;\n\t\t$campo\t\t\t= isset($this->$modelClass->displayField) ? $this->$modelClass->displayField : 'nome';\n\t\t$this->layout\t= 'ajax';\n\t\tif ($this->usarScaffolds) $this->viewPath = 'Scaffolds';\n\t\t$opc\t= array();\n\t\t$opc['order'][$modelClass.'.'.$campo] = 'asc';\n\t\t$opc['fields'] = array($modelClass.'.uf',$modelClass.'.nome');\n\t\t$opc['conditions'][$modelClass.'.'.$campo] = array(\"\\$regex\" => \".*\".mb_strtoupper($texto).\".*\");\n\t\t$opc['limit'] = 30;\n\t\t\n\t\t$data = array();\n\t\t$_data = $this->$modelClass->find('list',$opc);\n\t\tforeach($_data as $_uf => $_cidade)\n\t\t{\n\t\t\t$data[$_cidade.' / '.$_uf] = $_cidade.' / '.$_uf;\n\t\t}\n\t\t\n\t\t$this->data = $data;\n\t}", "public function buscarProvincia(Request $request){\n\n //$request->id here is the id of our chosen option id\n $data=Provincia::select('nombre','idprovincia')->where('idpais',$request->id)->take(100)->get();\n return response()->json($data);//then sent this data to ajax success\n }", "function montar_select_sexo(&$select_sexos, $objSexoPaciente, $objSexoPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_sexos = $objSexoPacienteRN->listar($objSexoPaciente);\n\n $select_sexos = '<select onfocus=\"this.selectedIndex=0;\" onchange=\"val_sexo()\" '\n . 'class=\"form-control selectpicker\" id=\"select-country idSexo\" data-live-search=\"true\" '\n . 'name=\"sel_sexo\">'\n . '<option data-tokens=\"\"></option>';\n\n foreach ($arr_sexos as $sexo) {\n $selected = '';\n if ($sexo->getIdSexo() == $objPaciente->getIdSexo_fk()) {\n $selected = 'selected';\n }\n $select_sexos .= '<option ' . $selected . ' value=\"' . $sexo->getIdSexo() . '\" data-tokens=\"' . $sexo->getSexo() . '\">' . $sexo->getSexo() . '</option>';\n }\n $select_sexos .= '</select>';\n}", "function object_select_tag($object, $method, $options = array(), $default_value = null)\r\n{\r\n $options = _parse_attributes($options);\r\n\r\n $related_class = _get_option($options, 'related_class', false);\r\n if (false === $related_class && preg_match('/^get(.+?)Id$/', $method, $match))\r\n {\r\n $related_class = $match[1];\r\n }\r\n\r\n $peer_method = _get_option($options, 'peer_method');\r\n\r\n $text_method = _get_option($options, 'text_method');\r\n\r\n $select_options = _get_options_from_objects(sfContext::getInstance()->retrieveObjects($related_class, $peer_method), $text_method);\r\n\r\n if ($value = _get_option($options, 'include_custom'))\r\n {\r\n $select_options = array('' => $value) + $select_options;\r\n }\r\n else if (_get_option($options, 'include_title'))\r\n {\r\n $select_options = array('' => '-- '._convert_method_to_name($method, $options).' --') + $select_options;\r\n }\r\n else if (_get_option($options, 'include_blank'))\r\n {\r\n $select_options = array('' => '') + $select_options;\r\n }\r\n\r\n if (is_object($object))\r\n {\r\n $value = _get_object_value($object, $method, $default_value);\r\n }\r\n else\r\n {\r\n $value = $object;\r\n }\r\n\r\n $option_tags = options_for_select($select_options, $value, $options);\r\n\r\n return select_tag(_convert_method_to_name($method, $options), $option_tags, $options);\r\n}", "public function ajaxVenueDetails(){\n\t\n\t\t$this->loadModel('Venue');\n\t\t$venues = $this->Venue->find('first',array('conditions'=>array('Venue.id'=>$_POST['id'])));\n\t\t$venuesArr[\"name\"]= $venues['Venue']['name'];\n\t\t$venuesArr[\"mobile\"]= $venues['Venue']['mobile'];\n\t\t$venuesArr[\"address\"]= $venues['Venue']['address'].','.$venues['Venue']['town'].','.$venues['Venue']['county'];\n\t\t$venuesArr[\"postcode\"]= $venues['Venue']['postcode'];\n\t\techo json_encode($venuesArr);\n\t\texit;\n\t\n\t}", "function wp_ajax_fetch_list()\n {\n }", "public function select_data_partners(){\n echo json_encode($this->db->get('table_partners')->result());\n }", "public function ajax_details()\n\t{\n\t\t$member_id = $this->input->post(\"id\");\n\t\t\n\t\t$returnAJAX = $this->members_model->read_form($member_id);\n\n\t\techo json_encode($returnAJAX);\n\t}", "public function ajaxMostrarProductos(){\n\n $item = null;\n $valor = null;\n\n $respuesta = ProductosControlador::ctrMostrarProductos($item, $valor);\n\n echo json_encode($respuesta);\n\n }", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "function show ($id) {\n\n\tglobal $conn;\n\n\t$object = array();\n\t// Query to select the object.\n\t$sql = 'SELECT * FROM request WHERE id =' . $id;\n\n\tif(!$r = $conn->prepare($sql)){\n\t\techo 'Prepare statement failed';\n\t\tdie();\n\t}\n\n\tif(!$r->execute()) {\n\t\techo 'Execute failed.';\n\t\tdie();\n\t}\n\n\t$r = $r->get_result();\n\n\tif(!$r->num_rows) {\n\t\techo 'No data found.';\n\t\tdie();\n\t}\n\n\t$object = $r->fetch_assoc();\n\n\t// while ($d = $r->fetch_assoc()) {\n\t// \t$object[] = $d;\n\t// }\n\n\t$r->free();\n\t// echo '<pre>';\n\t// print_r($object);\n\t// echo '</pre>';\n\n\t// Load the view file.\n\n\tinclude 'request-show-view.php';\n}", "function __select( $hidden = true ) {\n\t\t$data = '';\n\t\tif( $hidden === true ) {\n\t\t\t// use hyperv-vm.select.class\n\t\t\trequire_once($this->rootdir.'/plugins/hyperv/class/hyperv-vm.select.class.php');\n\t\t\t$controller = new hyperv_vm_select($this->htvcenter, $this->response);\n\t\t\t$controller->actions_name = $this->actions_name;\n\t\t\t$controller->tpldir = $this->tpldir;\n\t\t\t$controller->message_param = $this->message_param;\n\t\t\t$controller->lang = $this->lang['select'];\n\t\t\t$data = $controller->action();\n\t\t}\n\t\t$content['label'] = $this->lang['select']['tab'];\n\t\t$content['value'] = $data;\n\t\t$content['target'] = $this->response->html->thisfile;\n\t\t$content['request'] = $this->response->get_array($this->actions_name, 'select' );\n\t\t$content['onclick'] = false;\n\t\tif($this->action === 'select'){\n\t\t\t$content['active'] = true;\n\t\t}\n\t\treturn $content;\n\t}", "public function ajaxTraerTExam(){\n\n\t\t$item = \"idExamen\";\n\t\t$valor = $this->idEspecialidad;\n\t\t$respuesta = ModeloAdmision::mdlMostrar(\"examen\",$item, $valor);\n\t\techo json_encode($respuesta);\n\n\t}", "static public function ctrCargarSelectModalidad(){\r\n\r\n $tabla = \"tbl_modalidades\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "public function select($id)\t{\n\t\t\t$this->data = (array) \n\t\t\t\tself::$db->queryFetch(\n\t\t\t\t\t\"SELECT * FROM `{$this->table}` WHERE `id`=:id\",\n\t\t\t\t\tarray(':id'=>$id)\n\t\t\t\t);\n\t\t}", "public function ajax()\n {\n /*if($name!=\"\"){\n switch($name){\n case 'change_active':\n $post['active'] = $status;\n $this->User_model->update($post, $id); \n break;\n } \n exit;\n }*/\n \n $this->app->get_table_data('users'); \n }", "public function actionAjaxLoad()\r\n {\r\n \treturn $this->render('ajax-load');\r\n }", "public function order_ajax ()\n {\n if (isset($_POST['sortable'])) {\n $this->slider_model->save_order($_POST['sortable']);\n }\n \n // Fetch all pages\n $this->data['pages'] = $this->slider_model->get_nested($this->data['content_language_id']);\n \n // Load view\n $this->load->view('admin/sliders/order_ajax', $this->data);\n }", "public function selecionarAction() { \r\n // Recupera os parametros da requisição\r\n $params = $this->_request->getParams();\r\n \r\n // Instancia a classes de dados\r\n $menus = new WebMenuSistemaModel();\r\n \r\n // Retorna para a view os menus cadastrados\r\n $this->view->menus = $menus->getMenus();\r\n \r\n // Define os filtros para a cosulta\r\n $where = $menus->addWhere(array(\"CD_MENU = ?\" => $params['cd_menu']))->getWhere();\r\n \r\n // Recupera o sistema selecionado\r\n $menu = $menus->fetchRow($where);\r\n \r\n // Reenvia os valores para o formulário\r\n $this->_helper->RePopulaFormulario->repopular($menu->toArray(), \"lower\");\r\n }", "public function ajaxListAction() {\n $oTable = new \\Commun\\Grid\\GuildesGrid($this->getServiceLocator(), $this->getPluginManager());\n $oTable->setAdapter($this->getAdapter())\n ->setSource($this->getTableGuilde()->getBaseQuery())\n ->setParamAdapter($this->getRequest()->getPost());\n return $this->htmlResponse($oTable->render());\n }", "protected function _getLoadSelect($field, $value, $object)\n {\n $select = parent::_getLoadSelect($field, $value, $object);\n\n if ($object->getStoreId()) {\n\n $select->where(\n 'is_active = ?',\n 1\n )->limit(\n 1\n );\n }\n\n return $select;\n }", "public function ajaxDormitoryRoom() {\n $id = $this->input->get('q');\n $query = $this->common->getWhere('dormitory', 'id', $id);\n foreach ($query as $row) {\n $roomAmount = $row['room_amount'];\n }\n echo '<option value=\"\">' . lang('dorc_1') . '</option>';\n for ($i = 1; $i <= $roomAmount; $i++) {\n echo '<option value=\"Room No: ' . $i . '\">Room No: ' . $i . ' </option>';\n }\n }", "public function selectMember() {\n $data['dormitories'] = $this->common->getAllData('dormitory');\n $this->load->view('temp/header');\n $this->load->view('selectMember', $data);\n $this->load->view('temp/footer');\n }", "public function ajax()\n {\n $this->app->get_table_data('discountlevels');\n }", "protected function _getLoadSelect($field, $value, $object)\n {\n $select = parent::_getLoadSelect($field, $value, $object);\n\n if ($object->getStoreId()) {\n $select->where(\n 'is_active = ?',\n 1\n )->limit(\n 1\n );\n }\n\n return $select;\n }", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function select_code_jurisdiction(){\n\t\t$jurisdiction = M( 'jurisdiction' )->where( array('county_name'=> I('post.name') ) )->select();\n\t\t// $county_code_json = json_encode( $county_code );\n\t\t$jurisdiction_json = json_encode( $jurisdiction );\n\t\t// $this->ajaxReturn( $county_code_json,'JSON' );\n\t\t$this->ajaxReturn( $jurisdiction_json,'JSON' );\n\n\t}", "protected function ajaxRechercherUnVelo()\n\t{\n\t\t$lesVelos = null;\n\n\t\t\t/** si valeur, on lance la recherche */\n\t\tif(isset($_GET['valeur']) and $_GET['valeur'] !== '')\n\t\t\t$lesVelos = $this->odbVelo->searchVelos($_GET['valeur']);\n\t\telse\n\t\t\t$lesVelos = $this->odbVelo->getNouveauxVelos();\n\n\t\t\t// si pas de velo, erreur\n\t\tif (empty($lesVelos))\n\t\t\t$_SESSION['tampon']['error'][] = 'Pas de v&eacute;lo...';\n\n\t\t\t/**\n\t\t\t * Load des vues\n\t\t\t */\n\t\tview('contentAllVelo', array('lesVelos'=>$lesVelos, 'isAjax'=>true));\n\t}", "public function select()\n {\n\n }", "function load(){\n\t\t\tif (isset($this->params['id'])){\n\t\t\t\tif (isset($_GET['pag'])){\n\t\t\t\t\t$_GET['pag']=filter_input(INPUT_GET, 'pag', FILTER_SANITIZE_STRING);\n\t\t\t\t}else{\n\t\t\t\t\t$_GET['pag']=1;\n\t\t\t\t}\n \t\t/*$idCategoria=filter_input(INPUT_POST, 'idCategoria', FILTER_SANITIZE_STRING);\n\t\t\t\t$pagina=filter_input(INPUT_POST, 'pagina', FILTER_SANITIZE_STRING);*/\n\t\t\t\t$res=$this->model->comprobarExisteCategoria($this->params['id']);\n\t\t\t\tif($res==true){\n\t\t\t\t\t$contGames=$this->model->contadorPaginasGamesCategoria($this->params['id']);\n\t\t\t\t\tif($_GET['pag']<=$contGames[0][\"maxPaginas\"]){\n\t\t\t\t\t\t$games=$this->model->gamesCategoria($this->params['id'],$_GET['pag']);\n\t\t\t $games=utf8_string_array_encode($games);\n\t\t\t $parametros = array_merge($this->menu, $games, $contGames);\n\t\t \t$this->view= new vCategoria($parametros);\n\t\t\t\t\t}else{\n\t\t\t\t\t\theader(\"Location: \".APP_W.'categoria/load/id/'.$this->params['id']);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\theader(\"Location: \".APP_W);\n\t\t\t\t}\n \t}\n }" ]
[ "0.611564", "0.59635013", "0.5819561", "0.56542075", "0.56440973", "0.55629385", "0.55489326", "0.55189013", "0.54566455", "0.5445164", "0.54258806", "0.54258806", "0.5411639", "0.54069906", "0.5383189", "0.53805023", "0.5376413", "0.5365321", "0.53511757", "0.53405", "0.5336304", "0.5333879", "0.53297406", "0.5321406", "0.5316072", "0.5316072", "0.5278031", "0.5276062", "0.52724487", "0.5270499", "0.5269011", "0.52597564", "0.52528167", "0.52499235", "0.52499235", "0.52475846", "0.524359", "0.52328616", "0.52323365", "0.5232064", "0.52296704", "0.5226007", "0.5212526", "0.5212291", "0.5212291", "0.5204836", "0.5196047", "0.51952326", "0.51944995", "0.5183396", "0.51698697", "0.5164228", "0.5163235", "0.51574814", "0.5145682", "0.51268303", "0.51224655", "0.51069957", "0.510612", "0.51031196", "0.51022804", "0.5101335", "0.5085521", "0.5082909", "0.5082333", "0.50814754", "0.508097", "0.5078046", "0.50750285", "0.507478", "0.5071949", "0.5067686", "0.506525", "0.50619006", "0.5061036", "0.5053601", "0.5040079", "0.50370413", "0.5036077", "0.50314075", "0.502824", "0.5021037", "0.501709", "0.50134665", "0.5001362", "0.5000029", "0.4994257", "0.49935025", "0.49891764", "0.49873096", "0.49804553", "0.49764305", "0.49726605", "0.49685037", "0.49663952", "0.49577382", "0.4951274", "0.49508348", "0.4939668", "0.4934345", "0.49323046" ]
0.0
-1
Lists all Permission models.
public function actionIndex() { $sm_permission = new PermissionSearch(); $dp_permission = $sm_permission->search( Yii::$app->request->queryParams ); $pageSize = $this->pageSize(); $dp_permission->pagination->pageSize = $pageSize; return $this->render( ACTION_INDEX, [ 'dataProvider' => $dp_permission, PAGE_SIZE => $pageSize, 'searchModel' => $sm_permission, 'controller_id' => $sm_permission->controller_id ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "public function index()\n {\n return $permissions = $this->permission->all();\n }", "public function all() : Collection\n {\n return Permission::all();\n }", "public static function getAllPermissions()\n\t{\n\t\treturn Permission::all();\n\t}", "public function permissions()\n {\n\n return Permission::all();\n }", "public function getAllPermissions();", "public function getAllPermissions();", "public static function getAllPermissions()\n {\n return Cache::rememberForever('permissions.all', function() {\n return self::all();\n });\n }", "public function index()\n {\n $permissions = Permission::with('roles','users')->orderBy('name')->get();\n\n return $permissions;\n }", "function list()\n {\n if($this->checkAccess('permission.list') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n { \n \n $data['permissionRecords'] = $this->permission_model->permissionListing();\n \n $this->global['pageTitle'] = 'School : Permission Listing';\n \n $this->loadViews(\"permission/list\", $this->global, $data, NULL);\n }\n }", "public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }", "public function index()\n {\n $permissions = Permission::get();\n\n return $this->respond([\n 'items' => $this->transformCollection($permissions, new PermissionTransformer()),\n ]);\n }", "public function index()\n {\n $permissions = Permission::paginate(20);\n return view('backend.permissions', ['permissions' => $permissions]);\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "public function permissions()\n {\n $model = config('authorization.permission');\n\n return $this->belongsToMany($model);\n }", "public function index()\n {\n $perms = Permission::all();\n return view('admin.permissions.index', ['permissions' => $perms]);\n }", "public function index()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n\n $permissions = Permission::all()->groupBy(function($permission){\n return explode('.', $permission->name)[0]??null;\n });\n $roles = Role::all();\n //dd($permissions);\n return view('admin.permissions.index', compact('permissions', 'roles'));\n }", "public function getAllPermissions(): array;", "public function index() {\n $permissions = Permission::orderBy('id','desc')->paginate(10); //Get all permissions\n\n return view('permissions.index')->with('permissions', $permissions);\n }", "public function fetchAll()\n\t{\n\t\t$permissions = $this->getRoleModel()->fetchAll();\n\t\treturn $permissions;\n\t}", "public function actionIndex()\n {\n $request = Yii::$app->request;\n $searchModel = new PermissionFormSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'menuList' => $this -> menuList,\n ] + $request->get()\n );\n }", "public function getAllPermissions()\n {\n return $this->repository->getAllPermissions();\n }", "public static function getList()\n {\n return collect([\n new Permission('control_panel_access', 'Control Panel Access', 'General'),\n new Permission('manage_users', 'Manage Users', 'ACL'),\n new Permission('manage_roles', 'Manage Roles', 'ACL'),\n new Permission('manage_permissions', 'Manage Permissions', 'ACL'),\n ]);\n }", "public function index()\n {\n $permissions = Permission::all();\n return view('admin.permission.show',compact('permissions'));\n }", "public function index()\n {\n return view('laralum_permissions::index', ['permissions' => Permission::paginate(50)]);\n }", "public function index()\n {\n $permissions = Permission::all();\n\n return $this->respondWithJson($permissions);\n }", "public static function getPermissionModel()\n {\n return static::getModel('Permissions');\n }", "public static function getAll()\n {\n $pdo = Database::getConnection();\n $query = \"SELECT * FROM permissions\";\n try {\n $stm = $pdo->query($query);\n return $stm->fetchAll(\\PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n return false;\n }\n }", "public function index()\n {\n $permissionsList = Permission::all();\n return view('UserCenter.Permissions.index', compact('permissionsList'));\n }", "function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}", "public function index()\n {\n return $this->respondWithCollection(\n $this->permissions->all(),\n new PermissionTransformer\n );\n }", "public function permissions()\n {\n return $this->hasMany(Permission::class);\n }", "public function permissions() {\n return $this->belongsToMany(Permission::class);\n }", "public function index()\n {\n $permissions = Permission::all();\n return view('permissions.index', [\n 'permissions' => $permissions\n ]);\n }", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function index()\n {\n $permissions = Permission::all();\n return view('permissions.index_permission', compact('permissions'));\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function getListPermission()\n { \n $permissions = Permission::orderBy('id', 'desc');\n \n return Datatables::of($permissions)\n ->addIndexColumn()\n ->editColumn('description', function($permissions){\n if (Entrust::can([\"permissions-detail\"])) {\n return '<a onclick=\"viewDetail('.$permissions->id.');\" class=\"btn btn-xs btn-info\" title=\"Xem chi tiết\" data-tooltip=\"tooltip\"><i class=\"fa fa-eye\" aria-hidden=\"true\"></i></a>';\n } else {\n return null;\n }\n })\n ->editColumn('created_at', function($permissions){\n $time = $permissions->created_at;\n $time_numb = strtotime($time);\n\n return date(\"H:i | d-m-Y\", $time_numb);\n })\n ->addColumn('action', function($permissions){\n $string = '';\n\n if (Entrust::can([\"permissions-manager\"])) {\n $string = $string .'<a class=\"btn btn-xs yellow\" onclick=\"showEdit('.$permissions->id.');\" title=\"Chỉnh sửa\" data-tooltip=\"tooltip\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></a>';\n }\n\n return $string;\n })\n ->rawColumns(['action', 'description'])\n ->make(true);\n \n }", "function model()\n {\n return Permission::class;\n }", "public function index()\n {\n $roles = Role::whereIn('id',[1,2])->get();\n $permissions = Permission::all();\n return view('backend.permissions',compact('roles','permissions'));\n }", "public function getAllPermission()\n {\n $query = $this->createQuery('permission');\n $query->innerJoin('permission.UserGroup');\n $query->innerJoin('permission.Resource');\n $query->orderBy('granted Desc');\n\n return $query;\n }", "public function index()\n {\n return view(\"role_permission.permissionlist\");\n }", "public function index()\n {\n return response()->json(new PermissionsCollection(Permission::all()), 200);\n }", "public function index()\n {\n $permissions = Permission::all();\n $user = UserDetail::findOrFail(Session::get('id'));\n return view('admin.permissions.index', compact('permissions', 'user'));\n }", "public function index()\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n\n $permissions = Permission::all();\n\n return view('admin.permissions.index', compact('permissions'));\n }", "function fetchAllPermissions() {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT id, name FROM permissions\");\n\t$results = $query->results();\n\treturn ($results);\n}", "public function index()\n {\n $permissions = !empty(request()->all()) ? Permission::filter()->get() : Permission::all();\n $permissions = new PermissionCollection($permissions);\n\n return $this->sendResponse(trans('response.success_permission_index'), $permissions);\n }", "public function index()\n {\n $permissions = Permission::select(['id', 'name', 'created_at','updated_at'])->latest('created_at')->paginate();\n\n return view('permission.index', [\n 'permissions' => $permissions\n ]);\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function index()\n {\n $permissions = Permission::query()->paginate(5);\n\n return view('admin.permissions.index',compact('permissions'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('admin.permission.models.permission'),\n config('admin.permission.table_names.role_has_permissions')\n );\n }", "public function index()\n {\n $roles = Role::all();\n return view('permissions.index', compact('roles'));\n }", "public function index()\n\t{\n\t\t$perms = Permission::all();\n\t\treturn View('permisos.index',compact('perms'));\n\t}", "public function index()\n {\n $roles = Role::all();\n //dd($role->permissions()->get());\n\t\t\n return view('admin.permissions.index', [\n 'roles' => $roles,\n 'roles_count' => count($roles),\n ]);\n }", "public function index(): View\n {\n $permissions = Permission::paginate(25);\n\n return view('permissions.index', compact('permissions'));\n }", "public function getPermissions();", "public function permissions()\n {\n return $this->belongsToMany('Bican\\Roles\\Permission');\n }", "public function index(): View\n {\n $permissions = Permission::all();\n\n return view('admin.permissions.index', compact('permissions'));\n }", "public function getAllPermissionsAttribute() {\n $permissions = [];\n foreach (Permission::all() as $permission) {\n if (Auth::user()->can($permission->name)) {\n $permissions[] = $permission->name;\n }\n }\n return $permissions;\n }", "public function permissions()\n {\n return $this->belongsToMany(config('rbac.models.permission'))->withTimestamps()->withPivot('granted');\n }", "public function indexAction()\n {\n $this->get('Services')->setMenuItem('Permission');\n $em = $this->getDoctrine()->getManager();\n\n $permissions = $em->getRepository('WbcAdministratorBundle:Permission')->findAll();\n\n return $this->render('permission/index.html.twig', array(\n 'permissions' => $permissions,\n ));\n }", "public function permissions()\n {\n return $this->belongsToMany(\n Permission::class,\n null,\n \"context_ids\",\n \"permission_ids\"\n );\n }", "public function perms()\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 index()\n {\n //\n // $permissions = Permissions::orderBy('id')->get();\n\n $permissions = DB::table('permissions')->select('id','name', 'slug')->orderBy('id')->get();\n\n return view('admin.permission.indexP',compact('permissions'));\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-permission.models.permission'),\n config('laravel-permission.table_names.user_has_permissions')\n )->withTimestamps();\n }", "public function permissions()\n {\n return $this->hasMany(UserPermission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-authorisation.models.permission'),\n config('laravel-authorisation.table_names.role_has_permissions')\n );\n }", "public function index(Request $request)\n {\n abort_if(Gate::denies('permissions_access'), Response::HTTP_FORBIDDEN, 'Forbidden');\n\n $permissions = Permission::paginate(5)->appends($request->query());;\n return view('admin.permissions.index',compact('permissions'));\n }", "public function index()\n {\n $roles = Role::all();\n $permissions = Permission::all();\n return view('admin.pages.permission.index', ['roles' => $roles, 'permissions' => $permissions]);\n }", "public function index()\n {\n $paginationLength = pagination_length(PermissionGroup::class);\n $permissionGroups = PermissionGroup::paginate($paginationLength);\n return PermissionGroupResource::collection($permissionGroups);\n }", "public function perms()\n {\n return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id');\n }", "public function getPermissions() {}", "public function getPermissions() {}", "public function index(Request $request)\n {\n\t\t$input=$request->all();\n\t\t$r=Permission::where('id', '<>', '0');\n\t\tif(isset($input['id']) and $input['id']<>0){\n\t\t\t$r->where('id', '=', $input['id']);\n\t\t}\n\t\t/*if(isset($input['name']) and $input['name']<>\"\"){\n\t\t\t$r->where('name', 'like', '%'.$input['name'].'%');\n\t\t}*/\n\t\t$permissions = $r->paginate(25);\n\t\t//$permissions = Permission::paginate(25);\n\n return view('permissions.index', compact('permissions'));\n }", "public function allPermissions($with = null)\n {\n if ( !is_null( $with ) )\n return Permission::with( $with )->get();\n\n return Permission::all();\n }", "public function getAll()\n {\n $permissionArray = [];\n foreach ($this->permissions as $permission => $status) {\n if ($status) {\n $permissionArray[] = $permission;\n }\n }\n return $permissionArray;\n }", "public function index()\n {\n $permissions = Permission::paginate();\n return view('privilegios.index', compact('permissions'));\n }", "public function index()\n {\n abort_unless(Gate::allows('permission-access'), 403);\n\n $permissions = Permission::all();\n\n return view('admin.permission.index', compact('permissions'));\n }", "public function index()\n {\n abort_unless(Gate::allows('permission-access'), 403);\n\n $permissions = Permission::all();\n\n return view('admin.permission.index', compact('permissions'));\n }", "public function index()\n {\n $permissions = Permission::all()->pluck('ident')->toArray();\n\t\t\n\t\t$controllers = [];\n\n\t\tforeach (\\Route::getRoutes()->getRoutes() as $route)\n\t\t{\n\t\t\t$action = $route->getAction();\n\t\t\t$uri = $route->uri();\n\t\t\t\n\t\t\tif (array_key_exists('controller', $action))\n\t\t\t{\t\t\t\t\n\t\t\t\t// You can also use explode('@', $action['controller']); here\n\t\t\t\t// to separate the class name from the method\n\n\t\t\t\t$router_group = implode(\",\", $action['middleware']);\n\t\t\t\t$controller = explode(\"@\",str_replace($action['namespace'].\"\\\\\",\"\",$action['controller']));\n\t\t\t\t$controller_name = $controller[0];\n\t\t\t\tif(strpos($controller_name,'Auth')!==false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$functions = $controller[1];\n\t\t\t\t\n\t\t\t\t$action_name = (isset($action['as']) && !empty($action['as']))?$action['as']:$functions;\n\t\t\t\t$method = implode('|', $route->methods());\n\t\t\t\t\n\t\t\t\tif(isset($controllers[$controller_name][$action_name]))\n\t\t\t\t\t$action_name = $action_name.\"_\".$method;\n\t\t\t\t\n\t\t\t\t$controllers[$controller_name][$action_name] = array('router_group' => $router_group, 'function' => $functions, 'uri' => $uri, 'method' => $method);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn view('permissions/index', compact('permissions', 'controllers'));\n }", "public function permissions()\n {\n return $this->belongsToMany('MDH\\Permissions\\Permission')->withTimestamps();\n }", "public function index()\n\t{\n\n\t\t$query = Permission::query();\n\n\t\tif(Input::has('search') && Input::has('keyword')) {\n\t\t\t$query->where(Input::get('search'), 'LIKE', '%'.Input::get('keyword').'%');\n\t\t}\n\n\t\t$permissions = $query->orderBy('name','asc')->orderBy('created_at','asc')->paginate(Config::get('constants.common.paginate'));\n\t\treturn view(\"Admin::permissionindex\", ['pagetitle'=>__('Admin::permission.permission'), 'pagedesc'=>__('Admin::base.list'), 'permissions'=> $permissions]);\n\n\t}", "public function permissionsList()\n {\n //get and clean the list directly from the artisan command\n if (!Artisan::call('permission:show web')) {\n $page = Artisan::output();\n $page = str_replace(['+', '·', \"Guard: web\\r\\n\"], ['|', '', null], $page);\n $page = nl2br($page);\n $lines = explode('<br />', $page);\n array_shift($lines);\n array_pop($lines);\n array_pop($lines);\n $page = implode('', $lines);\n $message = \"Data is from the database\";\n $message_type = 'success';\n } else {\n $page = view('admin.permissions_markup')->render();\n $message = \"Data coming from the static MarkDown page!!!!\";\n $message_type = 'warning';\n }\n //parse the MarkDown text and send it to the view\n $parseDown = new Parsedown();\n $parseDown->setMarkupEscaped(true);\n $table = $parseDown->parse($page);\n //permissions and roles are needed to know the cell that is clicked in the table\n $permissions = Permission::all()->sortBy('name')->pluck('id', 'name')->toJson();\n $roles = Role::all()->sortBy('name')->pluck('name');\n //flash the source of the table data\n $this->request->session()->flash($message_type, $message);\n\n return view('admin.permissions', compact('table', 'permissions', 'roles'));\n }", "public function query(Permission $model)\n {\n return $model->newQuery()->with('roles');\n }", "public function permissions()\n\t{\n\t\treturn $this->belongsToMany(Permission::class, 'users_permissions');\n\t}", "public function getUserPermissions(): Collection\n {\n return $this->model->where('name', 'LIKE', 'view_%')->get();\n }", "public function perms() {\n return $this->belongsToMany(config('entrust.permission'), config('entrust.permission_role_table'), 'role_id', 'permission_id');\n }", "public function perms()\n {\n return $this->belongsToMany(Config::get('entrust-branch.permission'), Config::get('entrust-branch.permission_role_table'));\n }", "public function index()\n {\n $permissions = Permission::latest()->paginate(10);\n $pageTitle = $this->getPageTitle() . \" - لیست\";\n return view('Dashboard.Permission.index', compact('pageTitle', 'permissions'));\n }", "public function index()\n {\n $permissions = buildPermission($this->permission->all());\n return view('permission.index', compact('permissions'));\n }", "public function index(Request $request)\n {\n \t// $this->authorize('index_permission');\n\n return view('permissions.index', [\n 'permissions' => Permission::All()->sortBy('name'),\n ]);\n \t// return view('permissions.index', ['permissions_role' => Role::find($role_id)->permissions(), 'permissions' => Permission::All()]);\n\n \t// return view('permissions.index', ['permissions' => Permission::where('name', 'NOT LIKE', '%permission')->get()]);\n }", "public function index()\n {\n if(auth('api')->user()->hasRole('superadmin')){\n $permisions = Permission::paginate(10);\n foreach($permisions as $key => $value){\n $permisions[$key]['role'] = $value->getRoleNames();\n $permisions[$key]['count'] = count($value->getRoleNames());\n }\n return $permisions;\n }\n }" ]
[ "0.7682572", "0.7612452", "0.74533206", "0.74398625", "0.7430302", "0.74156976", "0.74156976", "0.7161744", "0.7125186", "0.6989954", "0.69665575", "0.6955749", "0.69293696", "0.6899438", "0.68826497", "0.6848176", "0.67938596", "0.6786612", "0.678222", "0.676751", "0.6761761", "0.6758437", "0.67532676", "0.6748186", "0.67478764", "0.6738661", "0.6733397", "0.6731268", "0.671961", "0.67145294", "0.66996473", "0.6676837", "0.66715246", "0.6662442", "0.66623914", "0.66399956", "0.66239816", "0.66239816", "0.66239816", "0.66239816", "0.66239816", "0.66239816", "0.66231745", "0.6616474", "0.66134316", "0.6613105", "0.65964043", "0.658134", "0.65745217", "0.6550814", "0.65400845", "0.65390813", "0.6527477", "0.65175253", "0.65175253", "0.65175253", "0.65175253", "0.6503313", "0.6497209", "0.6447176", "0.64048284", "0.63950634", "0.63820034", "0.6378563", "0.63572806", "0.6353818", "0.6343532", "0.6336728", "0.6330273", "0.6323925", "0.6320548", "0.63169634", "0.6314463", "0.6298571", "0.6293791", "0.62891406", "0.6282609", "0.62812346", "0.6276623", "0.6268836", "0.6268836", "0.6258695", "0.62573457", "0.62548697", "0.62537444", "0.624513", "0.624513", "0.6244118", "0.62437224", "0.6243127", "0.623995", "0.62389106", "0.62387705", "0.6231979", "0.6231115", "0.6229629", "0.62265325", "0.6225304", "0.6224153", "0.62163967" ]
0.665757
35
Delete many records of this table
public function actionRemove() { $delete_record = new DeleteRecord(); $result = Yii::$app->request->post('selection'); if (!$delete_record->isOkPermission(ACTION_DELETE) || !$delete_record->isOkSelection($result) ) { return $this->redirect([ACTION_INDEX]); } $nro_selections = sizeof($result); $status = []; for ($counter = 0; $counter < $nro_selections; $counter++) { try { $primary_key = $result[$counter]; $model = Permission::findOne($primary_key); $item = $delete_record->remove($model, 0); $status[$item] .= $primary_key . ','; } catch (Exception $exception) { $bitacora = new Bitacora(); $bitacora->registerAndFlash( $exception, 'actionRemove', MSG_ERROR ); } } $delete_record->summaryDisplay($status); return $this->redirect([ACTION_INDEX]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public function deleteAll(): void;", "public static function deleteAll() {\n // Initiate implicit tx 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 $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "function deleteAll() {\n\t\t$dbh=$this->getdbh();\n\t\t$sts = $dbh->exec('DELETE FROM '.$this->enquote($this->tablename));\n\t\treturn $sts;\n\t\n\t}", "public function deleteall()\r\n {\r\n $ids = $this->input->post('records');\r\n if(!empty($ids))\r\n {\r\n foreach($ids as $id)\r\n {\r\n $this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\r\n }\r\n }\r\n $this->session->set_flashdata('alert','deletesuccess');\r\n redirect(base_url('manage/'.$this->controller));\r\n\r\n }", "public function delete_all()\n {\n }", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "function deleteAll ($tablename) {\n\t\t$this->deleteWhere($tablename, NULL);\n\t}", "public function delall()\n {\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 deleteTestEntities() {\n $statement = sprintf(\"DELETE FROM %s WHERE %s < 0 AND %s < 0\", static::TABLE, static::FIELDS[0], static::FIELDS[1]);\n\n $this->db->exec($statement);\n }", "public function deletion($data, Model $model)\n { \n $this->table = $model->table;\n\n foreach($data as $record) {\n $this->unsetQuery();\n $this->delete('message_id = ?', [$record]);\n }\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function deletePersons()\n {\n $conn = $this->_em->getConnection();\n $conn->executeUpdate('DELETE FROM person_person;');\n $conn->executeUpdate('DELETE FROM person_league;');\n $conn->executeUpdate('DELETE FROM person_cert;');\n $conn->executeUpdate('DELETE FROM person;');\n \n $conn->executeUpdate('ALTER TABLE person_person AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_league AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_cert AUTO_INCREMENT = 1;');\n }", "public function actionBatchDelete() {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModelAll($ids);\n foreach ($models as $model) {\n $model->delete();\n }\n return $this->redirect(['index']);\n } else {\n throw new HttpException(400);\n }\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "function batch_delete($datas)\n\t{\n\t\t$ci = &get_instance();\n\t\t$ci->db->trans_strict(TRUE);\n\t\t$ci->db->trans_start();\n\n\t\tif (IS_LOCAL) $ci->load->helper('logger');\n\n\t\tforeach($datas as $table => $condition) {\n\t\t\t$ci->db->delete($table, $condition);\n\n\t\t\tif (IS_LOCAL)\tlogme('DELETE_QUERY', 'info', $ci->db->last_query());\n\t\t}\n\n\t\t$ci->db->trans_complete();\n\t\tif ($ci->db->trans_status() === FALSE)\n\t\t{\n\t\t\tif (IS_LOCAL)\tlogme('ERROR_QUERY', 'info', 'Database Error: '.$ci->db->error()['message']);\n\t\t\treturn [FALSE, ['message' => F::_err_msg('err_commit_data')]];\n\t\t}\n\n\t\treturn [TRUE, NULL];\n\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function delete($table);", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete_rows()\n {\n $tables = $this->file->sheets->first()->tables->filter(function($table) {\n $uniques = $table->columns->filter(function($column) { return $column->unique; })->map(function($column) {\n return 'C' . $column->id;\n })->toArray();\n\n $updates = array_merge(array_fill_keys($uniques, ''), ['deleted_by' => $this->user->id, 'deleted_at' => Carbon::now()->toDateTimeString()]);\n\n $query = DB::table($table->database . '.dbo.' . $table->name);\n\n !$this->isCreater() && $query->where('created_by', $this->user->id);\n\n return $query->whereIn('id', Input::get('rows'))->update($updates);\n });\n\n return ['tables' => $tables];\n }", "public function deleteAll(): int\n {\n return $this->pdo->exec(\"TRUNCATE \" . $this->table);\n }", "function deleteRecords($table, $where)\n\t{ \n\t\t$query = \"DELETE FROM $table WHERE $where\";\n\t\t$this->db->query($query);\n\t}", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function bulk_delete(Request $request){\n $this->isAuthorize();\n\n // Delete the Data\n $userID = $this->request->session()->get('userID');\n $ids = $request->ids;\n DB::table(\"apt_time_slots\")->where('userID','=',$userID)->whereIn('id',explode(\",\",$ids))->delete();\n return response()->json(['success'=>\"Deleted successfully.\"]);\n }", "public function delteRecords(){\n // Get the sql statement\n $sql = $this->deleteSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n \n $stmt->execute();\n \n return true;\n \n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n\n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n\n }", "function delete_all($table,$column=\"id\") {\n global $_REQUEST;\n global $lang;\n\n // usun wszsytkei zaznaczone rekordy\n if (! empty($_REQUEST[$this->del])) {\n $del=$_REQUEST[$this->del];\n\n if (is_object(@$this->delete_obj)) {\n $data=$this->deleteCheck($table,$column,$del,$this->delete_obj);\n $del=$data['deleted'];\n }\n\n // lista rekordow do usuniecia\n while (list($id,) = each($del)) {\n if (! empty($id)) {\n $this->delete_one_record($id,$table,$column);\n }\n }\n } else {\n if ($this->show_empty_info==true) {\n print \"<center>\".$lang->delete_empty.\"</center>\";\n }\n }\n return;\n }", "public function delete(){\r\n $id=$_POST['del_row'];\r\n $id=implode(',',$id);\r\n $this->Events_Model->delete($this->table,$id);\r\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 testDeleteBatch()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys\n foreach ( $pks as $pk ) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function actionBulkDelete() {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "public function delete($records = '')/*# : DeleteStatementInterface */;", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "public function bulkDelete(Request $request)\n {\n return $this->model->bulkDelete($request->ids);\n }", "public function action_multi(){\n $ids = Arr::get($_POST, 'operate');\n if(isset($_POST['delete_all']) && count($ids)){\n $count = DB::delete( ORM::factory('BoardAbuse')->table_name() )->where('id', 'IN', $ids)->execute();\n Flash::success(__('All abuses (:count) was successfully deleted', array(':count'=>count($count) )));\n }\n $this->redirect('admin/boardAbuses' . URL::query());\n\n }", "public function deleteAll() {\n \n $stmt = $this->pdo->prepare('DELETE FROM stocks');\n $stmt->execute();\n return $stmt->rowCount();\n }", "public function delete( $table, $where='', $orderBy='', $limit=array(), $shutdown=false );", "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 }", "public function delete()\n {\n return $this->query->batchDelete($this->filter);\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function deleteRows($arr_delete_array, $table_name, $field_name) {\n if (count($arr_delete_array) > 0) {\n foreach ($arr_delete_array as $id) {\n $this->db->where($field_name, $id);\n $query = $this->db->delete($table_name);\n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n if ($error) {\n $controller = $this->router->fetch_class();\n $method = $this->router->fetch_method();\n $error_details = array(\n 'error_name' => $error,\n 'error_number' => $error_number,\n 'model_name' => 'Common_Model',\n 'model_method_name' => 'deleteRows',\n 'controller_name' => $controller,\n 'controller_method_name' => $method\n );\n $this->common_model->errorSendEmail($error_details);\n redirect(base_url() . 'page-not-found'); //create this route\n }\n }\n }\n }", "public function actionDeleteMultiple()\n {\n $request = Yii::$app->request;\n Yii::$app->response->format = Response::FORMAT_JSON;\n $js = $request->post('js');\n $jk = $request->post('jk');\n\n $mata_kuliah_tayang = MataKuliahTayang::find()\n ->joinWith('refCpmks')\n ->where([MataKuliahTayang::tableName() . '.id' => $jk])\n ->all();\n // $count = count($mata_kuliah_tayang[0]['refCpmks']);\n\n foreach ($js as $id_mahasiswa) {\n foreach ($mata_kuliah_tayang as $key => $value) {\n foreach ($value['refCpmks'] as $key => $value) {\n CapaianMahasiswa::deleteAll(['id_ref_mahasiswa' => $id_mahasiswa, 'id_ref_cpmk' => $value->id]);\n }\n }\n }\n }", "public function deleteAll($initAutoIncrement = false): void;", "public function deleteAllForKey()\n\t{\n\t\t$keys = $this->getAllKeys();\n return parent::deleteMulti($keys);\n\t}", "function deleteMultipleData($tableName,$ids,$fieldName,$flag=SOFT_DELETE){\t\t\r\n\t\tif(!isset($ids) || $ids==''){\r\n\t\t\treturn FALSE;\r\n\t\t}else{\r\n\t\t\tif(isset($tableName)&& trim($tableName)!='' && $fieldName!=''){\r\n\t\t\t\tif($flag==SOFT_DELETE){\r\n\t \t\t\t $query=\"UPDATE \".$tableName.\" SET \".COND_IS_DELETED_TRUE .\" WHERE \". $fieldName .\" IN(\".$ids.\")\";\r\n\t\t\t\t}\r\n\t\t\t\tif($flag==HARD_DELETE){\r\n\t\t\t\t\t$query=\"DELETE FROM \".$tableName.\" WHERE \".$fieldName.\" IN(\".$ids.\")\";\r\n\t\t\t\t}\r\n\t\t\t\treturn mysql_query($query); \r\n\t\t\t}\r\n\t \t}\r\n\t }", "public function index_delete(){\n\t\t\n\t\t}", "function delete_all()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete_all();\n\t$this->view_logs();\n}", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n \n $pks = explode(',', $request->post('pks')); \n \n foreach ($pks as $key) \n {\n \n $model=$this->findModel($key);\n $model->delete();\n } \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'true']; \n }\n else\n {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['accion_centralizada_variables/index']);\n }\n \n }", "protected function entityDeleteMultiple($ids) {\n waywire_video_delete_multiple($ids);\n }", "public function deleteMany($ids)\n {\n $placeholders = array_fill(0, count($ids), \"?\");\n $placeholders = implode(\", \", $placeholders);\n\n $sql = \"DELETE FROM `%s` WHERE `%s` IN (%s)\";\n $this->_sql[] = sprintf($sql, $this->_table, $this->_key, $placeholders);\n $parameters = array();\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }", "public function deleteAll()\n {\n return $this->model::query()->delete();\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function actionBulkDelete()\n { \n $request = Yii::$app->request;\n $pks = $request->post('pks'); // Array or selected records primary keys\n foreach (AcEspUej::findAll(json_decode($pks)) as $model) {\n $model->delete();\n }\n \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>true]; \n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }", "public function 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 bulk_destroy(Request $request)\n {\n $banners = Banners::find($request->ids);\n\n foreach ($banners as $item) {\n //languages\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $banners_trans = BannersTrans::where('lang', '=', $language)->where('tid', '=', $item->id)->first();\n\n if($banners_trans) {\n $banners_trans->delete();\n }\n }\n $check_banners_trans = BannersTrans::where('tid', '=', $item->id)->first();\n if(!$check_banners_trans){\n $item->delete();\n }\n }\n // end languages\n }\n \n Flash::success(trans('backend.deleted_successfully'));\n $Currentlanguage = Lang::getLocale();\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function deleteAll(){\n if(APPLICATION_ENV == 'production'){\n throw new Exception(\"Not Allowed\");\n }\n $this->getMapper()->deleteAll();\n }", "function messageDeleteBulk(Collection $messages);", "public function _deleteLista(){\r\n $res = $this->db->truncate('recorrida');\r\n return $res;\r\n\r\n }", "public function deleteMultiple( $keys )\n\t{\n\t\t$this->getObject()->deleteMultiple( $keys );\n\t}", "function delete($table, array $conditions);", "function remove_rows($table_id, $data) {\n\t$cmsEditDel = new cmsEditDel($table_id, $data);\n\t$delete_id = $cmsEditDel->dbChange();\n\tunset($cmsEditDel);\n\t\n\tif (empty($delete_id)) return;\n\t\n\t$child = getChildTables($table_id);\n\treset($child);\n\twhile (list($table_id, $field_name) = each($child)) {\n\t\tremove_rows($table_id, array($field_name => $delete_id));\n\t}\n\t\n}", "public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Warehouse::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function bulkDestroy(BulkDestroyTurma $request) : Response\n {\n DB::transaction(static function () use ($request) {\n collect($request->data['ids'])\n ->chunk(1000)\n ->each(static function ($bulkChunk) {\n Turma::whereIn('id', $bulkChunk)->delete();\n\n // TODO your code goes here\n });\n });\n\n return response(['message' => trans('brackets/admin-ui::admin.operation.succeeded')]);\n }", "function deleteAllData() {\n $successObservers = $this->databaseDeleteRecord($this->tableObservers, NULL);\n $successActions = $this->databaseDeleteRecord($this->tableActions, NULL);\n $successGroups = $this->databaseDeleteRecord($this->tableGroups, NULL);\n if ($successObservers !== FALSE && $successActions !== FALSE && $successGroups !== FALSE) {\n return TRUE;\n }\n return FALSE;\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_absence'][] = $strValue;\n }\n $tblAbsence = new cHrdAbsence();\n $tblAbsenceDetail = new cHrdAbsenceDetail();\n $tblAbsence->deleteMultiple($arrKeys);\n $tblAbsenceDetail->deleteMultiple($arrKeys2);\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, implode(\",\", $arrKeys2['id_absence']));\n $myDataGrid->message = $tblAbsence->strMessage;\n}", "public function deleteAll($tableName,$fieldName,$fieldValue){\n $sql=\"delete from $tableName where $fieldName in ( $fieldValue) \";\n $query = $this->db->query($sql);\n if($query){\n return true;\n }else{\n return false;\n }\n }", "public static function deleteAllPlayers() {\n \tCommonDao::connectToDb();\n \t$query = \"delete from player where player_id > 0\";\n \tmysql_query($query);\n }", "public static function destroyAll($options = array()) {\n foreach (self::findAll($options) as $record) {\n $record->destroy();\n }\n }", "function delete_multiple_blog_category()\n {\n $blog_categories = $this->input->post('table_records');\n $website_id = $this->input->post('website_id');\n foreach ($blog_categories as $blog_category):\n $this->db->where(array(\n 'id' => $blog_category,\n 'website_id' => $website_id\n ));\n $this->db->update($this->table_blog_category, array(\n 'is_deleted' => 1\n ));\n endforeach;\n }", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "function delete_multiple_hover_image()\n\t{\n\t\t$page_id = $this->input->post('page_id');\n\t\t$this->form_validation->set_rules('table_records[]', 'Row', 'required', array(\n\t\t\t'required' => 'You must select at least one row!'\n\t\t));\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->session->set_flashdata('error', validation_errors());\n\t\t\tredirect('hover_image/hover_image_index/' . $page_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->Hover_image_model->delete_multiple_hover_image_data();\n\t\t\t$this->session->set_flashdata('success', 'Successfully Deleted');\n\t\t\tredirect('hover_image/hover_image_index/' . $page_id);\n\t\t}\n\t}", "public function delete() {\n global $DB;\n foreach ($this->targets as $target) {\n $DB->delete_records('progressreview_tutor', array('id' => $target->id));\n }\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 deleteIds ($ids) {\r\n $this->delete($this->tableName, $this->_id . ' in (' . implode(',', $ids) . ')');\r\n }" ]
[ "0.7314146", "0.72768146", "0.72768146", "0.72768146", "0.7122341", "0.7057333", "0.7023772", "0.69342214", "0.69151515", "0.69097346", "0.68996966", "0.6846462", "0.6814651", "0.6786781", "0.66919947", "0.6688225", "0.6674263", "0.66140956", "0.6610268", "0.6604", "0.65604585", "0.6550983", "0.65458304", "0.6539496", "0.6531837", "0.6528473", "0.65077496", "0.6484903", "0.64844364", "0.6483891", "0.6455417", "0.64465475", "0.6442542", "0.64418924", "0.6438786", "0.6437563", "0.64296925", "0.6421102", "0.64196694", "0.6366213", "0.63541085", "0.63541085", "0.6347338", "0.63252175", "0.6315929", "0.6314663", "0.63139945", "0.63139945", "0.63139945", "0.63139945", "0.6308692", "0.6304262", "0.62879956", "0.62813205", "0.62813205", "0.6280557", "0.62780416", "0.6275454", "0.62721825", "0.62692666", "0.6260589", "0.6227077", "0.6218139", "0.621672", "0.62144256", "0.62078726", "0.61989045", "0.61883175", "0.6176772", "0.61740214", "0.6171606", "0.6149413", "0.6138907", "0.613779", "0.61312205", "0.61294776", "0.6107025", "0.60940385", "0.6084358", "0.60827214", "0.608263", "0.60724926", "0.6068405", "0.6067599", "0.6064299", "0.6062874", "0.6061495", "0.6056246", "0.6051365", "0.6049334", "0.6048304", "0.6047879", "0.60335183", "0.6028315", "0.6028114", "0.60252804", "0.6019684", "0.6017463", "0.6013921", "0.6010285", "0.60023326" ]
0.0
-1
Updates an existing Permission model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post())) { $this->_saveRecord($model, 'permission_id'); } return $this->render( ACTION_CREATE, [ MODEL => $model, 'titleView' => 'Update' ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(PermissionRequest $request, $id)\n {\n try {\n $model = $this->model->find($id);\n // $this->authorize('update', $model);\n\n $model->fill($request->all())->save();\n\n flash('更新操作成功', 'success');\n return redirect()->back();\n } catch (ValidationException $e) {\n return $this->toException($e);\n }\n }", "public function update(PermissionsRequest $request)\n {\n $permission = Permission::where('id',$request['permissionId'])->first();\n $permission->name = $request['name'];\n $permission->updated_by = \\Auth::user()->id;\n $permission->save();\n \\Session::flash('success', 'well done! permission '.$request['name'].' has been successfully updated!');\n return redirect()->back();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $post = Yii::$app->request->post();\n unset($this -> menuList[0]);\n if ($model->load($post) && $model->save()) {\n $model->menu_id = $post['PermissionForm']['menu_id'];\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'menuList' => $this ->menuList,\n ]);\n }\n }", "public function update(Request $request)\n {\n try{\n $per = Permission::findOrFail($request->input('id'));\n }\n\n catch(ModelNotFoundException $e){\n return $this -> returnOnError(\"Permission Not exist\" , false);\n }\n\n $requestInfo = $request->input('updatePermission');\n $updated = $per->update($requestInfo);\n if(!$updated){\n\n return $this -> returnOnError(\"Failed to updated Permission\" , false);\n }\n return $this -> returnOnSuccess(\"Permission Updated Successfully\" , true);\n }", "public function update(Request $request, Permission $permission)\n {\n $request->validate([\n 'name' => 'required|unique:permissions,name'.$request->id\n ]);\n $permission->update($request->all());\n return redirect()->route('permissions.index')->with('success','Permiso actualizado correctamente');\n }", "public function update(Request $request, $id)\n {\n $permission = Permission::find($id);\n\n if (!$permission) {\n return redirect()->back()->withFlashDanger('The permission you requested for has not been found');\n }\n\n $this->validate($request, [\n 'name' => 'required|unique:Permissions'\n ]);\n\n $permission->name = $request->input('name');\n $permission->display_name = $request->input('display_name');\n $permission->description = $request->input('description');\n $permission->save();\n return redirect()->route('admin.permissions.index')->withFlashSuccess(\"The permission <strong>$permission->name</strong> has successfully been updated.\");\n }", "public function update(PermissionsFormRequest $request, $id)\n\t{\n\t\t$perm = Permission::findOrFail($id);\n\t\t$perm->update($request->all());\n\t\tSession::flash('flash_message', 'El Permiso a sido editado correctamente');\n\t\treturn redirect('permisos');\n\t}", "function editPermission()\n {\n if($this->checkAccess('permission.edit') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n {\n $this->load->library('form_validation');\n \n $permissionId = $this->input->post('permissionId');\n \n $this->form_validation->set_rules('code','Code','trim|required');\n $this->form_validation->set_rules('description','Description','trim|required');\n \n \n if($this->form_validation->run() == FALSE)\n {\n $this->edit($permissionId);\n }\n else\n {\n $code = $this->security->xss_clean($this->input->post('code'));\n $description = $this->security->xss_clean($this->input->post('description'));\n \n $permissionInfo = array('code'=>$code,'description'=>$description);\n \n $result = $this->permission_model->editPermission($permissionInfo, $permissionId);\n \n if($result == true)\n {\n $this->session->set_flashdata('success', 'Permission updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Permission updation failed');\n }\n \n redirect('/setup/permission/list');\n }\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'name' =>'required|max:50',\n 'permission_for' =>'required'\n ]);\n $permission = Permission::find($id);\n $permission->name = $request->name;\n $permission->permission_for = $request->permission_for;\n $permission->save();\n return redirect(route('permission.index'))->with('status','Permission Updated');\n }", "public function update(PermissionUpdateRequest $request, $id)\n {\n /* Update Permission name */\n if (Auth::user()->hasRole('superadmin')) {\n \n $permission = Permission::findOrFail($id);\n $resultPermission = $permission->update([\n 'name' => $request->permission\n ]);\n\n /* check Permission and toast message */\n if($resultPermission){\n Toastr::success('Permission Successfully Updated', 'Success');\n return redirect()->route('super-admin.permission.index');\n }\n abort(404);\n }\n abort(403);\n \n }", "public function update($id, PermissionRequest $request) {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.edit'))) return redirect()->route('home');\n Log::info('update: '.$id,$request->all());\n\n\t\t/*\n\t\t * Here we can apply any business logic required,\n\t\t * then change $request->all() to results.\n\t\t */\n\t\t$input = $request->all();\n\n\t\t$this->permissionRepository->update($id, $input);\n\n\t\treturn redirect()->route('permission.index');\n\t}", "public function update(Request $request, $id)\n {\n $status = Permission::where('name',$request->permission_name)->first();\n\n if($status !== null){\n return redirect()->back()->with('warning',\"Already updated permission exist ! !\");\n }else{\n $res = Permission::find($id)->update([ 'name' => $request->permission_name ]);\n if($res)\n return redirect()->back()->with('success',\"Permission updated\");\n else\n return redirect()->back()->with('warning',\"Unable to update role !\");\n\n }\n }", "public function update(PermissionsRequest $request, $id)\n {\n $module_name = $this->module_name;\n $module_name_singular = str_singular($this->module_name);\n\n $module_name_singular = Permission::findOrFail($id);\n\n $module_name_singular->update($request->all());\n\n return redirect(\"admin/$module_name\")->with('flash_success', \"Update successful!\");\n }", "public function update(StorePermissionRequest $request, $id)\n {\n if (Auth::user()->ability('superadministrator', 'update-permissions')){\n //update the permission\n $permission=Permission::findOrFail($id);\n $permission->display_name=$request->input('display_name');\n $permission->description=$request->input('description');\n $bool=$permission->save();\n //redirection after update\n if ($bool){\n return redirect()->route('permissions.index')->with('success','well done!');\n }else{\n return redirect()->back()->with('error','Something wrong!!!');\n }\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function update($id, PermissionsFormRequest $request)\n {\n try {\n \n $data = $request->getData();\n \n $permission = Permission::findOrFail($id);\n $permission->update($data);\n\n return redirect()->route('permissions.permission.index')\n ->with('success_message', trans('permissions.model_was_updated'));\n\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => trans('permissions.unexpected_error')]);\n } \n }", "public function update(UpdatePermissionRequest $request, Permission $permission)\n {\n $permission->update($request->validated());\n\n return redirect()->route('admin.permissions.index')->with('status-success','Permission Updated');\n }", "public function update(Request $request, Permission $permission)\n {\n $data = $request->all();\n $validator = $this->validator($data);\n //if($validator->fails()) return redirect()->back()->withErrors($validator)->withInput();\n if($validator->fails()) return response()->json($validator->messages(),422);\n $permission->update($data);\n return response()->json(['permissions' => $permission,'msg' => 'Zaktualizowano uprawnienie'],201);\n return redirect()->route('permission.index')->withSuccess('Uprawnienie zaktualizowano');\n }", "public function update(Request $request, Permission $permission)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|min:2|max:255|unique:permissions,title,' . $permission->id,\n 'label' => 'required|min:2|max:255|unique:permissions,label,' . $permission->id,\n ]);\n if ($validator->fails()) {\n $this->errorMessage($validator);\n return redirect()->back()->withInput();\n }\n $permission->update([\n \"title\" => $request->input('title'),\n \"label\" => $request->input('label'),\n ]);\n// -----------------------------\n $this->successMessage(['عملیات موفیت آمیز بود']);\n return redirect()->to($request->input('redirects_to'));\n }", "public function update(UpdatePermissionsRequest $request, Permission $permission)\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n\n $permission->update($request->all());\n\n return redirect()->route('admin.permissions.index');\n }", "public function update(Request $request, Permission $permission)\n {\n $permission->permission = $request->permission;\n $permission->description = $request->description;\n $permission->update();\n return redirect()->route('bk-permissions');\n }", "public function update(Request $request, Permission $permission)\n {\n $this->validate($request, [\n 'name' => 'required', 'string','unique:permissions,name'.$permission->id,\n 'slug' => 'required', 'string','unique:permissions,slug,'.$permission->id,\n 'module_id'=>['required'],\n ]);\n $permission->update([\n 'name' =>$request->name,\n 'module_id'=>$request->module_id,\n 'slug' =>$request->slug ?? Str::slug($request->name),\n ]);\n\n return redirect()->route('permissions.index');\n }", "public function update(Request $request, $id)\n {\n $permission = Permission::findOrFail($id);\n\n $rules = [\n 'name' => 'required|unique:permissions,name,'.$id.',id'\n ];\n\n $messages = [\n 'name.required' => 'Permission name is required!',\n 'name.unique' => 'Permission name already exists!',\n ];\n\n $validator = Validator::make($request->all(), $rules, $messages);\n\n if ($validator->fails()) {\n return redirect('admin/permission/'.$id.'/edit')->withErrors($validator)->withInput();\n }\n\n $input = [\n 'display_name' => $request->get('name'),\n 'name' => str_slug($request->get('name'), '-'),\n 'description' => $request->get('description'),\n 'status' => $request->get('status')\n ];\n\n if ($permission->update($input)) {\n $message = $permission->display_name.' permission updated.';\n $error = false;\n } else {\n $message = $permission->display_name.' permission update fail.';\n $error = true;\n }\n\n return redirect('admin/permission')->with(['message' => $message, 'error' => $error]);\n }", "public function actionUpdate()\n {\n\t\t/**\n\t\t * @author \t: ptrnov <[email protected]>\n\t\t * @since \t\t: 1.2\n\t\t * Subject\t\t: PERMISSION PER MODUL.\n\t\t * Metode\t\t: PUT (Update)\n\t\t * URL\t\t\t: http://production.kontrolgampang.com/login/user-permissions\n\t\t * Body Param\t: ACCESS_ID (key),MODUL_ID (key), BTN_VIEW/BTN_CREATE/BTN_UPDATE/BTN_DELETE/STATUS.\n\t\t * Alert\t\t: {\"result\": \"ACCESS_ID-Empty\"}=> Field ACCESS_ID Param tidak ada.\n\t\t *\t\t\t\t {\"result\": \"User-Not-Exist\"}=> user tidak di temukan.\n\t\t */\n\t\t$paramsBody \t\t= Yii::$app->request->bodyParams;\n\t\t$accessId\t\t\t= isset($paramsBody['ACCESS_ID'])!=''?$paramsBody['ACCESS_ID']:'';\n\t\t$modulId\t\t\t= isset($paramsBody['MODUL_ID'])!=''?$paramsBody['MODUL_ID']:'';\n\t\t$btnView\t\t\t= isset($paramsBody['BTN_VIEW'])!=''?$paramsBody['BTN_VIEW']:'';\n\t\t$btnCreate\t\t\t= isset($paramsBody['BTN_CREATE'])!=''?$paramsBody['BTN_CREATE']:'';\n\t\t$btnUpdate\t\t\t= isset($paramsBody['BTN_UPDATE'])!=''?$paramsBody['BTN_UPDATE']:'';\n\t\t$btnDelete\t\t\t= isset($paramsBody['BTN_DELETE'])!=''?$paramsBody['BTN_DELETE']:'';\n\t\t$status\t\t\t\t= isset($paramsBody['STATUS'])!=''?$paramsBody['STATUS']:'';\n\t\t\n\t\tif($accessId){\n\t\t\t$cntUser= User::find()->where(['ACCESS_ID'=>$accessId])->count();\n\t\t\tif($cntUser){\n\t\t\t\t$modalPermission = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\tif ($btnView!=''){$modalPermission->BTN_VIEW=$btnView;};\n\t\t\t\tif ($btnCreate!=''){$modalPermission->BTN_CREATE=$btnCreate;};\n\t\t\t\tif ($btnUpdate!=''){$modalPermission->BTN_UPDATE=$btnUpdate;};\n\t\t\t\tif ($btnDelete!=''){$modalPermission->BTN_DELETE=$btnDelete;};\n\t\t\t\tif ($status!=''){$modalPermission->STATUS=$status;};\n\t\t\t\tif($modalPermission->save()){\n\t\t\t\t\t$modalView = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\t\treturn array('USER_PERMISSIONS'=>$modalView);\t\n\t\t\t\t}else{\n\t\t\t\t\treturn array('result'=>'permission-Not-Exist');\n\t\t\t\t}\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn array('result'=>'User-Not-Exist');\n\t\t\t}\n\t\t}else{\n\t\t\treturn array('result'=>'ACCESS_ID-Empty');\n\t\t}\n\t}", "function updateRole()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $roleId = $this->input->post('id');\n $permission = $this->input->post('permission');\n\n $result = $this->user_model->getRoleById($roleId);\n $roleInfo=$result;\n $roleInfo->permission = $permission;\n $result = $this->user_model->updateRole($roleInfo, $roleId);\n\n if ($result == true) {\n $this->session->set_flashdata('success', '用户更新成功.');\n echo(json_encode(array('status' => TRUE)));\n } else {\n $this->session->set_flashdata('error', '用户更新失败.');\n echo(json_encode(array('status' => FALSE)));\n }\n\n //redirect('roleListing');\n\n }\n }", "public function update($id, Request $request)\n {\n // realiza la validacion de las reglas antes de actualizar\n $this->validate($request, [\n 'permission_title' => 'required',\n 'permission_slug' => 'required|regex:/^[a-zA-Z0-9_]+$/|unique:permissions,permission_slug,'.$id\n ]);\n\n if (empty($this->permissions)) {\n // guarda un mensaje en el archivo de log\n Log::notice('Permisos, Update, permiso no encontrado: '.$id);\n Flash::error('Permiso no encontrado.');\n\n return redirect(route('admin.permisos.index'));\n }\n\n //almacenar la actualizacion que realiza el usuario, de acuerdo a los campos fillable\n $this->permissions->fill($request->all());\n //guardar el usuario\n $this->permissions->save();\n\n // guarda un mensaje en el archivo de log\n Log::info('Permisos, Update, permiso actualizado correctamente: '.$id, [$request->all()]);\n Flash::success('Permiso actualizado correctamente.');\n\n return redirect(route('admin.permisos.show',['id' => $this->permissions->id]) );\n }", "public function update(Request $request, Permission $selected_permission)\n {\n $this->validator($request->all())->validate();\n\n\n $updatedPermission = [\n 'name' => $request->name,\n 'guard_name' => $request->guard_name,\n 'description' => $request->description\n ];\n\n $selected_permission->update($updatedPermission);\n\n return redirect(route('UserCenter.Permissions.Index'));\n }", "public function update(PermissionUpdateRequest $request, Permission $permission)\n {\n abort_unless(Gate::allows('permission-edit'), 403);\n\n try {\n $permission->update($request->all());\n\n Alert::toast(\n __('gennix.model_permission.alert_messages.update_success'),\n 'success'\n )->timerProgressBar();\n } catch (Throwable $t) {\n Alert::error(\n __('gennix.opps'),\n __('gennix.model_permission.alert_messages.update_error')\n )->autoClose(2000)->timerProgressBar();\n\n Auth::user()->saveActivity(\n __('gennix.model_permission.alert_messages.update_error') . ' ID ' . $request->id,\n [\n 'message' => $t->getMessage(),\n 'code_error' => $t->getCode(),\n 'line' => $t->getLine(),\n 'file' => $t->getFile(),\n ],\n 'error'\n );\n }\n\n return redirect()->route('permission.index');\n }", "public function update(PermissionUpdateRequest $request, Permission $permission)\n {\n abort_unless(Gate::allows('permission-edit'), 403);\n\n try {\n $permission->update($request->all());\n\n Alert::toast(\n __('gennix.model_permission.alert_messages.update_success'),\n 'success'\n )->timerProgressBar();\n } catch (Throwable $t) {\n Alert::error(\n __('gennix.opps'),\n __('gennix.model_permission.alert_messages.update_error')\n )->autoClose(2000)->timerProgressBar();\n\n Auth::user()->saveActivity(\n __('gennix.model_permission.alert_messages.update_error') . ' ID ' . $request->id,\n [\n 'message' => $t->getMessage(),\n 'code_error' => $t->getCode(),\n 'line' => $t->getLine(),\n 'file' => $t->getFile(),\n ],\n 'error'\n );\n }\n\n return redirect()->route('permission.index');\n }", "public function update(PermissionRequest $request, Permission $permission): RedirectResponse\n {\n $permission->update($request->all());\n\n return redirect()\n ->back()\n ->with('success', 'Permission was update successfully');\n }", "public function update(UpdatePermissionRequest $request, $id)\n {\n $permission = $request->only('name', 'description', 'display_name');\n $this->permissionRepository->update($permission, $id);\n Session::flash('message', trans('permission.message.update'));\n return redirect()->route('permissions.create');\n }", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }", "public function update(Request $request, $id) {\n $permission = Permission::findOrFail($id);\n // validate the input\n $validation = Validator::make( $request->all(), [\n 'name'=>'required',\n ]);\n// redirect on validation error\n if ( $validation->fails() ) {\n // change below as required\n return \\Redirect::back()->withInput()->withErrors( $validation->messages() );\n }\n else {\n $input = $request->all();\n $permission->fill($input)->save();\n\n return redirect()->route('permissions.edit',$permission->id)\n ->with('flash_message',\n 'Permission ' . $permission->name . ' updated.');\n }\n\n }", "public function update($id, Request $request)\n\t{\n\t\tDB::beginTransaction();\n\n\t\ttry {\t\t\n\n\t $permission = Permission::find($id);\n\t $permission->name = $request->name; // akan ada error bila nama tidak berubah\n\t $permission->description = $request->description;\n\t $permission->namespace = $request->namespace;\n\t $permission->controller = $request->controller;\n\t $permission->function = $request->function;\n\t $permission->updated_at = Carbon::now(Config::get('constants.common.systemtimezone'));\n\t $permission->save();\n\n\t\t\tDB::commit();\n\t\t\treturn Redirect('admin/permission')->with('flash_success', 'Data successfully updated!');\n\t\t\t\n\t\t} catch (Exception $error) {\n\t\t\tDB::rollback();\n\t\t\treturn Redirect('admin/permission')->withInput()->with( [ 'flash_error' => $error->getMessage(), 'modal'=>true ]);\n\t\t\t\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n if (auth()->check() and auth()->user()->can(\"admin\", new Role)) {\n $inputs = $request->get(\"permission_id\");\n $model = Role::findOrFail($id);\n $model->permissions()->detach();\n $model->permissions()->attach($inputs);\n return redirect($this->urltoparent);\n }\n return redirect($this->urltoparent)->withErrors([\".你没有编辑权限。.\"]);\n }", "public function update(Request $request, $id)\n {\n //\n //接收要修改的记录的内容和id\n// $data = $request->input('permission_name');\n// $data = $request->input('permission_url');\n// $data = $request->input('permission_description');\n//\n\n\n $data = $request->except('_token','_method');\n\n\n $rule=[\n 'permission_name'=>'required',\n 'permission_url'=>'required',\n// 'permission_url'=>'regex:/^\\D@\\D$/',\n 'permission_description'=>'required'\n ];\n $msg = [\n 'permission_name.required'=>'权限名称必须输入',\n 'permission_url.required'=>'方法名称必须输入',\n 'permission_description.required'=>'权限描述必须输入',\n// 'permission_url.regex'=>'方法码格式不正确',\n\n ];\n\n //进行手工表单验证\n $validator = Validator::make($data,$rule,$msg);\n //如果验证失败\n if ($validator->fails()) {\n return redirect('admin/permission/create')\n ->withErrors($validator)\n ->withInput();\n }\n\n\n\n\n// $per = Permission::where('permission_id',$id)->first();\n// $per = DB::table('permission')->where('permission_id',$id)->first();\n//\n//\n// $per->permission_name = $permission_name;\n// $per->permission_url = $permission_url;\n// $per->permission_description = $permission_description;\n\n// $res = $per->update();\n\n\n $res = DB::table('permission')\n ->where('permission_id',$id)\n ->update($data);\n\n if ($res){\n\n return redirect('admin/permission');\n }else {\n\n return back()->with('errors','修改失败');\n }\n\n\n\n\n\n\n\n\n\n }", "public function update(Request $request, $id)\n {\n $permiso = Permission::find($id);\n $permiso->name = $request->name;\n $permiso->save();\n\n return redirect()->route('permisos.index')\n ->with('success', 'Permiso Actualizado exitosamente');\n }", "public function update($id, Request $request)\n {\n try {\n\n $data = $this->getData($request, $id);\n\n $permission = Permission::findOrFail($id);\n $permission->update($data);\n\n return redirect()->route('permissions.index')\n ->with('success_message', 'Permission was successfully updated!');\n\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request!']);\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'guard_name' => 'required|max:255'\n ]);\n echo $request->name;\n\n $input = $request->all();\n $user = UserPermission::find($id);\n $user->update($input);\n // DB::table('model_has_roles')->where('model_id',$id)->delete();\n return redirect()->route('user_permission.index')\n ->with('success','Permission updated successfully')\n ->with(['menu'=>'user_permission']);\n }", "public function updatePermission() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->updatePermission();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "public function update(EditPermissionRequest $request, $id)\n {\n $permission = Permission::findOrFail($id);\n $permission->update($request->all());\n\n flash()->success('Success');\n\n return redirect('admin/permissions');\n }", "public function update(Request $request)\n {\n // Si no tiene permisos para modificar o visualizar lo echamos\n if (!auth()->user()->can('admin-roles-update')) {\n app()->abort(403);\n }\n\n $idpermissions = explode(\",\", $request->input('results'));\n $idrole = $request->input(\"id\");\n\n // Compruebo que el rol al que se quieren asignar datos existe\n $role = Role::find($idrole);\n\n if (is_null($role)) {\n app()->abort(500);\n }\n\n try {\n DB::beginTransaction();\n\n // Asigno el array de permisos al rol\n $role->syncPermissions($idpermissions);\n\n DB::commit();\n\n // Y Devolvemos una redirección a la acción show para mostrar el usuario\n return redirect()->route('roles.edit', array($idrole, '2'))\n ->with('success', trans('roles/lang.okUpdate_permission'))\n ->with('tab', \"tab_2\");\n } catch (\\PDOException $e) {\n DB::rollBack();\n return redirect()->route('roles.edit', array($idrole, '2'))\n ->with('error', trans('roles/lang.errorediciion'))\n ->with('tab', \"tab_2\");\n }\n }", "public function update(PermissionUpdateRequest $request, $id)\n {\n $permission = $this->repository->update($request->all(), $id);\n return $this->response->withSuccess('权限修改成功');\n }", "public function permiso_update() {\n\n $this->load->model('permiso','p');\n $this->titulo = \"Permisos\";\n\n if (!$this->uri->segment(4)) {\n redirect(site_url('preferencias/seguridad/permisos_lista'));\n }\n else {\n $id = $this->uri->segment(4);\n }\n\n $data['titulo'] = $this->titulo . ' <small>Modificar</small>';\n $data['atributos_form'] = array('id' => 'form', 'class' => 'form-horizontal');\n $data['link_back'] = anchor('preferencias/seguridad/permisos_lista/','<i class=\"icon-arrow-left\"></i> Regresar',array('class'=>'btn'));\n\n $data['mensaje'] = '';\n $data['action'] = site_url('preferencias/seguridad/permiso_update') . '/' . $id;\n\n $permiso = $this->p->get_by_id($id)->row();\n $data['permiso'] = $permiso;\n if ($this->input->post() == false) {\n $this->load->view('preferencias/seguridad/permisos/formulario', $data);\n }\n else {\n $permiso = array(\n 'nombre' => $this->input->post('nombre'),\n 'icon' => $this->input->post('icon'),\n 'menu' => $this->input->post('menu')\n );\n $this->p->update($id, $permiso);\n $data['permiso'] = (object)$permiso;\n $data['mensaje'] = '<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Registro modificado</div>';\n $this->load->view('preferencias/seguridad/permisos/formulario', $data);\n }\n\n }", "public function update(UpdateRequest $request, Permission $permission): RedirectResponse\n {\n $this->permission->update($request, $permission);\n\n return redirect()->route('roles.index')->with('success', trans('messages.crud', [\n 'resource' => trans_choice('roles.permission', 1, ['permission_count' => '']),\n 'status' => trans('fields.updated')\n ]));\n }", "public function update(Requests\\PermissionRoleRequest $request, $id)\n {\n $model = PermissionRole::where('id',$id)->first();\n $input = $request->all();\n\n DB::beginTransaction();\n try {\n $model->update($input);\n DB::commit();\n Session::flash('message', \"Successfully Updated\");\n LogFileHelper::log_info('update-permission-role', 'Successfully updated ', ['Permission role role_id'.$id]);\n }\n catch ( Exception $e ){\n //If there are any exceptions, rollback the transaction\n DB::rollback();\n Session::flash('danger', $e->getMessage());\n LogFileHelper::log_error('update-permission-role', $e->getMessage(), ['Permission role role_id'.$id]);\n }\n return redirect()->route('index-permission-role');\n }", "public function update(Request $request, Permission $permission)\n {\n $this->authorize('update', Permission::class);\n\n if (str_replace(' ', '', $request->slug) != $request->slug) {\n return redirect()->back()->withInput()->with('error', __('laralum_permissions::general.slug_cannot_contain_spaces'));\n }\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'slug' => 'required|max:255|unique:laralum_permissions,slug,'.$permission->id,\n 'description' => 'required|max:500',\n ]);\n\n $permission->update($request->all());\n\n return redirect()->route('laralum::permissions.index')->with('success', __('laralum_permissions::general.permission_updated', ['id' => $permission->id]));\n }", "public function update(Request $request, Permission $permission)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $thisRole = Role::where('id',$id)->first();\n $originalPerms = $thisRole->perms->pluck('id')->toArray();\n $nowPerms = $request->input('permissions');\n $delete = [];\n $insert = [];\n foreach ($originalPerms as $perm)\n {\n if( ! in_array($perm , $nowPerms) )\n {\n array_push($delete,$perm);\n }\n }\n foreach ($nowPerms as $perm)\n {\n if( ! in_array($perm , $originalPerms) )\n {\n array_push($insert,$perm);\n }\n }\n foreach ($insert as $value)\n {\n $thisRole->attachPermission($value);\n }\n foreach ($delete as $value)\n {\n $thisRole->detachPermission($value);\n }\n return back()->with(\"message\",'操作成功!')->with('status',200)->withInput();\n }", "public function update(Request $request, Permission $permission)\n {\n $permission = $permission->update($request->all());\n }", "public function update() {\r\n try {\r\n $type = get_object_vars($this->model);\r\n\r\n foreach ($type as $key => $value) {\r\n if (in_array($key, $this->validColumns)) {\r\n if(is_bool($value)) {\r\n $value = (int)$value;\r\n }\r\n $data[$key] = $value;\r\n }\r\n }\r\n\r\n $this->db->update(\"assets_permissions\", $data, $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }\r\n catch (Exception $e) {\r\n throw $e;\r\n }\r\n }", "public function update(Request $request, $id)\n {\n \t$this->validate($request, [\n \t\t'display_name'=>'required',\n \t\t'description'=>'required',\n \t\t'permissions'=>'required',\n \t]);\n\n \t$role=Role::find($id);\n \t$role->display_name=request('display_name');\n \t$role->description=request('description');\n \t$role->save();\n\n \tDB::table('permission_role')->where('permission_role.role_id',$id)->delete();\n\n \tforeach (request('permissions') as $value) {\n //echo $value;\n $role->attachPermission($value);\n }\n\n return redirect('/admin/roles')->with('success','Role updated successfully.');\n }", "public function update(Request $request, $id)\n {\n $names = AdminPermission::where('name',$request->name)->get();\n $name = AdminPermission::where('id',$request->id)->first();\n if ($request->name != $name->name && count($names)>0){\n return redirect()->back()->with('fault','Name already exist');\n }\n $request->validate([\n 'id'=>'required',\n 'name' => 'required',\n 'type'=>'required'\n ]);\n $permission = AdminPermission::find($id);\n $permission->name = $request->name;\n $permission->type = $request->type;\n if ($request->type == 'custom'){\n $permission->custom = implode(\", \",$request->customs);\n }else{\n $permission->custom = null;\n }\n $result = $permission->update();\n if ($result){\n return redirect()->back()->with('success','Permission edited');\n }else{\n return redirect()->back()->with('fault','Permission not edited');\n }\n }", "public function updated(Permission $permission)\n {\n //\n }", "public function actionUpdate($id)\n {\n $role = $this->authManager->getRole($id);\n $model = new RoleForm();\n $model->name = $role->name;\n $model->description = $role->description;\n $model->rule_name = $role->ruleName;\n $model->data = $role->data;\n if ($model->load(Yii::$app->request->post())) {\n $role = new \\yii\\rbac\\Role();\n $role->name = $model->name;\n $role->description = $model->description;\n $role->type = $model->type;\n $role->ruleName = empty($model->rule_name) ? null : $model->rule_name;\n $role->data = $model->data;\n\n $this->authManager->update($id,$role);\n $this->authManager->removeChildren($role);\n if(is_array($model->child) && count($model->child)){\n foreach($model->child as $name){\n $this->authManager->addChild($role,$this->authManager->getPermission($name));\n }\n }\n return $this->redirect(['update', 'id' => $model->name]);\n } else {\n\n $_selected = $this->authManager->getPermissionsByRole($id);\n if($_selected != null){\n foreach($_selected as $item){\n $model->child[] = $item->name;\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'permissions' => $this->authManager->getPermissions()\n ]);\n }\n }", "public function update(ValidarPermiso $request, $id)\n {\n //\n Permission::findOrFail($id)->update($request->all());\n return redirect('admin/permission')->with('menssage', 'Permiso actualizado con exito');\n }", "public function update(Request $request, $id)\n { \n // return $request->all();\n $role = Role::findOrFail($id);\n // $this->validate($request, [\n // 'name'=>'required|'.Rule::unique('roles')->ignore($id, 'id')\n // ]);\n\n $input = $request->except(['permissions']);\n $permissions = $request['permissions'];\n $role->fill($input)->save();\n $p_all = Permission::all();\n\n foreach ($p_all as $p) {\n $role->revokePermissionTo($p);\n }\n\n foreach ($permissions as $permission) {\n $p = Permission::where('id', '=', $permission)->firstOrFail(); //Get corresponding form permission in db\n $role->givePermissionTo($p); \n }\n\n if (View::exists('roles.create')) {\n return redirect()->route('roles.webIndex')->with('flash_message', 'Role'. $role->name.' updated!');\n } else {\n return redirect()->route('laravel-permission::roles.index')->with('flash_message', 'Role'. $role->name.' updated!');\n }\n }", "public function update(PermissionUpdate $request, Permission $permission)\n {\n $permission->update($request->only('label'));\n\n return back()->withNotify('İzin Güncellendi!');\n }", "public function update(Request $request)\n {\n $data = $request->all();\n\n return Permission::whereId($request->get('id'))->update($data);\n }", "public function update(Request $request, $id) {\r\n $this->validate($request, [\r\n 'display_name' => 'required',\r\n 'permission' => 'required',\r\n ]);\r\n\r\n $role = Role::find($id);\r\n $role->display_name = $request->input('display_name');\r\n $role->description = $request->input('description');\r\n $role->save();\r\n\r\n DB::table(\"permission_role\")->where(\"permission_role.role_id\",$id)\r\n ->delete();\r\n\r\n foreach ($request->input('permission') as $key => $value) {\r\n $role->attachPermission($value);\r\n }\r\n\r\n return redirect()->route('admin.roles.index')\r\n ->with('success','Role updated successfully');\r\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'permission' => 'required',\n ]);\n \n $role = self::$modelName::find($id);\n $role->name = $request->input('name');\n $role->save();\n \n $role->syncPermissions($request->input('permission'));\n \n return redirect()->route('roles.index')\n ->with('success','Role updated successfully');\n }", "public function update(Request $request, $pid)\n {\n $permissions= UserPermissions::find($pid);\n $permissions->role=$request->get('role');\n $permissions->permissions=json_encode($request->get('permissions'));\n $permissions->save();\n\n return redirect('layouts.dashboard.admin.crud.permissions.edit')->with('successful', 'Permission(s) has been added');\n }", "public function update(Request $request, $id) {\n\n //Check Edit Access Permission\n $this->EditAccess = Permit::AccessPermission('permissions-edit');\n if (!$this->EditAccess)\n return redirect('errors/401');\n\n //Ajax request\n if (request()->ajax()) {\n $Permission = Permission::findOrFail($id);\n $Permission->update(['status' => $request->status]);\n return response()->json(['response' => config('global.statusUpdated')]);\n }\n $Permission = Permission::findOrFail($id);\n\n\n // validate\n $validator = Validator::make($request->all(), [\n 'groupname' => 'required'\n ]);\n\n // validation failed\n if ($validator->fails()) {\n\n return redirect('admin/permissions/' . $id . '/edit')\n ->withErrors($validator)->withInput();\n } else {\n\n $input = $request->only(['groupname', 'status']);\n $collection = collect($request->permissions);\n $input['permissions'] = $collection->toJson();\n $Permission->fill($input)->save();\n\n //logActivity\n LogActivity::addToLog('Permission - ' . $request->groupname, 'updated');\n\n Session::flash('message', config('global.updatedRecords'));\n\n return redirect('admin/permissions');\n }\n }", "public function edit($id)\n {\n if (Auth::user()->ability('superadministrator', 'update-permissions')){\n return view('permission.update',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'更新',\n 'permission'=>Permission::findOrFail($id),\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function permission_update(Request $request, $RoleId)\n {\n\n $data = array(\n 'RoleId' => $request->input('RoleId'),\n 'UserAd' => $request->input('UserAd'),\n 'UserPr' => $request->input('UserPr'),\n 'DriverAd' => $request->input('DriverAd'),\n 'AssetMa' => $request->input('AssetMa'),\n 'VehiclePr' => $request->input('VehiclePr'),\n 'InventoryIt' => $request->input('InventoryIt'),\n 'WorkOr' => $request->input('WorkOr'),\n 'ClientAd' => $request->input('ClientAd'),\n 'ClientPr' => $request->input('ClientPr'),\n 'ClientVe' => $request->input('ClientVe'),\n 'ClientWo' => $request->input('ClientWo'),\n 'JobMa' => $request->input('JobMa'),\n 'Job' => $request->input('Job'),\n 'WorkforceSc' => $request->input('WorkforceSc'),\n 'AssignVe' => $request->input('AssignVe'),\n 'AssignJo' => $request->input('AssignJo'),\n 'Community' => $request->input('Community'),\n 'Report' => $request->input('Report'),\n 'SysteCo' => $request->input('SysteCo'),\n 'CreatedBy' => $request->input('CreatedBy'),\n 'updated_at' => date('Y-m-j')\n );\n\n Permission::where('RoleId', $RoleId)->update($data);\n return redirect()->route('role.index')->with('info', 'Role Permission Updated Successfully');\n\n }", "public function update(Request $request, $id)\n {\n\n\n $role= Role::findOrFail($id);\n $request->validate([\n 'name'=>'required|max:50|unique:roles,name,'.$id,\n 'slug'=>'required|max:50|unique:roles,slug,'.$id,\n 'full-access'=>'required|in:yes,no',\n 'description'=>'required'\n ]);\n $role->update($request->all());\n if($request->get('permission'))\n {\n $role->permissions()->sync($request->get('permission'));\n }\n else\n {\n $role->permissions()->detach();\n }\n return redirect()->route('roles.index');\n }", "public function updateRolePermissions()\n\t{\n\t\t$input = Input::all();\n\n\t\tforeach ($input['permissions'] as $role => $permissions) {\n\t\t\tRole::whereName($role)->first()->perms()->sync($permissions);\n\t\t}\n\n\t\treturn Redirect::route('role.permissions.edit')\n\t\t\t\t\t\t\t->with('message', 'Successfully updated role permissions')\n\t\t\t\t\t\t\t->with('alert-class', 'success');\n\t}", "public function update(Request $request, $id)\n {\n // dd($request->all());\n RoleHasPermission::where(\"role_id\", $id)->delete();\n foreach ($request->permission_id as $key => $value) {\n $data[] = [\n \"permission_id\" => $request->permission_id[$key],\n \"role_id\" => $id,\n ];\n }\n RoleHasPermission::insert($data);\n// $user=User::find(Auth::user()->id);\n// $permission_name=Role::find($id);\n// $user->syncRoles([$permission_name->name]);\n return back();\n }", "public function update($id, Request $request): RedirectResponse\n {\n try {\n $data = $this->getData($request);\n\n $permission = Permission::findOrFail($id);\n $permission->update($data);\n\n return redirect()->route('permissions.permission.index')->with('success_message', 'Permission was successfully updated!');\n } catch (Exception $exception) {\n return back()->withInput()->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request!']);\n }\n }", "public function update(Request $request)\n {\n $role = Role::findOrFail($request->id);\n $role->name = $request->name;\n $role->syncPermissions($request->permissions);\n\n $save = $role->save();\n\n if($save) {\n Alert::toast('Sukses mengubah data', 'success');\n } else {\n Alert::toast('Terjadi kesalahan!', 'error');\n }\n return redirect()->route('admin.user.index');\n }", "public function update(Request $request, $id)\n {\n\n $category=User_category::find($id);\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n $category->category_description=$request->input('description');\n $category->deleted=false;\n\n\n $category->save();\n //$category_id=$category->user_category_id;\n\n if (isset($_POST['permissions'])) {\n foreach (($_POST['permissions']) as $permission){\n $perm=new Category_permission();\n $perm->category_id=$id;\n $perm->permission_id=$permission;\n $perm->deleted=false;\n $perm->save();\n }\n }\n\n\n // auth()->login();\n\n return redirect('/')->with('success','Category updated');\n\n\n }", "public function update(PermissionRequest $request, $id)\n {\n // Authorization is declared in the PermissionRequest\n\n // Retrieve the validated input data....\n $validatedData = $request->validated();\n $permission = Permission::findOrFail($id);\n $permission->update($validatedData);\n return response()->json([\n 'status' => true, \n 'message' => \"Permission \\\"{$permission->name}\\\" updated successfully.\",\n 'data' => Permission::find($permission->id)\n ], 200);\n }", "public function update(Request $request, $id){\n try{\n\n //Find the user using the id\n $user = User::find($id);\n\n if (!$user) { //If the user not found\n return $this->userNotFoundResponse();\n }\n \n //Delete all old permissions\n $user->permissions()->detach();\n \n //Add new permissions\n foreach($request->all() as $row){\n $result = $user->permissions()->attach(Permission::where('name', $row)->first());\n }\n\n //Get all permissions of the user\n $permissions = $user->permissions()->get();\n //Get all System Modules with thier permissions\n $sysModules = SystemModule::with('permissions')->get();\n\n\n //build the response\n $code = 200;\n $status = 'success';\n $message = 'The permissions have been updated successfully';\n $dataContent = [\n 'user_permissions' => $permissions->toArray(),\n 'sysModulesPermissions'=> $sysModules->toArray()\n ];\n\n \n\n }catch (Exception $e) {\n\n //build the response\n $code = 401;\n $status = 'Exception';\n $message = \"Something went wrong\";\n $dataContent = $e;\n }\n\n return $this->returnApiResult($code, $status, $message, $dataContent);\n \n }", "public function update(Request $request, $id)\n {\n\n $request->validate([\n 'role_name' => 'max:255|required|unique:roles,name,' . $id,\n ], [\n 'role_name.unique' => 'Tên vai trò đã tồn tại',\n 'role_name.required' => 'Tên vai trò không được để trống',\n ]);\n\n if (!$request->has('permissions')) {\n $permissions = [];\n } else {\n $permissions = $request->permissions;\n }\n\n $role = Role::findOrFail($id);\n\n $role->update([\n 'name' => $request->role_name,\n ]);\n\n foreach ($role->permissions as $permission) {\n $role->revokePermissionTo($permission);\n }\n\n foreach ($permissions as $permission) {\n $role->givePermissionTo($permission);\n }\n\n return redirect()->route('admin.permission.index')->with(['success' => 'Cập nhật thành công']);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n \"name\" => \"required\",\n \"slug\" => \"required\",\n ],[\n \"name.required\" => \"ce champ est obligatoire.\",\n \"slug.required\" => \"ce champ est obligatoire.\"\n ]);\n\n $permission = Permission::FindOrFail($id);\n\n $permission->update([\n \"name\" => $request->name,\n \"slug\" => $request->slug,\n ]);\n\n return redirect()->route('permission.show', $permission);\n }", "public function actionUpdate()\n\t{\n\n\t\t//print_r (Yii::app()->user);\n\t\tif (Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\n\t\t$model=$this->loadarticles();\n\t\t$params=array('Articles'=>$model);\n//\t\tif(Yii::app()->user->checkAccess('updateOwnArticle',$params))\n//\t\t{\n//\t\t\t\n\t\t\tif(isset($_POST['Articles']))\n\t\t\t{\n\t\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\t\tif($model->save()){\n\t\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t\t\t}\n\t\t\t}\n//\t\t}else{\n//\t\t\techo \"no permissions\";\n//\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function actionUpdate($id)\n {\n \n if (!Yii::$app->user->can(\"admin\")) {\n throw new HttpException(403, 'You are not allowed to perform this action.');\n }\n \n $model = $this->findModel($id);\n \n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n $permission = Permission::findOrfail($id);\n $this->validate($request, [\n 'name' => 'required|string|max:255',\n ]);\n\n foreach($permission->getRoleNames() as $role){\n $permission->removeRole($role);\n } \n\n $permission->update(['name' => $request->name]);\n\n foreach($request->role as $role){\n $permission->assignRole($role);\n }\n\n return ['message' => 'Permission updated Successfully'];\n }", "public function update($id, UpdatePermissionGroupRequest $request)\n {\n $this->groups->update($id,$request->all());\n return redirect()->route('admin.access.roles.permissions.index')->withFlashSuccess(trans('alerts.backend.permissions.groups.created'));\n }", "public function update(PermissionUpdateRequest $request, $id)\n {\n\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE);\n\n $permission = $this->repository->update($request->all(), $id);\n\n $response = [\n 'message' => 'Permission updated.',\n 'data' => $permission->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\n if ($request->wantsJson()) {\n\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 update(Request $request, $id)\n {\n if($id == '1' || $id == '3' || $id == '8')\n {\n return redirect()->route('roles.index')\n ->with('error','This Role cannot be Updated');\n }\n\n $this->validate($request, [\n 'name' => 'required',\n // 'permission' => 'required',\n ]);\n \n $role = Role::find($id);\n $role->name = $request->input('name');\n $role->status = $request->input('status');\n $role->updated_by = Auth::id();\n $role->save(); \n \n $role->syncPermissions($request->input('permission'));\n \n return redirect()->route('roles.index')\n ->with('success','Role updated successfully');\n }", "public function update(Request $request, $id)\n {\n try {\n DB::beginTransaction();\n // update to table role\n $this->role->where('id',$id)->update([\n 'name'=>$request->name,\n ]);\n\n // update to table permission_role\n DB::table('permission_role')->where('role_id', $id)->delete();\n $roleCreate = $this->role->find($id);\n $roleCreate->permissions()->attach($request->permission);\n\n DB::commit();\n // success\n return redirect()->route('admin.role.index')->with('success', 'Cập nhật vai trò thành công!');\n // dd($request->permission);\n } catch (\\Exception $ex) {\n DB::rollback();\n\n return redirect()->back()->with('error', $ex->getMessage());\n }\n }", "public function update(Request $request, $id)\n {\n $data = $request->except('_token','save');\n $data['guard_name'] = 'admins';\n $role = Role::find($id);\n $role->fill($data)->update();\n\n // nếu xóa revokePermissionTo hàm của package\n $allPermission = Permission::all();\n foreach ($allPermission as $permission)\n $role->revokePermissionTo($permission);\n\n // check nếu chưa lưu permission vào role\n if ($permissions = $request->permission){\n foreach ($permissions as $permission)\n // dùng hàm có sẵn của package\n $role->givePermissionTo($permission);\n }\n\n $this->showMessagesSuccess('Cập nhật thành công');\n return redirect()->route('get_admin.role.index');\n\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\t\t$authManager=Yii::app()->authManager;\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['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$selUserGroups = array_combine($_POST['UserGroups'],$_POST['UserGroups']);\n\n\t\t\tforeach($authManager->getRoles() as $ug) \n\t\t\t{\t\n\t\t\t\tif(isset($selUserGroups[$ug->name]) && !$authManager->isAssigned($ug->name,$id)) {\n\t\t\t\t\t$authManager->assign($ug->name,$id);\n\t\t\t\t} else if(!isset($selUserGroups[$ug->name])) {\n\t\t\t\t\t$authManager->revoke($ug->name,$id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\t\t\n\t\t$userGroups = Yii::app()->authManager->getRoles($model->id);\n\t\t$groups = $authManager->getRoles();\n\t\tunset($groups['Anonymous']);\n\n\t\t$this->layout='//layouts/column1';\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t'groups'=>$groups,\n\t\t\t'userGroups'=>$userGroups,\n\t\t));\n\t}", "public function update(PermissionRequest $request, $id)\n {\n return $this->permissionService->update($request, $id);\n }", "public function update(Request $request, $id) {\n //\n $role = Role::find($id);\n $role->name = $request->name;\n $role->display_name = $request->display_name;\n $role->description = $request->description;\n $role->save();\n DB::table('permission_role')->where('role_id', $id)->delete();\n foreach ($request->permission as $key => $value) {\n $role->attachPermission($value);\n }\n return redirect()->route('role.index')->withMessage('Role Updated');\n }", "public function update(Request $request, Permission $privilegio)\n {\n $privilegio->update($request->all());\n return redirect()->route('privilegios.edit' , $privilegio->id)\n ->with('info', 'Permission Actualizado con Exito');\n }", "public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $usuario = Usuario::findOne($model->usuario_idusuario);\n $rol = \\app\\models\\AuthAssignment::find()->where(['user_id'=>$model->usuario_idusuario])->one();\n $model->tipo = $rol->item_name;\n $passAntigua = $usuario->password;\n if ($usuario->load(Yii::$app->request->post()) && $usuario->save()) {\n $model->load(Yii::$app->request->post());\n if(strlen($usuario->password)==32){\n $usuario->password = $passAntigua;\n }else{\n $usuario->password = md5($usuario->password);\n }\n $usuario->save();\n if ($model->save()) {\n if($rol->item_name != $model->tipo){\n $auth = \\Yii::$app->authManager;\n $role = $auth->getRole($model->tipo);\n $auth->assign($role, $usuario->idusuario);\n $rol->delete();\n }\n return $this->redirect(['view', 'id' => $model->idempleado]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'usuario' => $usuario,\n ]);\n }", "private function update(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check permission to update.\n\t\t$result = $this->clsAccessPermission->toUpdate();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to update!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute Update.\n\t\tif (! $this->objAccessCrud->update ()) {\n\t\t\t$this->msg->setError (\"There were issues on update the record!\");\n\t\t\treturn;\n\t\t}\n\t\t$this->msg->setSuccess (\"Updated the record with success!\");\n\t\treturn;\n\t}", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n ]);\n \n $role = Role::find($id);\n $role->name = $request->input('name');\n $role->save();\n \n $role->syncPermissions($request->input('permission'));\n \n return redirect()->route('roles.index')\n ->with('message','Role updated successfully');\n }", "public function update(RoleRequest $request, $id)\n {\n $role = Role::find($id);\n $role->display_name = $request->input('display_name');\n $role->description = $request->input('description');\n $role->save();\n DB::table(\"permission_role\")->where(\"permission_role.role_id\",$id)\n ->delete();\n foreach ($request->input('permission') as $key => $value) {\n $role->attachPermission($value);\n }\n return redirect()->route('admin.roles')\n ->with('success','Permissão atualizada com sucesso');\n }", "public function update(Request $request, $id)\n {\n $reqExecTimeId = 50;\n\n if ($this->privileges[\"role\"] != 3 && $this->privileges[\"role\"] != 2) {\n return response()->json([\n 'message' => 'Forbidden'\n ], 403);\n }\n $new_data = json_decode($request->getContent(), true);\n if ($new_data == null) {\n $new_data = $request->all();\n }\n\n try {\n $Permission = Permission::findOrFail($id);\n\n $Permission->setSelf($new_data);\n // if ($Permission->isValide()) {\n $Permission->save();\n // }\n $res = new PermissionTemplate($Permission);\n } catch (ModelNotFoundException $e) {\n $res = response()->json([\n 'error' => \"Invalid_or_missing_fields\"\n ], 500);\n }\n\n $this->workEnd($reqExecTimeId);\n return $res;\n }", "public function update(Request $request)\n {\n $permissions = Permission::orderBy('id')->get();\n foreach ($permissions as $permission) {\n $permissionToSave = Permission::findOrFail($permission->id);\n $roles = Role::orderBy('id')->get();\n foreach ($roles as $role) {\n $name = \"permission-\".$permissionToSave->id.\"-\".$role->id;\n if ($request->$name != NULL) {\n $permissionToSave->assignRole($role);\n } else {\n $permissionToSave->removeRole($role);\n }\n } \n } \n return redirect('backend/permissions');\n }", "public function update(Request $request, Permission $permission)\n {\n $this->validate($request, [\n 'name' => 'required',\n ]);\n\n $permission->update($request->all());\n\n return $permission;\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, \n [\n 'inputName' => 'required',\n 'permission' => 'required',\n ],\n [\n 'inputName.required' => 'Nama roles harus di isi',\n 'permission.required' => 'Silakan pilih permission',\n ]);\n \n $role = Role::find($id);\n $role->name = $request->input('inputName');\n $role->save();\n \n $role->syncPermissions($request->input('permission'));\n\n $response = array('status' => 200,'message' => 'Role updated successfully.','success' => 'OK','location' => '/roles/index');\n echo json_encode($response);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n \n $user = User::find()->where([\n 'id'=>$id\n ])->one();\n if($user->password_hash==$model->password_hash){\n $model->password_hash=$user->password_hash;\n }else{\n $model->password_hash=Yii::$app->security->generatePasswordHash($model->password_hash);\n }\n \n if($model->save()){\n \n $id=$model->id;\n \n if($model->type==1){\n $auth_assignment = Yii::$app->db->createCommand(\"UPDATE `auth_assignment` SET `item_name`='Boss' WHERE `user_id`='$id'\")\n ->execute();\n }\n if($model->type==2){\n $auth_assignment = Yii::$app->db->createCommand(\"UPDATE `auth_assignment` SET `item_name`='Nurse' WHERE `user_id`='$id'\")\n ->execute();\n }\n if($model->type==3){\n$auth_assignment = Yii::$app->db->createCommand(\"UPDATE `auth_assignment` SET `item_name`='Medicalrecords' WHERE `user_id`='$id'\")\n ->execute();\n }\n \n Yii::$app->getSession()->setFlash('update', [\n 'type' => 'warning',\n 'duration' => 5000,\n 'icon' => 'fa fa-users',\n 'message' => 'สำเร็จ',\n 'title' => 'แก้ไขข้อมูล',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n \n return $this->redirect(['view', 'id' => $model->id]);\n } } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Settings'])) {\n $model->attributes = $_POST['Settings'];\n if ($model->save()) {\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function update(Request $request, $id)\n {\n //\n\n $requestData = $request->except('permissions');\n $permissions = $request->permissions;\n\n $role = Role::findOrFail($id);\n $role->update($requestData);\n\n $role->syncPermissions($permissions);\n\n Alert::success('Role updated Successfully.'); \n return redirect()->back();\n\n\n\n }", "public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }", "public function update(UpdatePermission $request, $id)\n {\n $permission = Permission::findOrFail($id);\n\n $validated = $request->validated();\n\n foreach ($validated as $key => $value) {\n $permission[$key] = $value;\n }\n\n $permission->save();\n $success = new PermissionResource($permission);\n\n return $this->sendResponse(trans('response.success_permission_update'), $success);\n }" ]
[ "0.71113694", "0.7051249", "0.6948477", "0.6840207", "0.6784284", "0.6779869", "0.6774511", "0.675797", "0.6745133", "0.67407125", "0.673798", "0.67277944", "0.66975456", "0.6685757", "0.6683766", "0.66778255", "0.6649236", "0.6648501", "0.6646448", "0.66422653", "0.6638117", "0.66185457", "0.6617032", "0.66011864", "0.6591505", "0.65771437", "0.656521", "0.656521", "0.65466577", "0.65456057", "0.6514975", "0.6501969", "0.6494228", "0.64898664", "0.6482482", "0.64582247", "0.64571166", "0.645031", "0.64500934", "0.644892", "0.6440409", "0.64316434", "0.6421167", "0.64114237", "0.63977104", "0.6393599", "0.6356373", "0.6355022", "0.6342166", "0.63361716", "0.6326742", "0.63130647", "0.6295576", "0.6290084", "0.6274941", "0.6274548", "0.62661093", "0.62558556", "0.62358755", "0.6223274", "0.62175053", "0.62128824", "0.62106586", "0.6203912", "0.6192428", "0.6188769", "0.6162695", "0.6160674", "0.61605537", "0.6158738", "0.6130178", "0.6119411", "0.61127424", "0.6112176", "0.6107054", "0.6097625", "0.60942775", "0.6088056", "0.6083619", "0.60609084", "0.6047333", "0.60402644", "0.60289615", "0.6019225", "0.60056", "0.60039467", "0.59892803", "0.5989229", "0.5988213", "0.59848106", "0.5979631", "0.5979606", "0.59773415", "0.59768444", "0.5976257", "0.5975739", "0.5975351", "0.59724504", "0.597185", "0.59700334" ]
0.687027
3
Displays a single Permission model.
public function actionView($id) { $model = $this->findModel($id); $event = Yii::t('app', 'view record {id}', ['id' => $model->permission_id]); $bitacora = new Bitacora(); $bitacora->register($event, 'actionView', MSG_INFO); return $this->render(ACTION_VIEW, [MODEL => $model]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show()\n {\n return view('permission::show');\n }", "public function show(Permission $permission)\n {\n //\n }", "public function show(Permission $permission)\n {\n //\n }", "public function show(Permission $permission)\n {\n //\n }", "public function show($id)\n {\n $row = Permission::findOrFail($id);\n $title = 'Permission '. $row->display_name . ' details';\n return view('admin.permission.view',compact('title', 'row'));\n }", "public function show($id)\n {\n $permission = Permission::findOrFail($id);\n return view('admin.permissions.show', ['permission' => $permission]);\n }", "public function show($id)\n {\n $permission = Permission::FindOrFail($id);\n return view('permissions.show_permission', compact('permission'));\n }", "public function show($id)\n {\n $permission = $this->model->find($id);\n // $this->authorize('view', $permission);\n return $this->toTable($permission);\n }", "public function show($id)\n {\n $permission = Permission::with('module')->findOrFail($id);\n return view('permissions.show', compact('permission'));\n }", "public function show($id)\n {\n $permission = Permission::findOrFail($id);\n\n return view('permissions.show', compact('permission'));\n }", "public function show($id)\n {\n $permiso = Permission::find($id);\n\n return view('intranet.permisos.show', compact('permiso'));\n }", "public function show($id): View\n {\n $permission = Permission::findOrFail($id);\n\n return view('permissions.show', compact('permission'));\n }", "public function show($id) {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.view'))) return redirect()->route('home');\n\n\t\t// using an implementation of the Permission Repository Interface\n\t\t$permission = $this->permissionRepository->find($id);\n\n\t\t//dd(__METHOD__.'('.__LINE__.')',compact('permission'));\n\t\treturn view('pages.permission.show', compact('permission'));\n\t}", "public function index()\n {\n $permissions = Permission::all();\n return view('admin.permission.show',compact('permissions'));\n }", "public function show($id)\n {\n $UserPermission = UserPermission::find($id);\n // dd($UserPermission);\n return view('admin.pages.spatie.permission.show',compact('UserPermission'))->with(['menu'=>'user_permission']);\n }", "public function edit()\n {\n return view('permission::edit');\n }", "public function show(Permission $permission)\n {\n return view('privilegios.show', compact('permission'));\n }", "public function show(RolePermission $rolePermission)\n {\n //\n }", "public function index()\n {\n $permissions = Permission::all();\n $user = UserDetail::findOrFail(Session::get('id'));\n return view('admin.permissions.index', compact('permissions', 'user'));\n }", "public function show($id)\n {\n $pageTitle = 'View Permission Role';\n $data = PermissionRole::where('id',$id)->first();\n\n return view('user::permission_role.view', ['data' => $data, 'pageTitle'=> $pageTitle]);\n }", "public function show($id)\n {\n $title = $this->title;\n $module_name = $this->module_name;\n $module_name_singular = str_singular($this->module_name);\n $module_icon = $this->module_icon;\n $module_action = \"Details\";\n\n $$module_name_singular = Permission::findOrFail($id);\n\n return view(\"backend.$module_name.show\", compact('module_name', \"$module_name_singular\", 'module_icon', 'module_action', 'title'));\n }", "function list()\n {\n if($this->checkAccess('permission.list') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n { \n \n $data['permissionRecords'] = $this->permission_model->permissionListing();\n \n $this->global['pageTitle'] = 'School : Permission Listing';\n \n $this->loadViews(\"permission/list\", $this->global, $data, NULL);\n }\n }", "public function show(Permission $permission)\n {\n return view('admin.permissions.show',compact('permission'));\n }", "public function index()\n {\n abort_unless(Gate::allows('permission-access'), 403);\n\n $permissions = Permission::all();\n\n return view('admin.permission.index', compact('permissions'));\n }", "public function index()\n {\n abort_unless(Gate::allows('permission-access'), 403);\n\n $permissions = Permission::all();\n\n return view('admin.permission.index', compact('permissions'));\n }", "public function show($id)\n {\n $permission = $this->repository->find($id);\n if (request()->wantsJson()) {\n return response()->json([\n 'data' => $permission,\n ]);\n }\n return view('permissions.show', compact('permission'));\n }", "public function index()\n {\n $permission = MyPermission::all();\n $assign = [\n 'all_permission'=>$permission,\n ];\n return view('system.permission',$assign);\n }", "public function index()\n {\n $perms = Permission::all();\n return view('admin.permissions.index', ['permissions' => $perms]);\n }", "public static function getPermissionModel()\n {\n return static::getModel('Permissions');\n }", "public function index()\n {\n $permissions = Permission::all();\n return view('permissions.index_permission', compact('permissions'));\n }", "public function show(Permission $permission)\n {\n $permission->load('users','roles');\n\n return $permission;\n }", "function model()\n {\n return Permission::class;\n }", "public function index(): View\n {\n $permissions = Permission::all();\n\n return view('admin.permissions.index', compact('permissions'));\n }", "public function index()\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n\n $permissions = Permission::all();\n\n return view('admin.permissions.index', compact('permissions'));\n }", "public function show($id)\n {\n $permission = $this->repository->find($id);\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $permission,\n ]);\n }\n\n return view('permissions.show', compact('permission'));\n }", "public function edit($id)\n {\n $permission = Permission::findOrFail($id);\n return view('admin.permissions.edit', ['permission' => $permission]);\n }", "public function edit($id) {\n $permission = Permission::findOrFail($id);\n\n return view('permissions.edit', compact('permission'));\n }", "public function edit($id)\n {\n $permission = $this->model->find($id);\n // $this->authorize('update', $permission);\n\n return view('core::permissions.edit', compact('permission'));\n }", "protected function _getPermissionModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Permission');\n\t}", "public function index()\n {\n return view('backend.permission.index');\n }", "public function index()\n {\n $permissions = buildPermission($this->permission->all());\n return view('permission.index', compact('permissions'));\n }", "public function edit($id)\n {\n $permission = Permission::findOrFail($id);\n \n\n return view('permissions.edit', compact('permission'));\n }", "public function edit($id)\n {\n $row = Permission::findOrFail($id);\n $title = 'Edit '. $row->display_name . ' details';\n return view('admin.permission.edit',compact('title', 'row'));\n }", "public function index()\n {\n $permissions = Permission::select(['id', 'name', 'created_at','updated_at'])->latest('created_at')->paginate();\n\n return view('permission.index', [\n 'permissions' => $permissions\n ]);\n }", "public function show($id)\n {\n return $this->permissionService->show($id);\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function model()\n {\n return Permission::class;\n }", "public function index()\n {\n return view(\"role_permission.permissionlist\");\n }", "public function edit($id)\n {\n $permission = Permission::findOrFail($id);\n $modules = Module::pluck('name','id')->all();\n\n return view('permissions.edit', compact('permission','modules'));\n }", "public function permission()\n {\n if ( ! auth()->guard('admin')->user()->can('access permission ' . $this->table)) {\n return redirect()->route('admin.setting.index')->with('alert-danger', __($this->noPermission));\n }\n $view = [\n 'back' => route('admin.setting.index'),\n 'title' => __('Permission Settings'),\n 'breadcrumbs' => [\n route('admin.setting.index') => __('Setting'),\n route('admin.setting.permission.index') => __('Permission'),\n null => __('Edit')\n ],\n 'subtitle' => __('All About Permission Settings'),\n 'description' => __('You can adjust all permission settings here'),\n 'navs' => $this->settings,\n 'setting' => $this->settings->where('slug', 'permission')->first(),\n 'roles' => Role::orderBy('name', 'asc')->pluck('name', 'id')->toArray()\n ];\n return view('admin.setting.permission.index', $view);\n }", "public function indexAction()\n {\n $this->get('Services')->setMenuItem('Permission');\n $em = $this->getDoctrine()->getManager();\n\n $permissions = $em->getRepository('WbcAdministratorBundle:Permission')->findAll();\n\n return $this->render('permission/index.html.twig', array(\n 'permissions' => $permissions,\n ));\n }", "public function index()\n {\n $permissions = Permission::all();\n return view('permissions.index', [\n 'permissions' => $permissions\n ]);\n }", "public function index() {\n $permissions = Permission::orderBy('id','desc')->paginate(10); //Get all permissions\n\n return view('permissions.index')->with('permissions', $permissions);\n }", "public function edit($id)\n {\n\n $permission = $this->repository->find($id);\n\n return view('permissions.edit', compact('permission'));\n }", "public function index()\n {\n $permissions = Permission::latest()->paginate(10);\n $pageTitle = $this->getPageTitle() . \" - لیست\";\n return view('Dashboard.Permission.index', compact('pageTitle', 'permissions'));\n }", "public function show($id)\n {\n $permission = Permission::findOrFail($id);\n\n $this->authorize('view', [Permission::class, $permission]);\n \n return response()->json([\n 'status' => true, \n 'message' => \"Successful.\",\n 'data' => $permission\n ], 200); \n }", "public function edit($id)\n {\n $permission = Permission::findOrFail($id);\n $user = UserDetail::findOrFail(Session::get('id'));\n \n return view('admin.permissions.edit', compact('permission', 'user'));\n }", "public function index()\n\t{\n\t\t$perms = Permission::all();\n\t\treturn View('permisos.index',compact('perms'));\n\t}", "public function index()\n {\n if (Auth::user()->ability('superadministrator', 'read-permissions')){\n return view('permission.read',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'列表',\n 'permissions'=>Permission::all(),\n 'enableUpdate'=>Auth::user()->hasPermission('update-permissions'),\n 'enableDelete'=>Auth::user()->hasPermission('delete-permissions'),\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function index()\n {\n $permissions = Permission::paginate(20);\n return view('backend.permissions', ['permissions' => $permissions]);\n }", "public function index()\n {\n $permissionsList = Permission::all();\n return view('UserCenter.Permissions.index', compact('permissionsList'));\n }", "public function edit($id): View\n {\n $permission = Permission::findOrFail($id);\n\n return view('permissions.edit', compact('permission'));\n }", "public function actionIndex()\n {\n $sm_permission = new PermissionSearch();\n $dp_permission = $sm_permission->search(\n Yii::$app->request->queryParams\n );\n\n $pageSize = $this->pageSize();\n $dp_permission->pagination->pageSize = $pageSize;\n\n return $this->render(\n ACTION_INDEX,\n [\n 'dataProvider' => $dp_permission,\n PAGE_SIZE => $pageSize,\n 'searchModel' => $sm_permission,\n 'controller_id' => $sm_permission->controller_id\n ]\n );\n }", "public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }", "public function index()\n {\n return view('config.permission');\n }", "public function index(): View\n {\n $permissions = Permission::paginate(25);\n\n return view('permissions.index', compact('permissions'));\n }", "public function index()\n {\n /* Permission List */\n if (Auth::user()->hasRole('superadmin')) {\n $permissions = Permission::latest()->get();\n return view('superadmin.permission.index', compact('permissions'));\n }\n abort(403);\n }", "public function index()\n {\n //\n // $permissions = Permissions::orderBy('id')->get();\n\n $permissions = DB::table('permissions')->select('id','name', 'slug')->orderBy('id')->get();\n\n return view('admin.permission.indexP',compact('permissions'));\n }", "public function show($id)\n {\n $role = self::$modelName::find($id);\n $rolePermissions = Permission::join(\"role_has_permissions\",\"role_has_permissions.permission_id\",\"=\",\"permissions.id\")\n ->where(\"role_has_permissions.role_id\",$id)\n ->get();\n // dd($rolePermissions);\n $page_title = self::$pageTitle;\n $pageDescription = self::$pageTitle.' Detail Data';\n $page_breadcrumbs = [\n url(self::$folderPath.'/') => \"List \".self::$pageTitle,\n url(self::$folderPath.'/show') => $pageDescription\n ];\n $permissionName = self::$folderPath;\n return view('roles.show',compact('role','rolePermissions','page_title', 'pageDescription', 'page_breadcrumbs', 'permissionName'));\n }", "public function edit($id)\n\t{\n\t\t$perm = Permission::findOrFail($id);\n\t\treturn View('permisos.edit', compact('perm'));\n\t}", "public function model(): string\n {\n return Permission::class;\n }", "public function model(): string\n {\n return Permission::class;\n }", "public function actionView($id)\n {\n\t\t\t\t\t\t\t\t if(!PermissionUtils::checkModuleActionPermission(\"Users\",PermissionUtils::VIEW_ONE)){\n\t\t\t\tthrow new ForbiddenHttpException('You are not allowed to perform this action.');\n } \n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n {\n return view('back_end.permissions');\n }", "public function actionView($id)\n\t{\n\t\t$this->allowUser(SUPERADMINISTRATOR);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function edit($id)\n {\n if (Auth::user()->hasRole('superadmin')) {\n $permission = Permission::findOrFail($id);\n return view('superadmin.permission.edit', compact('permission'));\n }\n abort(403);\n \n }", "public function index()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n\n $permissions = Permission::all()->groupBy(function($permission){\n return explode('.', $permission->name)[0]??null;\n });\n $roles = Role::all();\n //dd($permissions);\n return view('admin.permissions.index', compact('permissions', 'roles'));\n }", "public function show($id)\n {\n $lokasi = Permission::findOrFail($id);\n return Response::json($lokasi, 200);\n }", "public function index()\n {\n return view('laralum_permissions::index', ['permissions' => Permission::paginate(50)]);\n }", "public function actionView($id)\n {\n \n if (!Yii::$app->user->can(\"admin\")) {\n throw new HttpException(403, 'You are not allowed to perform this action.');\n }\n \n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index() {\n\t\t// Entrust::hasRole('role-name');\n\t\t// Entrust::can('permission-name');\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.view'))) return redirect()->route('home');\n\n\t\t$permission = $this->getRequest('Permission');\n\n\t\t// using an implementation of the Permission Repository Interface\n\t\t$permissions = $this->permissionRepository->paginate($permission);\n\n\t\t// Using the view(..) helper function\n\t\treturn view('pages.permission.index', compact('permission', 'permissions'));\n\t}", "public function show($id) {\n return redirect()->route('permissions.index');\n }", "public function actionCreate()\n {\n $model = new Permission();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->_saveRecord($model, 'permission_id');\n }\n\n return $this->render(ACTION_CREATE, [MODEL => $model, 'titleView' => 'Create']);\n }", "public function edit($id)\n {\n //\n $permissions = Permission::findOrFail($id);\n return view('admin.permission.editP', compact('permissions'));\n }", "public function show(Permission $permission)\n {\n abort_unless(Gate::allows('permission-show'), 403);\n\n return view('admin.permission.show', compact('permission'));\n }", "public function show(Permission $permission)\n {\n abort_unless(Gate::allows('permission-show'), 403);\n\n return view('admin.permission.show', compact('permission'));\n }", "public function show($id)\n\t\t{\n\t\t\t$permission = [];\n\t\t\t$model = $this->service->getById($id);\n\n\t\t\tif (!$model) {\n\t\t\t\treturn $this->responseNotFound('Not found Exception');\n\t\t\t}\n\n\t\t\treturn $this->respond([\n\t\t\t\t\t\t\t\t\t 'data' => $this->dataTransformer->transform($model, $permission),\n\t\t\t\t\t\t\t\t ]);\n\t\t}", "public function show($id)\n {\n if(Auth::check() && Auth::user()->hasPermission('permissions.show')) {\n\n if(empty($id) || ! is_numeric($id)) {\n return abort(404);\n }\n\n $permission = Permission::findOrFail($id);\n return response()->json($permission, 201);\n }\n\n return response(null, 401);\n }", "public function index()\n\t{\n\n\t\t$query = Permission::query();\n\n\t\tif(Input::has('search') && Input::has('keyword')) {\n\t\t\t$query->where(Input::get('search'), 'LIKE', '%'.Input::get('keyword').'%');\n\t\t}\n\n\t\t$permissions = $query->orderBy('name','asc')->orderBy('created_at','asc')->paginate(Config::get('constants.common.paginate'));\n\t\treturn view(\"Admin::permissionindex\", ['pagetitle'=>__('Admin::permission.permission'), 'pagedesc'=>__('Admin::base.list'), 'permissions'=> $permissions]);\n\n\t}", "public function edit(Permission $permission)\n {\n if (Gate::allows('permissions.edit')) {\n $modules=Module::all();\n return view('permissions.from', compact('modules', 'permission'));\n }else{\n return back();\n }\n }", "public function index()\n {\n $roles = Role::whereIn('id',[1,2])->get();\n $permissions = Permission::all();\n return view('backend.permissions',compact('roles','permissions'));\n }", "public function index()\n {\n $permissions = $this->permission->whereClientId(Auth::user()->client_id)->get();\n\n return view('humanresources.permissions.index', compact('permissions'));\n }", "public function show($id)\n {\n $permission = Permission::findOrFail($id);\n\n $permission = new PermissionResource($permission);\n\n return $this->sendResponse(trans('response.success_permission_show'), $permission);\n }", "public function actionView($id) {\n if (Yii::app()->user->id == $id || Yii::app()->user->checkaccess('manager'))\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n else {\n //$error=array(\"code\"=>\"403\",\"message\"=>\"Unauthorized\");\n\n throw new CHttpException(403, 'Unauthorized.');\n\n //$this->redirect(Yii::app ()->baseUrl.'/site/error', $error);\n }\n }", "public function showAction(Permission $permission)\n {\n\n $this->get('Services')->setMenuItem('Permission');\n $changes = $this->get('Services')->getLogsByEntity($permission);\n\n return $this->render('permission/show.html.twig', array(\n 'permission' => $permission,\n 'changes' => $changes,\n ));\n }", "public function show($id)\n {\n $permissions = $this->permissionsRepository->find($id);\n\n if (empty($permissions)) {\n Flash::error('Permissions not found');\n\n return redirect(route('permissions.index'));\n }\n\n return view('permissions.show')->with('permissions', $permissions);\n }", "public function actionIndex()\n {\n $request = Yii::$app->request;\n $searchModel = new PermissionFormSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'menuList' => $this -> menuList,\n ] + $request->get()\n );\n }", "public function permission()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\PermissionModel', 'permission_id');\n }" ]
[ "0.771366", "0.76149035", "0.76149035", "0.76149035", "0.7432771", "0.7334006", "0.73278373", "0.73240834", "0.72935504", "0.71484375", "0.7130245", "0.70957357", "0.70554715", "0.7048526", "0.6973128", "0.68980294", "0.68906885", "0.6873226", "0.68650776", "0.6831948", "0.67876405", "0.6777715", "0.6753872", "0.6703447", "0.6703447", "0.6702193", "0.6684792", "0.6680754", "0.66763514", "0.6666694", "0.665224", "0.6647335", "0.66396767", "0.6630831", "0.6626398", "0.66095245", "0.6608358", "0.6596407", "0.6581924", "0.6579948", "0.6579421", "0.6576362", "0.6574862", "0.65653396", "0.6553181", "0.65464365", "0.65464365", "0.65464365", "0.65464365", "0.65264636", "0.6514941", "0.6514145", "0.6510014", "0.65097487", "0.6508571", "0.65053535", "0.6495836", "0.6489638", "0.6487541", "0.64837474", "0.6480995", "0.6474137", "0.647194", "0.6469016", "0.6457219", "0.645662", "0.6454176", "0.6453567", "0.64398843", "0.64219713", "0.64079624", "0.6407633", "0.64052135", "0.64052135", "0.6404804", "0.63871753", "0.6374964", "0.6367148", "0.6366953", "0.6361281", "0.63573647", "0.635366", "0.6353327", "0.63488626", "0.63487893", "0.63487226", "0.63477117", "0.63477117", "0.63315964", "0.6330393", "0.63189065", "0.6309641", "0.6290742", "0.62902", "0.6288418", "0.62807196", "0.6280097", "0.6278519", "0.62772506", "0.6267462" ]
0.6638089
33
Handle an incoming request.
public function handle($request, Closure $next) { $user = Auth::user(); if (($user == null || $user->plan == null || $user->membership == null || !$user->membership->isValid()) && !superAdmin()) { return errorTo('You need to have an active subscription to access the page.', route('home')); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Set values for the properties to allow for testing the AssertAttributeHelper.
public function setProperties() { $this->public_prop = 'public'; $this->protected_prop = 100; $this->private_prop = true; // Set a non-predefined property. $this->dynamic = new self(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function testSetProperties() {\n\t\t$this->CurrentConditions->update(\n\t\t\t.70,\n\t\t\t.33,\n\t\t\t.34\n\t\t);\n\n\t\t$reflection = new ReflectionClass($this->CurrentConditions);\n\t\t$reflectionTemperature = $reflection->getProperty('temperature');\n\t\t$reflectionTemperature->setAccessible(TRUE);\n\t\t$reflectionHumidity = $reflection->getProperty('humidity');\n\t\t$reflectionHumidity->setAccessible(TRUE);\n\n\t\t$this->assertSame(\n\t\t\t$reflectionTemperature->getValue($this->CurrentConditions),\n\t\t\t.70\n\t\t);\n\t\t$this->assertSame(\n\t\t\t$reflectionHumidity->getValue($this->CurrentConditions),\n\t\t\t.33\n\t\t);\n\t}", "public function setAttributes();", "public function testSetAllUserAttributes()\n {\n }", "public function setUp()\n {\n $this->faker = Factory::create();\n\n $reader = new PhpDocReader();\n\n foreach (array_keys(get_object_vars($this)) as $propertyName) {\n if (self::MOCK_SUFFIX !== substr($propertyName, -strlen(self::MOCK_SUFFIX))) {\n continue;\n }\n\n $property = new \\ReflectionProperty(static::class, $propertyName);\n $propertyClass = $reader->getPropertyClass($property);\n\n $this->$propertyName = $this->prophesize($propertyClass);\n }\n }", "public function testSetUserAttributes()\n {\n }", "public function testProperties(): void\n {\n $this->assertSame('FOOX', $this->validator->getAssertCode('X'));\n $this->assertSame(['a:foo', 'a:bar'], $this->validator->getPath());\n }", "public function testGetAndSetMethods()\n {\n $attribs = ['class' => 'gravatar', 'title' => 'avatar', 'id' => 'gravatar-1'];\n $this->_object->setDefaultImg('monsterid')\n ->setImgSize(150)\n ->setSecure(true)\n ->setEmail(\"[email protected]\")\n ->setAttribs($attribs)\n ->setRating('pg');\n $this->assertEquals(\"monsterid\", $this->_object->getDefaultImg());\n $this->assertEquals(\"pg\", $this->_object->getRating());\n $this->assertEquals(\"[email protected]\", $this->_object->getEmail());\n $this->assertEquals($attribs, $this->_object->getAttribs());\n $this->assertEquals(150, $this->_object->getImgSize());\n $this->assertTrue($this->_object->getSecure());\n }", "public function setProperties($properties)\n {\n\n }", "public function setAttributes($values)\n {\n if (is_array($values)) {\n foreach ($values as $name => $value) {\n $setter = 'set' . ucfirst($name);\n if (method_exists($this, $setter)) {\n // set property\n $this->$setter($value);\n }\n }\n }\n }", "public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testProperties(): void\n {\n $body = new RequestBodyObject();\n\n $url = new UrlObject();\n $formParameter = new FormParameterObject();\n $file = new FileObject();\n\n $body->setDisabled(false);\n $body->setMode('file');\n $body->setRaw('test-raw');\n $body->setUrl($url);\n $body->setFormParameter($formParameter);\n $body->setFile($file);\n\n $this->assertProperties($body, [\n 'isDisabled' => false,\n 'getMode' => 'file',\n 'getRaw' => 'test-raw',\n 'getUrl' => $url,\n 'getFormParameter' => $formParameter,\n 'getFile' => $file\n ]);\n }", "protected function setUp() {\n\n\t\t$class_name = __NAMESPACE__.\"\\\\\".$this->property_class_name;\n\t\t$this->property_options[\"default_value\"] = $this->default_value;\n\n\t\t$this->config = new ConfigTestMock(\"test\");\n\t\t$this->object = new $class_name( $this->config, $this->property_name, $this->property_options );\n\t}", "public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }", "protected function setUp()\n {\n parent::setUp();\n $this->typeFactory = $this->getMock(AttributeTypeFactory::class, [], [], '', false);\n $this->entityFactory = $this->getMock(EntityInterfaceFactory::class, [], [], '', false);\n $this->saveAttributesConfig = $this->getMock(SaveAttributes::class, [], [], '', false);\n $this->formConfig = $this->getMock(FormConfig::class, [], [], '', false);\n $this->restrictionConfig = $this->getMock(RestrictionConfig::class, [], [], '', false);\n $this->escaper = new Escaper();\n $this->attribute = new Attribute(\n $this->saveAttributesConfig,\n $this->formConfig,\n $this->escaper,\n $this->typeFactory,\n []\n );\n }", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "protected function setUp()\n {\n $this->object = new Properties();\n }", "public function testGetChangeAttributes()\n {\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }", "public static function setters();", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->value = random_int(1, 100000);\n\n $randomValue = md5((string)$this->value);\n\n $this->value1 = $randomValue . '_1';\n $this->value2 = $randomValue . '_2';\n $this->value3 = $randomValue . '_3';\n }", "public function setProperties($properties)\r\n {\r\n if (!empty($properties)) {\r\n foreach ($properties as $key => $val) {\r\n $this->$key = $val;\r\n }\r\n }\r\n }", "public function setAttributes($attributes){ }", "public static function setAttributes()\n {\n\n self::$urls = config('user.client.urls');\n\n self::$search = config('user.client.search');\n\n self::$orderBy = config('user.client.order');\n\n self::$groups = config('user.client.groups');\n\n self::$list = config('user.client.list');\n\n self::$fields = config('user.client.form');\n\n return new static();\n }", "private function api_set_properties( $properties ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// identify user first\n\t\t$this->set_named_identity( null );\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t// record the properties\n\t\t$this->get_api()->set( $properties );\n\t}", "public function setAttributes($values)\n {\n if (!empty($values)) {\n foreach ($values as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->entity = factory(Entity::class)->create();\n $set = factory(AttributeSet::class)->create([\n \t'entity_id' => $this->entity->entity_id,\n ]);\n\n $this->entity->default_attribute_set_id = $set->attribute_set_id; \n $this->entity->save();\n }", "private function setDefaults()\n {\n $defaults = config('sevDeskApi.defaults.'.lcfirst($this->objectName));\n\n foreach($defaults as $attribute => $defaultValue)\n {\n if (!isset($this->$attribute))\n $this->$attribute = $defaultValue;\n }\n }", "public function setAttributes(Collection $properties);", "public function testGettersSetters()\n {\n $this->assertEquals('my category', $this->question->getCategory());\n $this->assertEquals('my question', $this->question->getQuestion());\n\n $this->assertEquals($this->answers, $this->question->getAnswers());\n\n $this->assertEquals(\n ['my first answer', 'my second answer', 'my third answer', 'my fourth answer'],\n $this->question->getAnswersLabels(),\n 'Question should return all available answers labels'\n );\n $this->assertEquals(\n ['my first answer', 'my second answer'],\n $this->question->getCorrectAnswersValues(),\n 'Question should return all correct answers values'\n );\n }", "protected function setUp(): void {\n $this->parser = new PropertyParser();\n }", "public function setProperties(array $properties);", "protected function setUp()\n {\n $this->object1 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('Group1', 'Role1', true);\n $this->object2 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('Group2', 'Role2', false);\n $this->object3 = new \\Yana\\Security\\Data\\SecurityRules\\Rule('', '', false);\n }", "public function setAttributes($item,$attributes) {\n\t\t$this->_properties[$item]['Attributes'] = ' '.$attributes;\n\t}", "function assignProperties() {\n\t\t$hash = $this->__action;\n\t\tforeach ($hash as $key => $value) {\n\t\t\tif (!isset($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (preg_match('/^_.*/i', $key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->assignProperty($key, $value);\n\t\t}\n\t}", "abstract protected function properties();", "public function setAttrs($attrs);", "public function set_properties( $args ) {\n\n\t\t// Reset default property values\n\t\t$reset = array(\n\t\t\t'debug_mode' => false,\n\t\t\t'parant_plugin_slug' => '',\n\t\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/wordpress-plugins.php',\n\t\t);\n\n\t\t// Define properties\n\t\tforeach ( $reset as $name => $default ) {\n\n\t\t\tif ( array_key_exists( $name, $args ) ) {\n\t\t\t\t// If set, use defined values\n\t\t\t\t$this->{$name} = $args[$name];\n\t\t\t} else {\n\t\t\t\t// If not set, use default values\n\t\t\t\t$this->{$name} = $default;\n\t\t\t}\n\n\t\t}\n\n\t}", "public function test_class_attributes() {\n $this->assertclassHasAttribute('context', 'WP_Local_Stream_Wrapper_Base');\n $this->assertclassHasAttribute('handle', 'WP_Local_Stream_Wrapper_Base');\n $this->assertclassHasAttribute('uri', 'WP_Local_Stream_Wrapper_Base');\n }", "public function canHaveACopyOfProperties()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $properties = array('content', 'objIds', 'names', 'classes');\n foreach ($properties as $property) {\n $this->object->iterateOn($property);\n $expect = $this->object->getArrayCopy();\n $this->assertAttributeEquals($expect, $property, $this->object);\n }\n }", "protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }", "public function setProperties(array $data)\n {\n $this->properties = $data;\n }", "public function before()\n {\n if ($this->_config === null) {\n return;\n }\n foreach ($this->_config as $property => $value) {\n if (property_exists($this, $property)) {\n $this->{$property} = $value;\n }\n }\n }", "public function set_props($args)\n {\n }", "public function setProperties( ArrayObject $params )\n {\n foreach ( $this->attributeTypes as $attr => $type )\n {\n // 1: fijarse si esta en params\n // 2: verificar si el valor que tiene en params es del mismo tipo que el atributo\n // - Si el tipo es numerico, y el valor es string, ver que sea un string numerico. http://www.php.net/is_numeric (ojo con numeros negativos o si empiezan con \".\" o \",\", probar!!!)\n // - Si el tipo es date o time, y el tipo es un string, ver que el string tiene forma de date o time.\n // - Distinguir entre valor cero y valor null.\n\n // TODO: Ver como se podrian tambien setear listas de \"objetos simples\" (no es la idea que esto setee atributos que son PO, solo atributos simples)\n if (isset($params[$attr]) && !$this->isInyectedAttribute($attr)) // IMPORTANTE: id, class, deleted no se pueden setear por set properties!!!\n {\n // Esto es set$attr pero mas rapido!\n // TODO: Chekeos de tipos...\n // WARNING: Esto solo setea atributos simples! Hay que ver si puedo hacer el tema de setear atributos de clases asociadas... (depende de la notacion de las keys de params)\n // SI HAGO TODO EL CHEKEO EN setAttributeValue, solo llamo a esa y listo...\n \n $this->attributeValues[$attr] = (is_string($params[$attr]) ? trim($params[$attr]) : $params[$attr]);\n \n // Si attr el un id de un hasOne, y viene un string vacio, me tira un error en DatabaseXXX\n // al intentar poner un '' en un campo INT id, pero NULL le puedo poner. Asi que si viene\n // un valor vacio, le pongo NULL.\n if ($this->attributeValues[$attr] === '') $this->attributeValues[$attr] = NULL;\n \n \n // FIXME: deberia garantizar que solo vienen valores simples en params.\n \n // Marco como dirty en atributos simples (asignar en cada loop del for es mas barato\n // que estar chequeando si se modifico un campo y setear afuera del loop).\n $this->dirty = true;\n }\n }\n }", "public function assetsInlineConstructCssAttributesSet(UnitTester $I)\n {\n $I->wantToTest('Assets\\Asset - __construct() - css attributes set');\n\n $content = 'p {color: #000099}';\n $attributes = [\n 'data' => 'phalcon',\n ];\n\n $asset = new Inline(\n 'css',\n $content,\n true,\n $attributes\n );\n\n $actual = $asset->getAttributes();\n $I->assertSame($attributes, $actual);\n }", "private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }", "public function setAttributes($attributes);", "public function setUp()\n {\n $this->config = array(\n 's1' => 'string',\n 's2' => 'str',\n 'i1' => 'integer',\n 'i2' => 'int',\n 'i3' => '+integer',\n 'i4' => '+int',\n 'i5' => '-integer',\n 'i6' => '-int',\n 'f1' => 'float',\n 'f2' => '+float',\n 'f3' => '-float',\n 'b' => 'boolean',\n 'a' => 'array',\n 'm' => array(true, 'false'),\n 'r' => '/^member/',\n );\n $this->helper = new ConfigValidator($this->config);\n }", "public function setAttributes($values, $safeOnly = true){\n $params = $this->limpiarParametrosConEspacios($values);\n parent::setAttributes($params, $safeOnly);\n $this->barrio = strtolower($this->barrio);\n $this->calle = strtolower($this->calle);\n }", "public function testGettersAndSetters()\n {\n $this->phone->setType('phone');\n $this->assertEquals('phone', $this->phone->getType());\n\n $this->phone->setValue('059 70 22 85');\n $this->assertEquals('059 70 22 85', $this->phone->getValue());\n }", "public function testSetValues()\n {\n $this->todo('stub');\n }", "protected function setUp() {\r\n parent::setUp();\r\n $this->hydrator = $this->getMockBuilder('Property\\Mapper\\Hydrator\\PropertyValueHydrator')\r\n ->disableOriginalConstructor()\r\n ->getMock();\r\n $this->mapper = new PropertyValueMapper();\r\n $this->mapper->setEntityPrototype(new PropertyValue())\r\n ->setDbAdapter($this->getAdapter())\r\n ->setHydrator($this->hydrator);\r\n $this->loadPropertyValueTable();\r\n }", "public function testSetters()\n {\n $Email = new \\EmailTemplate('test');\n \n // assert data and files and folders exist\n $this->assertEquals('test', $Email->getViewFile());\n $this->assertEquals('_default', $Email->getDecorations());\n \n $this->assertTrue(is_dir(EMAIL_VIEW_DIR . '/_core'));\n $this->assertTrue(file_exists(EMAIL_VIEW_DIR . '/_core/header.php'));\n $this->assertTrue(file_exists(EMAIL_VIEW_DIR . '/_core/footer.php'));\n \n $this->assertTrue(is_dir(EMAIL_DECORATIONS_DIR . '/' . $Email->getDecorations()));\n $this->assertTrue(file_exists(EMAIL_DECORATIONS_DIR . '/' . $Email->getDecorations() . '/header.php'));\n $this->assertTrue(file_exists(EMAIL_DECORATIONS_DIR . '/' . $Email->getDecorations() . '/footer.php'));\n \n $Email->setViewFile('testx');\n $Email->setDecorations('testy');\n \n // assert new data is correct\n $this->assertEquals('testx', $Email->getViewFile());\n $this->assertEquals('testy', $Email->getDecorations());\n }", "public function testGetAllProperties() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab data from MySQL and check expectations\n\t\t$results = Property::getAllProperties($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"GoGitters\\\\ApciMap\\\\Property\", $results);\n\n\t\t//grab the property from the array and validate it\n\t\t$pdoProperty = $results[0];\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}", "public function testProperty()\n {\n $testClass1 = new TestingClass();\n $testClass2 = new TestingClass2();\n\n $model = new ModelInstance();\n\n $model->arrayPropTest = 'test';\n self::assertInternalType('array', $model->arrayPropTest);\n self::assertCount(1, $model->arrayPropTest);\n self::assertEquals(array('test'), $model->arrayPropTest);\n\n $model->arrayPropTest = 'test|test2';\n self::assertInternalType('array', $model->arrayPropTest);\n self::assertCount(2, $model->arrayPropTest);\n self::assertEquals(array('test', 'test2'), $model->arrayPropTest);\n\n $model->arrayPropTest = $testClass1;\n self::assertInternalType('array', $model->arrayPropTest);\n self::assertCount(1, $model->arrayPropTest);\n self::assertInstanceOf('\\TestingClasses\\TestingClass', $model->arrayPropTest[0]);\n\n $model->arrayPropTest = array($testClass1, $testClass2);\n self::assertInternalType('array', $model->arrayPropTest);\n self::assertCount(2, $model->arrayPropTest);\n self::assertInstanceOf('\\TestingClasses\\TestingClass', $model->arrayPropTest[0]);\n self::assertInstanceOf('\\TestingClasses\\TestingClass2', $model->arrayPropTest[1]);\n }", "public function set_up(): void {\n\t\tparent::set_up();\n\n\t\t$this->story_model = $this->createMock( Story::class );\n\t\t$this->story_model->load_from_post( self::$story_id );\n\n\t\t$this->story_query = $this->createMock( Story_Query::class );\n\t\t$this->story_query->method( 'get_story_attributes' )->willReturn(\n\t\t\t[\n\t\t\t\t'view_type' => 'grid',\n\t\t\t\t'show_title' => true,\n\t\t\t\t'show_excerpt' => false,\n\t\t\t\t'show_author' => false,\n\t\t\t\t'show_date' => false,\n\t\t\t\t'number_of_columns' => 3,\n\t\t\t]\n\t\t);\n\t}", "public function testGetClassProperties() {\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this)\n\t\t);\n\t\t$expected = ['test', 'test2'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this, ['public' => false])\n\t\t);\n\t\t$expected = ['test', 'test2', '_test'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::properties($this);\n\t\t$expected = [\n\t\t\t[\n\t\t\t\t'modifiers' => ['public'],\n\t\t\t\t'value' => 'foo',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'modifiers' => ['public', 'static'],\n\t\t\t\t'value' => 'bar',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test2'\n\t\t\t]\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$controller = new Controller(['init' => false]);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller)\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertFalse(in_array('_render', $result));\n\t\t$this->assertFalse(in_array('_classes', $result));\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller, ['public' => false])\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertTrue(in_array('_render', $result));\n\t\t$this->assertTrue(in_array('_classes', $result));\n\n\t\t$this->assertNull(Inspector::properties('\\lithium\\core\\Foo'));\n\t}", "public static function setProperties(array $config)\r\n {\r\n foreach ($config as $k => $v) {\r\n $property = '_' . $k;\r\n self::$$property = $v;\r\n }\r\n }", "protected function buildPropertyDefaults() {\n }", "public function set_attributes($attributes)\n {\n }", "protected function set_up()\n {\n parent::set_up();\n $spec = new Spec();\n $this->cssRulesets = $spec->cssRulesets();\n }", "function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }", "public function testModuleAndRouteAccessors()\n {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo',\n 'action' => 'index',\n 'controller' => 'index'\n ));\n \n $props = array('Module', 'Route');\n $valids = array('index', 'help', 'home', 'default', '1', ' ', null);\n $invalids = array(42, (object) null);\n \n foreach ($props as $prop) {\n $setter = \"set$prop\";\n $getter = \"get$prop\";\n \n foreach ($valids as $valid) {\n $page->$setter($valid);\n $this->assertEquals($valid, $page->$getter());\n }\n \n foreach ($invalids as $invalid) {\n try {\n $page->$setter($invalid);\n $msg = \"'$invalid' is invalid for $setter(), but no \";\n $msg .= 'InvalidArgumentException was thrown';\n $this->fail($msg);\n } catch (InvalidArgumentException $e) {\n \n }\n }\n }\n }", "public function testInitialize()\n {\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'parents', $this->fixture);\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'constants', $this->fixture);\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'methods', $this->fixture);\n }", "public function allowProperties() {}", "public function setTestValues()\r\n {\r\n $fname = array(\"Jesper\", \"Nicolai\", \"Alex\", \"Stefan\", \"Helmut\", \"Elvis\");\r\n $lname = array(\"Gødvad\", \"Lundgaard\", \"Killing\", \"Meyer\", \"Schottmüller\", \"Presly\");\r\n $city = array(\"Copenhagen\", \"Århus\", \"Collonge\", \"Bremen\", \"SecretPlace\" );\r\n $country = array(\"Denmark\", \"Germany\", \"France\", \"Ümlaudia\", \"Graceland\");\r\n $road = array(\" Straße\", \" Road\", \"vej\", \" Boulevard\");\r\n \r\n $this->number = rand(1000,1010);\r\n $this->name = $fname[rand(0,5)] . \" \" . $lname[rand(0,5)];\r\n $this->email = \"[email protected]\";\r\n $this->address= \"Ilias\" . $road[rand(0,3)] .\" \" . rand(1,100);\r\n $this->postalcode = rand(2000,7000);\r\n $this->city = $city[rand(0,3)];\r\n $this->country = $country[rand(0,4)];\r\n $this->phone = \"+\" . rand(1,45) . \" \" . rand(100,999) . \" \" . rand(1000, 9999);\r\n $this->ean = 0;\r\n $this->website = ilERPDebtor::website; \r\n }", "protected function assignImageProperties($properties) {\n foreach ( $properties as $property => $value ) {\n if (! isset($this->$property) || is_null($this->$property)) {\n $this->$property = $value;\n }\n }\n }", "public function setProperties(array $properties) \n\t{\n\t\tforeach ($properties as $name => $value) {\n\t\t\t$this->set($name, $value);\n\t\t}\n\t}", "public function setElementProperties() {\r\n $properties = null;\r\n $propertyData = $this->getProperty('propdata',null);\r\n if ($propertyData != null && is_string($propertyData)) {\r\n $propertyData = $this->modx->fromJSON($propertyData);\r\n }\r\n if (is_array($propertyData)) {\r\n $this->object->setProperties($propertyData);\r\n }\r\n return $propertyData;\r\n }", "public function testSettersGetters() {\r\n\t\t$expected = \"Random string value\";\r\n\t\t\r\n\t\t$appender = new LoggerAppenderSyslog();\r\n\t\t$appender->setIdent($expected);\r\n\t\t$appender->setFacility($expected);\r\n\t\t$appender->setOverridePriority($expected);\r\n\t\t$appender->setPriority($expected);\r\n\t\t$appender->setOption($expected);\r\n\t\t\r\n\t\t$actuals = array(\r\n\t\t\t$appender->getIdent(),\r\n\t\t\t$appender->getFacility(),\r\n\t\t\t$appender->getOverridePriority(),\r\n\t\t\t$appender->getPriority(),\r\n\t\t\t$appender->getOption()\r\n\t\t);\r\n\t\t\r\n\t\tforeach($actuals as $actual) {\r\n\t\t\t$this->assertSame($expected, $actual);\r\n\t\t}\r\n\t}", "private function init_properties( array $properties ) {\n\t\t// recursively filter null values\n\t\t$this->properties = Arrays::filter_recursive( $properties );\n\t\t// collect all attributes properties for this element\n\t\t$this->collect_attributes();\n\t}", "protected function setUp()\n\t{\n\t\t$this->object = new object('obj att');\n\n\t\t$this->sibling = new sibling('sibling att');\n\t\t$this->sibling2 = new sibling('sibling att2');\n\n\t\t$this->child = new child('child att');\n\t\t$this->child2 = new child('child att2');\n\n\t\t$this->parent_ = new parent_('parent_ att');\n\t}", "public function setUp()\n {\n $this->queue = new Attribute\\Queue;\n\n $this->attribute = $this->getMockBuilder( 'Reform\\Attribute\\Attribute' )\n ->setConstructorArgs( array( 'attribute_name', 'attribute_value' ) )\n ->getMock();\n }", "public function test_mock_properties()\n {\n $properties = $this->getIdentityProviderMockProperties();\n $this->assertCount(count($this->getOrmEntityIdentityProviderValues()), $properties);\n }", "protected function initialize()\n {\n // load the driver\n static::getDriver();\n\n // add in the default ID property\n if (static::$ids == [self::DEFAULT_ID_PROPERTY] && !isset(static::$properties[self::DEFAULT_ID_PROPERTY])) {\n static::$properties[self::DEFAULT_ID_PROPERTY] = self::$defaultIDProperty;\n }\n\n // generates created_at and updated_at timestamps\n if (property_exists($this, 'autoTimestamps')) {\n $this->installAutoTimestamps();\n }\n\n // fill in each property by extending the property\n // definition base\n foreach (static::$properties as &$property) {\n $property = array_replace(self::$propertyDefinitionBase, $property);\n }\n\n // order the properties array by name for consistency\n // since it is constructed in a random order\n ksort(static::$properties);\n }", "public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }", "abstract protected function propertySet($name, $value);", "private function _getSettings()\n {\n $properties = $this->_class->getProperties();\n foreach ($properties as $property) {\n $prop = new Property($property);\n $prop->fillSettings($this->_reflect);\n }\n if (empty($this->_reflect->listField)) {\n $keys = array_keys($this->_reflect->fields);\n $this->_reflect->listField = array_shift($keys);\n }\n $this->_reflect->fieldNames = array_keys($this->_reflect->fields);\n }", "public function setUp()\n {\n $this->amount = 500;\n $this->currency = 'RUB';\n $this->sector = 222;\n $this->password = 'qwprc1';\n $this->id = 400;\n\n parent::setUp();\n }", "public function testSet()\n {\n $stub = new Fluency();\n $stub->fooString('bar');\n $stub->fooArray(['bar']);\n\n $this->assertSame('bar', $stub->fooString, 'Calling property() with a string as the second argument should set the string value as a named property based on the first argument.');\n $this->assertSame(['bar'], $stub->fooArray, 'Calling property() with an array as the second argument should set the array value as a named property based on the first argument.');\n }", "function setProperties($properties) {\n\t\t$properties = ( array ) $properties; //cast to an array\n\n\t\tif (is_array ( $properties )) {\n\t\t\tforeach ( $properties as $k => $v ) {\n\t\t\t\t$this->$k = $v;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function createObjectCanDoSetterInjectionWithStraightValues() {\n\t\t$time = microtime();\n\t\t$someConfigurationProperty = new \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty('someProperty', $time, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_STRAIGHTVALUE);\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass');\n\t\t$objectConfiguration->setProperty($someConfigurationProperty);\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass', $objectConfiguration);\n\t\t$this->assertEquals($time, $object->getSomeProperty(), 'The straight value has not been setter-injected although it should have been.');\n\t}", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "public function testInitialize()\n {\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'properties', $this->fixture);\n $this->assertAttributeInstanceOf('phpDocumentor\\Descriptor\\Collection', 'methods', $this->fixture);\n }", "public function assertSaveDefaults() {\n\t\t\t$this->set('emailSectionID', NULL, false);\n\t\t\t$this->set('dateAdded', 'NOW()', false);\n\t\t\t$this->enclose('dateAdded', false);\n\t\t\t$this->set('lastModified', 'NOW()', false);\n\t\t\t$this->enclose('lastModified', false);\n\t\t}", "public function checkProperties($conditions);", "abstract protected function setRequiredGetters();", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "public function setAttributes($data = []) {\n if (empty($data)) {\n //init\n $data = array_fill_keys(array_keys(static::attributLabels()), null);\n }\n if (is_array($data)) {\n $this->attributes = self::$wpdb->_escape($data);\n } else {\n parse_str($data, $this->attributes);\n }\n foreach ($this->attributes as $name => $value)\n if (property_exists($this, $name)) {\n $this->$name = $this->attributes[$name] = stripslashes_deep($value);\n } else {\n unset($this->attributes[$name]);\n }\n }", "protected function resetProperties() {}", "public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\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// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testRequestSetsProperties(): void\n {\n $this->post('/posts/index');\n $this->assertInstanceOf('Cake\\Controller\\Controller', $this->_controller);\n $this->assertNotEmpty($this->_viewName, 'View name not set');\n $this->assertStringContainsString('templates' . DS . 'Posts' . DS . 'index.php', $this->_viewName);\n $this->assertNotEmpty($this->_layoutName, 'Layout name not set');\n $this->assertStringContainsString('templates' . DS . 'layout' . DS . 'default.php', $this->_layoutName);\n\n $this->assertTemplate('index');\n $this->assertLayout('default');\n $this->assertSame('value', $this->viewVariable('test'));\n }", "public function setProperties(array $properties): void\n {\n $this->properties = $properties;\n }", "public function setUp()\n {\n // Start of user code AttributeMappingTest.setUp\n // Place additional setUp code here. \n // End of user code\n }" ]
[ "0.65301096", "0.6334555", "0.60540706", "0.6031574", "0.596571", "0.5933673", "0.59311944", "0.58942866", "0.58838814", "0.5764461", "0.574667", "0.57403624", "0.57213587", "0.5668403", "0.5637653", "0.5619263", "0.5611231", "0.557623", "0.55737114", "0.5559365", "0.555712", "0.5551678", "0.5543293", "0.5537791", "0.5429709", "0.54233456", "0.54161894", "0.5406566", "0.53997153", "0.5381827", "0.53707355", "0.53580976", "0.5348819", "0.5339432", "0.5336454", "0.53248143", "0.5306321", "0.5305419", "0.5296804", "0.52908105", "0.52809614", "0.5270671", "0.526784", "0.5263699", "0.5262751", "0.5259406", "0.52543706", "0.525415", "0.52494097", "0.5243583", "0.5243111", "0.52326196", "0.5226739", "0.5225155", "0.52157164", "0.5210997", "0.52049536", "0.51821506", "0.5171863", "0.51636755", "0.51557213", "0.51494306", "0.51444274", "0.5144304", "0.5141531", "0.51283914", "0.51211375", "0.5120041", "0.5114451", "0.5112126", "0.5109809", "0.5098326", "0.50943714", "0.5094279", "0.5089713", "0.5088805", "0.50849324", "0.50826395", "0.5082173", "0.50802743", "0.50771075", "0.50756574", "0.5069683", "0.5063139", "0.5062201", "0.506012", "0.5059972", "0.5053982", "0.505379", "0.5051311", "0.5051216", "0.50480765", "0.504363", "0.5042155", "0.503989", "0.5039197", "0.50353783", "0.5030183", "0.50237054", "0.5023131" ]
0.6174903
2
This method is called before each test.
protected function setUp(): void { parent::setUp(); $this->postScriptumServer = new PostScriptumServer(new ServerConnectionInfo('', 0, ''), new TestingCommandRunner()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "public function preTesting() {}", "protected function setUp() { }", "protected function setUp() { }", "public function before() {}", "public function before() {}", "public function preTest() {}", "protected function setUp ()\n {}", "protected function setUp() {\r\n }", "protected function setUp() {\r\n }", "protected function setUp()\n {\n }", "protected function setUp()\n {\n \n }", "protected function setUp()\n {\n \n }" ]
[ "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559584", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559387", "0.8559124", "0.8559124", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.85589415", "0.8429377", "0.84168035", "0.84168035", "0.8307315", "0.8307315", "0.82946193", "0.82797176", "0.8250555", "0.8250555", "0.8234086", "0.8224487", "0.8224487" ]
0.0
-1
Verifies the currentMap can properly be retrieved.
public function test_current_map() { $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasMaps(){\n return $this->_has(15);\n }", "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "protected function hasMappingErrorOccurred() {}", "public function canNotAccessInternalContentObjectMapByReference() {}", "public function hasLastmapid(){\n return $this->_has(28);\n }", "public function hasLastrealmapid(){\n return $this->_has(33);\n }", "public function hasMapid(){\n return $this->_has(4);\n }", "public function valid()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return isset($mapKeys[$this->iteratorPosition]);\n }", "public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }", "public function isMap()\r\n {\r\n return $this->isMap;\r\n }", "protected static function _ensureCMapInstance(&$cmap) {}", "public static function isInitialized() {\n\t\treturn isset(self::$cachedMap);\n\t}", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }", "private function is_map_center_valid() {\n\t\t\tif ( isset( $this->map_center_valid ) ) {\n\t\t\t\treturn $this->map_center_valid;\n\t\t\t}\n\n\t\t\t$this->active_radius = ( $this->slplus->SmartOptions->distance_unit->value === 'miles' ) ? SLPlus::earth_radius_mi : SLPlus::earth_radius_km;\n\t\t\t$this->map_center_valid = $this->is_valid_lat( $this->slplus->SmartOptions->map_center_lat->value ) && $this->is_valid_lng( $this->slplus->SmartOptions->map_center_lng->value );\n\n\t\t\treturn $this->map_center_valid;\n\t\t}", "public function hasUserMapList()\n {\n return $this->user_map !== null;\n }", "public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }", "public function hasMapping();", "public function valid() { \n\t\t$page = &$this->touchPage();\n\t\treturn (key($page) !== null);\n\t}", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function valid()\n {\n return $this->offsetExists($this->key());\n }", "protected function load()\n {\n // Can we read the intended path?\n if (is_readable($this->mapPath)) {\n // Get the map\n $this->map = unserialize(file_get_contents($this->mapPath));\n\n // Get the version and remove it from the map\n $this->version = $this->map['version'];\n unset($this->map['version']);\n\n return true;\n }\n\n return false;\n }", "public function valid()\n {\n return $this->isCurrentKeyValid();\n }", "private function _checkMap()\n {\n foreach($this->_map as $alias => $field)\n {\n if(!is_array($field))\n {\n $this->_map[$alias] = array(\n self::MAP_FIELD => $field\n );\n }\n if(isset($field[self::MAP_TYPE]) && in_array($field[self::MAP_TYPE],\n self::$_relationTypes))\n {\n switch($field[self::MAP_TYPE])\n {\n case self::RELATION_PARENT:\n if(empty($field[self::MAP_KEY]) || empty($field[self::MAP_FOREIGN_KEY]))\n {\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n }\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $mapper->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $alias . ucfirst($mapper->getKeyField());\n }\n break;\n\n case self::RELATION_CHILD:\n case self::RELATION_CHILDREN:\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n /** @var Core_Entity_Mapper_Abstract */\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n $backRelation = $mapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n if(!isset($field[self::MAP_SAVE]))\n {\n $field[self::MAP_SAVE] = true;\n }\n if(!isset($field[self::MAP_DELETE]))\n {\n $field[self::MAP_DELETE] = true;\n }\n break;\n\n case self::RELATION_M2M:\n /** @var Core_Entity_Mapper_Abstract */\n $targetMapper = $field[self::MAP_MAPPER];\n $targetMapper = new $targetMapper();\n\n /** @var Core_Entity_Mapper_Abstract */\n $middleMapper = $field[self::MAP_MIDDLE_MAPPER];\n $middleMapper = new $middleMapper();\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $backRelation = $middleMapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation == null)\n {\n throw new Core_Entity_Exception('Middle Mapper Not configured for m2m relation \"' . get_class($this) . '->' . get_class($middleMapper) . '\"');\n }\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n $field[self::MAP_SAVE] = false;\n $field[self::MAP_DELETE] = false;\n break;\n\n default:\n $log = Core_Log_Manager::getInstance()->getLog('default');\n if(!empty($log))\n {\n $log->log(\"[\" . get_class($this) . \"]\\t\" . 'Unknown relation type \"' . $field[self::MAP_TYPE] . '\"',\n Zend_Log::NOTICE);\n }\n throw new Core_Entity_Exception('Unknown relation type \"' . $field[self::MAP_TYPE] . '\"');\n break;\n }\n $this->_map[$alias] = $field;\n }\n }\n }", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function valid()\n {\n return (\n !is_null($this->current) &&\n $this->dataStore->has($this->current[$this->dataStore->getIdentifier()])\n );\n }", "public function hasMapTypeControl()\n {\n return $this->mapTypeControl !== null;\n }", "public function valid() {\n return isset($this->iteratorKeys[$this->iteratorPosition]);\n }", "public function equals(Map $map): bool;", "public function testIfReturnsMapBag()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertInstanceOf('\\SyncFS\\Map\\MapBag', $result);\n }", "public function isValid() : bool {\n if($valid = parent::isValid()){\n // check if source/target system are not equal\n // check if source/target belong to same map\n if(\n is_object($this->source) &&\n is_object($this->target) &&\n $this->get('source', true) === $this->get('target', true) ||\n $this->source->get('mapId', true) !== $this->target->get('mapId', true)\n ){\n $valid = false;\n }\n }\n\n return $valid;\n }", "public function fill()\n {\n // Load the serialized map.\n // If there is none or it isn't current we will generate it anew.\n if (!$this->load()) {\n $this->generate();\n }\n\n // Still here? Sounds good\n return true;\n }", "public function valid()\n {\n $key = key($this->container);\n\n return ($key !== null && $key !== false);\n }", "public function valid() {\n return isset($this->keys[$this->index]);\n }", "public function isInSiteMap() : bool {\n return $this->incInSiteMap;\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function testRequireableStructure()\n {\n $instance = $this->getInstance();\n $this->assertPrivateMethod('getRequireableConfigurationMapping');\n $method = $this->getClassMethod('getRequireableConfigurationMapping', true);\n\n $result = $method->invoke($instance);\n\n $this->assertEquals(\n array_intersect_key(\n $this->getMapping(),\n ['requiredState' => true]\n ),\n $result\n );\n }", "public function valid()\n {\n return $this->key() !== null;\n }", "public function valid() {\n\t\tif (isset($this->allSets[$this->key()])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function get_current_maps () {\r\n\t\tglobal $wp_query;\r\n\t\t$table = $this->get_table_name();\r\n\t\t$posts = $wp_query->get_posts();\r\n\t\t$where_string = $this->prepare_query_string($posts);\r\n\t\tif (!$where_string) return false;\r\n\t\t$maps = $this->wpdb->get_results(\"SELECT * FROM {$table} {$where_string}\", ARRAY_A);\r\n\t\tif (is_array($maps)) foreach ($maps as $k=>$v) {\r\n\t\t\t$maps[$k] = $this->prepare_map($v);\r\n\t\t}\r\n\t\treturn $maps;\r\n\t}", "public function valid() {\n\t\t\treturn isset( $this->stat_refs[ $this->position ] );\n\t\t}", "protected function getMap()\n {\n if (! $this->map) {\n $this->load();\n }\n\n return $this->map;\n }", "public function valid()\n {\n return array_key_exists($this->key(), $this->iterator_data);\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return !!current($this->properties);\n }", "public function valid()\n {\n return !is_null($this->key());\n }", "function valid() {\n if (isset($this->keys[$this->position])) {\n return $this->__isset($this->keys[$this->position]);\n }\n return false;\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "private function testMappingPossible($mcToGeMapping)\n {\n $geIds = array(); // Grid element layout IDs\n foreach ($mcToGeMapping as $id) {\n if (!empty($id)) {\n $geIds[] = (string) $id;\n } else {\n $geIds[] = 1;\n }\n }\n $ids = array_unique($geIds, SORT_NUMERIC);\n\n $select_fields = 'uid, hidden';\n $where = 'uid IN(' . implode(',', $ids) . ') AND deleted = 0';\n $orderBy = '';\n $table = 'tx_gridelements_backend_layout';\n\n $availability = array();\n $resource = $this->execSelect($select_fields, $where, $orderBy, $table);\n if ($resource === false) {\n return $availability;\n }\n\n foreach ($ids as $id) {\n $availability[$id] = 'unavailable';\n }\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $hidden = (int) $row['hidden'];\n $availability[$row['uid']] = $hidden ? 'hidden' : 'visible';\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n return $availability;\n }", "public static function getMap()\n {\n return self::$map;\n }", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "public function valid()\n {\n return !is_null(key($this->requests));\n }", "public function valid()\n {\n $key = key($this->_object);\n return ($key !== null && $key !== false);\n }", "public function getMap() : Map {\n // return the private property as-is\n return $this->map;\n }", "public function valid()\n {\n return isset($this->resultSet[$this->key()]);\n }", "public function getMap($key = '') {\n if (empty($key) || !isset($this->map[$key])) return false;\n else return $this->map[$key];\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n\t{\n\t\treturn array_key_exists($this->_idx, $this->_keys);\n\t}", "function valid() \n {\n return $this->offsetExists($this->position);\n }", "protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "protected function load()\n {\n if ($this->cache->contains($this->getCacheKey())) {\n $this->map = $this->cache->fetch($this->getCacheKey());\n } else {\n $this->generateMap();\n }\n }", "public function testMappingStructure()\n {\n $instance = $this->getInstance();\n $this->assertProtectedMethod('getMappingConfiguration');\n $method = $this->getClassMethod('getMappingConfiguration', true);\n\n $result = $method->invoke($instance);\n\n $this->assertEquals($this->getMapping(), $result);\n }", "public function getMapInfo() {\n if($this->mapInfo != NULL) {\n return $this->mapInfo;\n }\n\n $stream = $this->file->openStream('MapInfo');\n if($stream == NULL) {\n throw new MapException(\"MapInfo file not found on map MPQ file.\");\n }\n\n $parser = new BinaryStreamParser($stream);\n $this->mapInfo = new MapInfo($parser);\n return $this->mapInfo;\n }", "public function hasSavemap(){\n return $this->_has(20);\n }", "function test_getMapById() {\r\n\t\t$myArray= MemberClassesDB::getMap('memberClassId', 'memberClassName');\r\n\t\t$this->assertEqual($myArray['1'], \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myArray['1']);\r\n\t\t$this->assertEqual($myArray['2'], 'nosher',\r\n\t\t\t\t\"Should return nosher for key of 2 but returned \".$myArray['2']);\r\n\t}", "private function checkCurrent() {\n\t\tif ($this->currentObjectWriter==null)\n\t\t\tthrow new AjapWriterException(\"Wrong State\");\n\t}", "public function valid()\n {\n return key($this->entities) !== null;\n }", "public function valid() {\n return ( ! is_null($this->key()));\n }", "public function getMap() {\n\t\treturn is_array($this -> _referenceMap) ? $this -> _referenceMap : array();\n\t}", "public function getMap()\n {\n return $this->map;\n }", "public function getMap()\n {\n return $this->map;\n }", "public function valid()\n {\n $key = $this->key();\n return ($key !== false && $key !== null);\n }", "public function valid()\n {\n return isset($this->current_scrolled_response['hits']['hits'][0]);\n }", "public function valid()\n {\n return array_key_exists($this->index, $this->keys);\n }", "public function getVariantsMap()\n {\n $this->assertSame($this->mockVariantsMap, $this->abstractVariantFactory->getVariantsMap());\n }", "public function valid()\n {\n echo __METHOD__,PHP_EOL;\n $key = key($this->a);\n return ($key !== NULL && $key !== FALSE);\n }", "public function getResourceMap($id)\n {\n return false;\n }", "public function test_check_on_earth_invalid()\n {\n $coord = new stdClass();\n $coord->x = -133;\n $coord->y = 5543;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertFalse($checked);\n }", "public function valid(): bool\n {\n return $this->key() !== null && $this->key() !== false;\n }", "private function setUserMapPlace() {\n\t\t$this->mapPlaceManager->unsetMapPlace($this->user->id);\n\n\t\t$count = $this->mapPlaceManager->getFreeMapPlaceCount();\n\t\tif($count < 10 || GlobalConfig::ALWAYS_EXTEND_MAP ) {\n\t\t\t$mapManager = new MapManager($this->db);\n\t\t\t$mapManager->extendMap();\n\t\t}\n\t\t\t\n\t\t$mapPlace = $this->mapPlaceManager->getRandomFreeMapPlace();\n\t\t$mapPlace->userid = $this->user->id;\n\t\tif(!$mapPlace) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->mapPlaceManager->updateMapPlace($mapPlace);\n\t\t\treturn true;\n\t\t}\n\t}", "function IsMapVisible($mapPrivacy)\n{\n $mapVisible = false;\n if($mapPrivacy==0 && !is_null($mapPrivacy)) // publicly visible\n {\n $mapVisible=true;\n }\n elseif($mapPrivacy==1 && CheckLogin()) // visible to any RideNet user\n {\n $mapVisible=true;\n }\n return($mapVisible);\n}", "function valid() {\r\n return isset($this->_data[$this->_position]);\r\n }", "function loadFileMap()\r\n{\r\n return false;\r\n $file_map_path = Gravitycar\\lib\\builders\\FileMapBuilder::getFileMapPath();\r\n if (file_exists($file_map_path)) {\r\n require_once($file_map_path);\r\n } else {\r\n buildFileMap();\r\n require_once($file_map_path);\r\n }\r\n return $map;\r\n}", "public function testLoadUserMap()\n {\n parent::setUpPage();\n parent::setSession();\n $map_title = \"Sample Map User\";\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElement(WebDriverBy::linkText('My Maps'));\n $link->click();\n $map_link = $this->webDriver->findElement(WebDriverBy::linkText($map_title));\n $map_link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertEquals($this->webDriver->findElement(WebDriverBy::id('mapTitle'))->getText(), $map_title);\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function test_check_on_earth_valid()\n {\n $coord = new stdClass();\n $coord->x = -120;\n $coord->y = 43;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertTrue($checked);\n }", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "public function isKnown() {\n\t\t\treturn $this->hasData(static::$_key);\n\t\t}", "public function isValid(): bool {\n\t\treturn $this->getGlobeObj()->coordinatesAreValid( $this->lat, $this->lon );\n\t}", "protected function assertLoaded()\n\t{\n\t\tif (!$this->hasLoaded) {\n\t\t\t$this->settings = $this->loadSettings();\n\n\t\t\t$this->hasLoaded = true;\n\t\t}\n\t}", "public function valid()\n {\n return $this->key === 0;\n }", "public function valid(): bool\n {\n return isset($this->collection[$this->position]);\n }", "public function valid()\n {\n return isset($this->collection->getItems()[$this->position]);\n }" ]
[ "0.64523774", "0.64410555", "0.6375801", "0.6375801", "0.6144012", "0.6092912", "0.60356134", "0.59614795", "0.5868854", "0.58504844", "0.5806902", "0.57652193", "0.5625483", "0.5610382", "0.56039923", "0.55549026", "0.5554614", "0.55375725", "0.55181533", "0.5505959", "0.54975444", "0.54624397", "0.54581916", "0.54538345", "0.54106385", "0.5409309", "0.54086286", "0.5358024", "0.5277198", "0.52627695", "0.5260951", "0.52531624", "0.5233158", "0.5227939", "0.51821595", "0.51771206", "0.51731247", "0.5166882", "0.5161095", "0.5161095", "0.5160817", "0.51604", "0.51520705", "0.5151813", "0.51347274", "0.5128024", "0.5126418", "0.5116595", "0.5116595", "0.5113265", "0.51033026", "0.51022506", "0.50993025", "0.5096396", "0.5065546", "0.5059995", "0.50595474", "0.5055948", "0.5054184", "0.5050236", "0.50481427", "0.5046196", "0.5046196", "0.5046196", "0.50448513", "0.5037378", "0.5034778", "0.5023445", "0.50202924", "0.49973562", "0.49928257", "0.49845627", "0.49787813", "0.49781662", "0.4976404", "0.49631512", "0.49583423", "0.49505815", "0.49505815", "0.49491188", "0.49471533", "0.49468598", "0.49406788", "0.4930523", "0.49260262", "0.49240115", "0.49170214", "0.4911573", "0.49074167", "0.48979485", "0.48971134", "0.48769346", "0.48728144", "0.48686543", "0.48519012", "0.48501298", "0.48483488", "0.48307475", "0.4830726", "0.48239797" ]
0.63419557
4
Verifies the nextMap can properly be retrieved.
public function test_next_map() { $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "protected function hasMappingErrorOccurred() {}", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "public function hasLastrealmapid(){\n return $this->_has(33);\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "public function hasLastmapid(){\n return $this->_has(28);\n }", "public function hasMaps(){\n return $this->_has(15);\n }", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "public function valid()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return isset($mapKeys[$this->iteratorPosition]);\n }", "public function valid() {\n return isset($this->iteratorKeys[$this->iteratorPosition]);\n }", "public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }", "public function hasMapid(){\n return $this->_has(4);\n }", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->postScriptumServer->adminSetNextMap('Heelsum Single 01'));\n }", "public function valid()\n {\n return array_key_exists($this->key(), $this->iterator_data);\n }", "public function valid() { \n\t\t$page = &$this->touchPage();\n\t\treturn (key($page) !== null);\n\t}", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah Insurgency v1'));\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah AAS v1'));\n }", "public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }", "function next(){ \r\n\t $this->valid = (FALSE !== next($this->array)); \r\n\t }", "public function testNext()\n {\n $this->collection->next();\n $this->assertEquals(1, $this->collection->key());\n $this->assertEquals(2, $this->collection->current());\n\n $this->collection->last();\n $this->collection->next();\n $this->assertNull($this->collection->key());\n $this->assertFalse($this->collection->current());\n }", "public function valid() : bool\n {\n return !($this->key() >= count($this->currentRecordSet) && count($this->currentRecordSet) != $this->pageSize);\n }", "public function hasMapping();", "public function valid()\n {\n return $this->offsetExists($this->key());\n }", "protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }", "public function valid()\n {\n return $this->key() < $this->filesize;\n }", "public function valid() {\n return isset($this->keys[$this->index]);\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "private function _checkMap()\n {\n foreach($this->_map as $alias => $field)\n {\n if(!is_array($field))\n {\n $this->_map[$alias] = array(\n self::MAP_FIELD => $field\n );\n }\n if(isset($field[self::MAP_TYPE]) && in_array($field[self::MAP_TYPE],\n self::$_relationTypes))\n {\n switch($field[self::MAP_TYPE])\n {\n case self::RELATION_PARENT:\n if(empty($field[self::MAP_KEY]) || empty($field[self::MAP_FOREIGN_KEY]))\n {\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n }\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $mapper->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $alias . ucfirst($mapper->getKeyField());\n }\n break;\n\n case self::RELATION_CHILD:\n case self::RELATION_CHILDREN:\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n /** @var Core_Entity_Mapper_Abstract */\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n $backRelation = $mapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n if(!isset($field[self::MAP_SAVE]))\n {\n $field[self::MAP_SAVE] = true;\n }\n if(!isset($field[self::MAP_DELETE]))\n {\n $field[self::MAP_DELETE] = true;\n }\n break;\n\n case self::RELATION_M2M:\n /** @var Core_Entity_Mapper_Abstract */\n $targetMapper = $field[self::MAP_MAPPER];\n $targetMapper = new $targetMapper();\n\n /** @var Core_Entity_Mapper_Abstract */\n $middleMapper = $field[self::MAP_MIDDLE_MAPPER];\n $middleMapper = new $middleMapper();\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $backRelation = $middleMapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation == null)\n {\n throw new Core_Entity_Exception('Middle Mapper Not configured for m2m relation \"' . get_class($this) . '->' . get_class($middleMapper) . '\"');\n }\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n $field[self::MAP_SAVE] = false;\n $field[self::MAP_DELETE] = false;\n break;\n\n default:\n $log = Core_Log_Manager::getInstance()->getLog('default');\n if(!empty($log))\n {\n $log->log(\"[\" . get_class($this) . \"]\\t\" . 'Unknown relation type \"' . $field[self::MAP_TYPE] . '\"',\n Zend_Log::NOTICE);\n }\n throw new Core_Entity_Exception('Unknown relation type \"' . $field[self::MAP_TYPE] . '\"');\n break;\n }\n $this->_map[$alias] = $field;\n }\n }\n }", "private function storeNext ()\n {\n if ( !isset($this->iterator) ) {\n return FALSE;\n }\n\n else if ( $this->iterator->valid() ) {\n $this->cache[ $this->internalOffset ] = array(\n $this->iterator->key(),\n $this->iterator->current()\n );\n return TRUE;\n }\n\n // Once the internal iterator is invalid, we no longer need it\n else {\n unset( $this->iterator );\n return FALSE;\n }\n }", "public function testAccessMappingsInvalid(): void\n {\n $helper = new AccessTokenMappingHelper();\n\n $handler = new InvalidMappingHandlerStub();\n\n $this->expectException(InvalidMappingException::class);\n $this->expectExceptionMessage(\n 'Unknown mapping format. Mapping must return a multidimensional array with a single key.'\n );\n\n $helper->buildIndexMappings($handler);\n }", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "public function test2()\n {\n $rows = $this->dataLayer->tstTestMap1(0);\n $this->assertInternalType('array', $rows);\n $this->assertCount(0, $rows);\n }", "public function valid()\n {\n return !is_null(key($this->requests));\n }", "public function fill()\n {\n // Load the serialized map.\n // If there is none or it isn't current we will generate it anew.\n if (!$this->load()) {\n $this->generate();\n }\n\n // Still here? Sounds good\n return true;\n }", "public function valid()\n\t{\n\t\treturn array_key_exists($this->_idx, $this->_keys);\n\t}", "public function valid() {\n return $this->pointer < count($this->items);\n }", "public function next()\n {\n $this->valid = (false !== next($this->sessionData)); \n }", "public function rewind()\n {\n $this->valid = (reset($this->keys) !== false);\n }", "public function valid()\n {\n echo __METHOD__,PHP_EOL;\n $key = key($this->a);\n return ($key !== NULL && $key !== FALSE);\n }", "public function valid()\n {\n return $this->iteratorIndex < $this->iteratorCount;\n }", "public function valid() {\r\n \tif ($this->__pageItems > 0) {\r\n \t\tif ($this->key() + 1 > $this->pageEnd()) {\r\n \t\t\treturn FALSE;\r\n \t\t} else {\r\n \t\t\treturn $this->current() !== FALSE;\r\n \t\t}\r\n \t} else {\r\n \t\treturn $this->current() !== FALSE;\r\n \t}\r\n }", "#[\\ReturnTypeWillChange]\n public function rewind()\n {\n $this->valid = (reset($this->keys) !== false);\n }", "function valid() \n {\n return $this->offsetExists($this->position);\n }", "public function canNotAccessInternalContentObjectMapByReference() {}", "public function has_next_page()\n {\n }", "function valid() {\n if (isset($this->keys[$this->position])) {\n return $this->__isset($this->keys[$this->position]);\n }\n return false;\n }", "public function test1()\n {\n $map = $this->dataLayer->tstTestMap1(100);\n $this->assertInternalType('array', $map);\n $this->assertCount(3, $map);\n $this->assertEquals(1, $map['c1']);\n $this->assertEquals(2, $map['c2']);\n $this->assertEquals(3, $map['c3']);\n }", "public function valid(): bool\n {\n if (contains_key($this->entries, $this->position)) {\n return true;\n }\n\n if (null === $this->generator) {\n return false;\n }\n\n if ($this->generator->valid()) {\n return true;\n }\n\n $this->generator = null;\n return false;\n }", "public function hasUserMapList()\n {\n return $this->user_map !== null;\n }", "public function valid()\n {\n return $this->key() !== null;\n }", "public function valid()\n\t{\n\t\treturn $this->key() < $this->_totalItemCount;\n\t}", "public static function isInitialized() {\n\t\treturn isset(self::$cachedMap);\n\t}", "public function testIfReturnsMapBag()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertInstanceOf('\\SyncFS\\Map\\MapBag', $result);\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "public function valid()\n {\n return array_key_exists($this->index, $this->keys);\n }", "public function valid()\n {\n return $this->key === 0;\n }", "public function valid()\n {\n if(is_null($this->paginationVar))\n return true;\n return $this->curIndex < count($this->res);\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid() {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return !is_null($this->key());\n }", "public function valid()\n {\n return isset($this->current_scrolled_response['hits']['hits'][0]);\n }", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function adminSetNextMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminSetNextMap', $map, 'Set next map to');\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "public function valid()\n {\n return ($this->key() !== null);\n }", "protected static function _ensureCMapInstance(&$cmap) {}", "public function testRequireableStructure()\n {\n $instance = $this->getInstance();\n $this->assertPrivateMethod('getRequireableConfigurationMapping');\n $method = $this->getClassMethod('getRequireableConfigurationMapping', true);\n\n $result = $method->invoke($instance);\n\n $this->assertEquals(\n array_intersect_key(\n $this->getMapping(),\n ['requiredState' => true]\n ),\n $result\n );\n }", "public function valid()\n {\n return !!current($this->properties);\n }", "public function valid(): bool\n {\n return null !== $this->_nextScrollId;\n }", "public function valid()\n {\n return $this->key() < $this->getTotalItemCount();\n }", "public function valid()\n {\n return key($this->entities) !== null;\n }", "public function hasSavemap(){\n return $this->_has(20);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid()\n {\n return isset($this->resultSet[$this->key()]);\n }", "function test_getMapById() {\r\n\t\t$myArray= MemberClassesDB::getMap('memberClassId', 'memberClassName');\r\n\t\t$this->assertEqual($myArray['1'], \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myArray['1']);\r\n\t\t$this->assertEqual($myArray['2'], 'nosher',\r\n\t\t\t\t\"Should return nosher for key of 2 but returned \".$myArray['2']);\r\n\t}", "public function isMap()\r\n {\r\n return $this->isMap;\r\n }", "public function valid()\n {\n return $this->isCurrentKeyValid();\n }", "function valid() {\r\n return isset($this->_data[$this->_position]);\r\n }", "public function hasNextgoodsid(){\n return $this->_has(36);\n }", "public function equals(Map $map): bool;", "public function testGetCodeForInternalOffsetMethodWithOffsetOutOfMaxBounds(): void\n {\n $obj = new BaseApiCodes();\n $max = Lockpick::getConstant($obj, 'RESERVED_MAX_API_CODE_OFFSET');\n\n $this->expectException(\\OutOfBoundsException::class);\n Lockpick::call($obj, 'getCodeForInternalOffset', [$max + 1]);\n }", "public function next () {\n \treturn (FALSE !== next ($this->varContainer));\n }", "public function testGetCodeForInternalOffsetMethodWithOffsetOutOfMinBounds(): void\n {\n $obj = new BaseApiCodes();\n $min = Lockpick::getConstant($obj, 'RESERVED_MIN_API_CODE_OFFSET');\n\n $this->expectException(\\OutOfBoundsException::class);\n Lockpick::call($obj, 'getCodeForInternalOffset', [$min - 1]);\n }", "public function valid() {\n return ( ! is_null($this->key()));\n }", "public function valid()\n {\n $key = $this->key();\n return ($key !== false && $key !== null);\n }", "public function check(): bool\n {\n if (0 == $this->limit) {\n return false;\n }\n\n $key = $this->parseKey();\n\n if ($this->limit > $this->count($key, $this->time)) {\n $this->hit($key, $this->time);\n\n return false;\n }\n\n return true;\n }", "private function testMappingPossible($mcToGeMapping)\n {\n $geIds = array(); // Grid element layout IDs\n foreach ($mcToGeMapping as $id) {\n if (!empty($id)) {\n $geIds[] = (string) $id;\n } else {\n $geIds[] = 1;\n }\n }\n $ids = array_unique($geIds, SORT_NUMERIC);\n\n $select_fields = 'uid, hidden';\n $where = 'uid IN(' . implode(',', $ids) . ') AND deleted = 0';\n $orderBy = '';\n $table = 'tx_gridelements_backend_layout';\n\n $availability = array();\n $resource = $this->execSelect($select_fields, $where, $orderBy, $table);\n if ($resource === false) {\n return $availability;\n }\n\n foreach ($ids as $id) {\n $availability[$id] = 'unavailable';\n }\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $hidden = (int) $row['hidden'];\n $availability[$row['uid']] = $hidden ? 'hidden' : 'visible';\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n return $availability;\n }", "public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }", "public final function verifySetData(){\n\n foreach($this->data as $k => $v){\n $this->verifyData($k);\n }//foreach\n\n if(count($this->errors)){\n return false;\n }//if\n\n return true;\n\n }", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }" ]
[ "0.6516455", "0.6312409", "0.6198853", "0.608791", "0.608383", "0.6065419", "0.6012295", "0.5837406", "0.5720046", "0.57073665", "0.56728506", "0.55918354", "0.54946816", "0.54834014", "0.5476507", "0.5465668", "0.54432833", "0.54375935", "0.5434883", "0.54344213", "0.5410341", "0.5386359", "0.5360473", "0.53355646", "0.5254661", "0.5248001", "0.5246299", "0.5182116", "0.5167841", "0.5162859", "0.5140094", "0.5135282", "0.51338506", "0.51338506", "0.5132132", "0.5114562", "0.5105255", "0.509999", "0.50891924", "0.50835645", "0.50821376", "0.5079633", "0.5054229", "0.5047195", "0.50443137", "0.50407404", "0.5040659", "0.50330603", "0.50272995", "0.5013101", "0.5002224", "0.49960873", "0.4979219", "0.49773148", "0.49448523", "0.493994", "0.49312592", "0.49134582", "0.49062356", "0.49023244", "0.48939872", "0.48903373", "0.48841247", "0.48711503", "0.4869237", "0.4869237", "0.4861913", "0.4857388", "0.48538825", "0.48355746", "0.48228732", "0.48124623", "0.48124623", "0.48124623", "0.48121473", "0.48076668", "0.4807146", "0.48022935", "0.47951597", "0.47912142", "0.47871915", "0.47860017", "0.47860017", "0.47834167", "0.47693908", "0.47687462", "0.47596335", "0.47570726", "0.47555473", "0.4738677", "0.47338948", "0.473307", "0.47311792", "0.4729761", "0.4727094", "0.47158298", "0.47151366", "0.47019452", "0.46994865", "0.4690641" ]
0.63179684
1
Verifies the player list can properly be retrieved.
public function test_list_players() { $players = $this->postScriptumServer->listPlayers(); $this->assertCount(77, $players); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function ListValidatePlayer()\n {\n $users = User::where([\n ['isEnabled', 0],\n ['isDelete', 0]\n ])\n ->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(0, $playerList);\n }", "private function checkOnlineList()\n {\n $this->online->checkOnlineList($this->loginTime);\n }", "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(3, $playerList);\n\n foreach ($playerList as $player) {\n if ($player->getId() === 88) {\n $this->assertSame(195, $player->getDisconnectedSince());\n } else if ($player->getId() === 84) {\n $this->assertSame(108, $player->getDisconnectedSince());\n } else if ($player->getId() === 42) {\n $this->assertSame(3, $player->getDisconnectedSince());\n }\n }\n }", "public function test_list_disconnected_players()\n {\n $playerList = $this->postScriptumServer->listDisconnectedPlayers();\n\n $this->assertCount(3, $playerList);\n\n foreach ($playerList as $player) {\n if ($player->getId() === 88) {\n $this->assertSame(195, $player->getDisconnectedSince());\n } else if ($player->getId() === 84) {\n $this->assertSame(108, $player->getDisconnectedSince());\n } else if ($player->getId() === 42) {\n $this->assertSame(3, $player->getDisconnectedSince());\n }\n }\n }", "public function invalidPlayersProvider()\n {\n return [\n [[]], // no players\n [['Alice']], // too few players\n [['Alice', 'Bob', 'Carol', 'Eve', 'One too many']] // too many players\n ];\n }", "public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "public function playersThatArePlayingLogins() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$specLogins = array();\n\t\tforeach ($spectators as $spec) {\n\t\t\t$specLogins[] = trim($spec->login);\n\t\t}\n\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\t\t$allPlayersLogins = array();\n\t\tforeach ($allPlayers as $pl) {\n\t\t\t$allPlayersLogins[] = trim($pl->login);\n\t\t}\n\n\t\treturn array_diff($allPlayersLogins, $specLogins);\n\t}", "public function testShowListMemberSuccessfully(): void\n {\n $listMember = $this->createListMember(MailChimpData::$listData, MailChimpData::$listMemberData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s/members/%s', $listMember->getMailChimpList()->getId(), $listMember->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n foreach (MailChimpData::$listMemberData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "public function testList()\n {\n \t$player_factory = factory(KillingMode::class, 3)->create();\n \t$player = KillingMode::all();\n \t\n $this->assertCount(3, $player);\n }", "public function isPlayer()\r\n\t{\r\n\t\t\treturn count($this->getPlayerProfiles()) > 0;\r\n\t}", "public function assertListCorrect()\n {\n $records = Item::find()\n ->orderBy(['position' => SORT_ASC])\n ->all();\n\n foreach ($records as $recordNumber => $record) {\n $this->assertEquals($record->position, $recordNumber + 1, 'List positions have been broken!');\n }\n }", "public function getList($players = NULL){\n\t\tif(!is_null($players)){\n\t\t\tif(is_array($players)){\n\t\t\t\t$players = implode(\",\", $players);\n\t\t\t}\n\t\t\t$url = $this->_api_url.$this->platform;\n\t\t\t$request_string = \"request=getlist&players=\".$players;\n\t\t\t$data = ($this->_webRequest)? webRequest($url,$request_string) : alternativeRequest($url,\"?\".$request_string);\n\t\t\tif(!is_null($data) && $data !== false && count($data->players) > 0){\n\t\t\t\treturn $data;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function playersThatArePlaying() {\n\t\t$playersThatArePlayingLogins = $this->playersThatArePlayingLogins();\n\t\t$playersThatArePlaying = array();\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\n\t\tforeach ($allPlayers as $player) {\n\t\t\tif (in_array($player->login, $playersThatArePlayingLogins)) {\n\t\t\t\t$playersThatArePlaying[] = $player;\n\t\t\t}\n\t\t}\n\n\t\treturn $playersThatArePlaying;\n\t}", "public function assertListCorrect() {\n\t\t$activeRecordModel = $this->getTestActiveRecordFinder();\n\t\t$positionAttributeName = $activeRecordModel->getPositionAttributeName();\n\t\t$records = $activeRecordModel->findAll(array('order' => \"{$positionAttributeName} ASC\"));\n\t\tforeach ($records as $recordNumber => $record) {\n\t\t\t$this->assertEquals($record->$positionAttributeName, $recordNumber+1, 'List positions have been broken!');\n\t\t}\n\t}", "public function getPlayers();", "public function getPlayers();", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function test_can_get_players_api_JSON()\n { \n $expectedStatusCode = 200;\n\n $playerServices = new PlayerServicesJSON();\n $response = $playerServices->get();\n\n $this->assertEquals($response->status, $expectedStatusCode);\n }", "public function valid()\n {\n if ($this->list === null)\n $this->rewind(); // loads from the table\n if ($this->list === null)\n return false;\n $key = key($this->list);\n $valid = ($key !== NULL && $key !== FALSE);\n return $valid;\n }", "public function authorize(): bool\n {\n return null !== $this->getGame()->findPlayerByName($this->request->get('nickname'));\n }", "public function testUpdateListSuccessfully(): void\n {\n // create list\n $this->createListMemberViaApi(MailChimpData::$listData);\n\n // create list member\n $this->post(\"/mailchimp/lists/{$this->listId}/members/\", MailChimpData::$listMemberData);\n $listMember = \\json_decode($this->response->content(), true);\n\n // update list member\n $this->put(\\sprintf('/mailchimp/lists/%s/members/%s', $this->listId , $listMember['list_member_id']), ['language' => 'ru']);\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n foreach (\\array_keys(MailChimpData::$listMemberData) as $key) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals('ru', $content['language']);\n }\n }", "public function authPlayer()\n {\n $player = Player::where(array('name'=>Input::get('name'),'password' => md5(Input::get('password'))))->get();\n if($player->isEmpty())\n {\n return \"false\";\n }\n else{\n $playerattr = File::get(public_path().'/playerattr.json');\n $player = $player->toArray();\n foreach(json_decode($playerattr,true) as $key => $value){\n if($value['id'] === $player[0]['id']){\n $player[0]['defence_set_length'] = $value['defence_set_length'];\n break;\n }\n }\n return $player[0];\n }\n }", "private function _checkExist()\n {\n $ret = ['valid' => true, 'message' => []];\n\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $eitherOptions = ['username', 'email'];\n\n $choseOptions = array_intersect($eitherOptions, array_keys($this->data));\n\n foreach ($choseOptions as $option) {\n if ($option == 'username') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `username` = :username\";\n } elseif ($option == 'email') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `email` = :email\";\n }\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute([$option => $this->data[$option]]);\n\n if ($stmt->fetchColumn() != 0) {\n $ret['valid'] = false;\n $ret['message'][] = $option . '{' . $this->data[$option] . '} has been occupied, please try again.';\n }\n }\n\n\n return $ret;\n }", "public function test_showAddToWishList_IsAvailableCannotCheckedOutCannotPlaceHolds_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(true);\r\n\t\t$this->prepareisCheckOutAvailable(false);\r\n\t\t$this->prepareIsPlaceHoldAvailable(false);\r\n\t\t\t\t\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertTrue($actual);\r\n\t}", "public function testAvailable()\n {\n $response = $this->json('GET', '/api/list');\n\n $this->assertEquals(200, $response->status());\n\n\n }", "public function test_showAddToWishList_AddToWishListIsNotAvailable_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(false);\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertFalse($actual);\r\n\t}", "public function testRetrieveListUnsuccessfulReason()\n {\n }", "public function storeplayers(){\n \t$data = file_get_contents(\"https://fantasy.premierleague.com/api/bootstrap-static/\");\n \t$playersJson = json_decode($data);\n \t$players = $playersJson->elements;\n \t$saveCount = 0;\n \t$playerCodes = Players::pluck('code')->toArray();\n \tforeach($players as $player){\n \t\tif (!in_array($player->code, $playerCodes)){\n \t\t\t$savePlayer = new Players();\n \t\t\t$savePlayer->id = $player->id;\n \t\t\t$savePlayer->code = $player->code;\n \t\t\t$savePlayer->first_name = $player->first_name;\n \t\t\t$savePlayer->second_name = $player->second_name;\n \t\t\t$savePlayer->team = $player->team;\n \t\t\t$savePlayer->team_code = $player->team_code;\n \t\t\t$savePlayer->photo = $player->photo;\n \t\t\t$savePlayer->form = $player->form;\n \t\t\t$savePlayer->total_points = $player->total_points;\n \t\t\t$savePlayer->influence = $player->influence;\n \t\t\t$savePlayer->creativity = $player->creativity;\n \t\t\t$savePlayer->threat = $player->threat;\n \t\t\t$savePlayer->ict_index = $player->ict_index;\n \t\t\t$savePlayer->save();\n \t\t\t$saveCount++;\n \t\t}\n \t\tif($saveCount==100){\n \t\t\tbreak;\n \t\t}\n \t}\n }", "public function test_connection() {\n\t\treturn is_array( $this->_get_lists() );\n\t}", "public function testShowListNotFoundException(): void\n {\n $this->get('/mailchimp/lists/invalid-list-id');\n\n $this->assertListNotFoundResponse('invalid-list-id');\n }", "public function valid()\n {\n return isset($this->list[$this->position]);\n }", "function setup_undrafted_list() {\n global $smarty;\n global $SEASON;\n global $Link;\n $draftedListSubQuery = 'SELECT playerId FROM ' . DRAFT . ' WHERE seasonId=' . $SEASON;\n $undraftedListSubQueryColumns = 'playerFName,playerLName,skillLevelName,position';\n $undraftedListSelect = 'SELECT ' . $undraftedListSubQueryColumns;\n $undraftedListSelect.= ' FROM ' . PLAYER;\n $undraftedListSelect.= ' JOIN ' . REGISTRATION . ' ON ' . PLAYER . '.registrationId = ' . REGISTRATION . '.registrationId';\n $undraftedListSelect.= ' JOIN ' . SKILLLEVELS . ' ON ' . PLAYER . '.playerSkillLevel = ' . SKILLLEVELS . '.skillLevelID';\n $undraftedListSelect.= ' WHERE ' . PLAYER . '.seasonId=' . $SEASON;\n $undraftedListSelect.= ' AND ' . PLAYER . '.playerID NOT IN (' . $draftedListSubQuery . ')';\n $undraftedListSelect.= ' ORDER BY playerSkillLevel DESC ,playerLName';\n $undraftedListResult = mysql_query($undraftedListSelect, $Link) or die(\"sp_clubs (Line \" . __LINE__ . \"): \" . mysql_errno() . \": \" . mysql_error());\n if ($undraftedListResult && mysql_num_rows($undraftedListResult) > 0) {\n $countPlayers = 0;\n $smarty->assign('playerFName', array());\n $smarty->assign('playerLName', array());\n $smarty->assign('skillLevelName', array());\n $smarty->assign('position', array());\n while ($player = mysql_fetch_array($undraftedListResult, MYSQL_ASSOC)) {\n $countPlayers++;\n $playerFName = $player['playerFName'];\n $playerLName = $player['playerLName'];\n $skillLevelName = $player['skillLevelName'];\n $playerPosition = $player['position'];\n $smarty->append('countPlayers', $countPlayers);\n $smarty->append('playerFName', $playerFName);\n $smarty->append('playerLName', $playerLName);\n $smarty->append('skillLevelName', $skillLevelName);\n $smarty->append('position', $playerPosition);\n }\n $smarty->assign('countPlayers', $countPlayers);\n }\n}", "public function actionPlayedlist() {\n // Response format data\n $result_array = array(\n 'result' => self::BadRequest,\n 'msg' => Yii::t('user', 'Request method illegal!'),\n 'total' => 0,\n 'list' => array(),\n );\n // Check request type\n $request_type = Yii::app()->request->getRequestType();\n if ('GET' != $request_type) {\n $this->sendResults($result_array, self::BadRequest);\n }\n\n // Get query data\n $_offset = Yii::app()->request->getQuery('offset');\n $_limit = Yii::app()->request->getQuery('limit');\n $_offset = empty($_offset) ? 0 : intval($_offset);\n $_limit = empty($_limit) ? $this->playlist_maximum : intval($_limit);\n $_limit = ($_limit > $this->playlist_maximum) ? $this->playlist_maximum : $_limit;\n\n // Get room device\n //$_device = DeviceState::model()->findByAttributes(array('room_id' => $this->_roomID, 'status' => 0));\n // Get STB\n $_device = Yii::app()->db->createCommand()\n ->select('ds.device_id')\n ->from('{{device_state}} ds')\n ->join('{{room}} r', 'ds.room_id = r.id')\n ->join('{{device}} d', 'ds.device_id = d.id')\n ->where('r.id=:id AND d.type=:type', array(':id' => $this->_roomID, ':type' => 1))\n ->queryRow();\n\n if (!is_null($_device) && !empty($_device)) {\n $_deviceid = $_device['device_id'];\n\n // log\n $criteria = new CDbCriteria();\n $criteria->condition = 'status = :status and device_id = :deviceid';\n\n // get played list\n $criteria->params = array(':deviceid' => $_deviceid, ':status' => 2);\n\n $_count = intval(DevicePlaylist::model()->count($criteria));\n\n $criteria->offset = $_offset;\n $criteria->limit = $_limit;\n $criteria->order = 'index_num asc';\n $play_list = DevicePlaylist::model()->findAll($criteria);\n if (!empty($play_list)) {\n // Get list success\n $result_array['result'] = self::Success;\n $result_array['msg'] = Yii::t('user', 'Get played list success!');\n $result_array['total'] = $_count;\n foreach ($play_list as $key => $_list) {\n $_media = $_list->media;\n // get user avatar information of song adder\n $_userinfo = $this->getUserInfo($_list->create_user_id);\n\n $result_array['list'][] = array(\n 'songid' => $_media->songid,\n 'played_time' => intval($_list->index_num),\n 'songname' => $_media->name,\n 'singername' => $_media->artist->name,\n 'duration' => intval($_media->duration),\n 'smallpicurl' => $this->getMediaPicUrl($_media, $_media->spic_url, 0),\n 'bigpicurl' => $this->getMediaPicUrl($_media, $_media->bpic_url),\n 'userid' => $_userinfo['uid'],\n 'nickname' => $_userinfo['nickname'],\n 'avatarurl' => $_userinfo['avatarurl'],\n );\n }\n } else {\n $result_array['result'] = self::Success;\n $result_array['msg'] = Yii::t('user', 'Played list is empty!');\n $result_array['total'] = $_count;\n }\n } else {\n $result_array['msg'] = Yii::t('user', 'Room STB invalid!');\n }\n\n // Set response information\n $this->sendResults($result_array);\n }", "public function checkVideos() : boolean {\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildPostUrl());\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t\t$fixed = json_decode($result);\n\t\t$videos = $fixed->data;\n\t\techo '<pre>';\n\t\tvar_dump($videos);\n\t\tdie();\n\t\treturn $videos;\n\t}", "protected function checkEquipped()\r\n\t{\r\n\t\t$check = $this->db->getone(\"select count(*) as `count` from `player_items` where `type`=? and `player`=? and `equipped`=1\", array($this->item['type'], $this->item['player']));\r\n\t\t\r\n\t\tif ($check == 0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function test_connection() {\n\t\t/**\n\t\t * just try getting a list as a connection test\n\t\t */\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_Mailchimp $mc */\n\t\t\t$mc = $this->get_api();\n\n\t\t\t$mc->request( 'lists' );\n\t\t} catch ( Thrive_Dash_Api_Mailchimp_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function searchForPlayList();", "function listNameValidator($console, $name):bool\r\n{\r\n\r\n $html_resp = curlHelper::execute($console, 'lists/'.$name.'?format=json',array(404,200));\r\n\r\n if($html_resp['code'] != 404) {\r\n return false;\r\n }else return true;\r\n\r\n}", "function zg_ai_have_num_players($num_players) {\n\n // Goal: $num players across the game.\n $sql = 'select count(id) as count from users\n where meta like \"ai_%\";';\n $result = db_query($sql);\n $item = db_fetch_object($result);\n firep($item, 'ai item');\n $count = (int) $item->count;\n\n zg_ai_out(\"want $num_players players, have $count\");\n\n if ($count >= $num_players) {\n // zg_ai_out('woohoo! we have enough players! returning TRUE');.\n return TRUE;\n }\n\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n return FALSE;\n}", "function isReady($player) {\n\t// check if the player exists and has a username in the gamestate\n\treturn isset(readPlayerData($player)['username']);\n}", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "function checkteam($team) {\n\t$result = $team->list_members();\n\tif (count($result) < 3) {\n\t\tprint <<<EOT\n<h1>Edit Match</h1>\n<p>\nSorry but there are not enough members in {$team->display_name()} yet to\nmake up a match with.</p>\n<p>Please <a href=\"javascript:history.back()\">click here</a> to go back\nor <a href=\"teamsupd.php\">here</a> to update teams.</p>\n\nEOT;\n\t\tlg_html_footer();\n\t\texit(0);\n\t}\n\tforeach ($result as $p) {\n\t\t$p->fetchdets();\n\t}\n\treturn $result;\n}", "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUse($_SESSION['loginid']);\n\t}\n\techo \"<table width=\\\"857\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\tif ($_GET['lid'] == 0){\n\t\techo \"\t<tr>\\n\";\n\t\techo \"\t\t<td>\"._LEAGUE_NO_LEAGUE_ID.\"</td>\\n\";\n \t\techo \"\t</tr>\\n\";\n\t} else {\n\t\techo \"\t<tr>\\n\";\n\t\tif ($_GET['show'] != \"id\" && $_GET['show'] != \"season_players_all_guid\"){\n\t\t\techo \"\t\t<td width=\\\"30\\\" valign=\\\"middle\\\" class=\\\"eden_title\\\">ID</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t}\n\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\techo \"\t</tr>\\n\";\n\t\t//$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']);\n\t\tswitch ($_GET['show']){\n\t \t\tcase \"id\":\n\t \t\t\t$colspan = 1;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players \n\t\t\t\tWHERE league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY league_season_round_allowed_player_guid\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t \t\tbreak;\n\t\t\tcase \"season_players_all\":\n\t\t\t\t$colspan = 4;\n\t \t\tbreak;\n\t\t\tcase \"season_players_all_guid\":\n\t \t\t\t$colspan = 1;\n\t \t\tbreak;\n\t\t\tdefault:\n\t \t\t\t$colspan = 4;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players AS lsrap \n\t\t\t\tJOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id \n\t\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\t\t\t\tWHERE lsrap.league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$_GET['show'] = \"all\";\n\t\t}\n\t\t\n\t\t$cislo = 0;\n\t\t// pro zobrazeni povolenych hracu\n\t\tif ($_GET['show'] == \"id\" || $_GET['show'] == \"all\"){\n\t\t\twhile ($ar_round = mysql_fetch_array($res_round)){\n\t\t\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\tif ($_GET['show'] != \"id\"){\n\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_round['admin_id'].\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_round['league_team_name']).\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_round['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo \"</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t$cislo++;\n\t\t\t}\n\t\t\tunset($ar_round);\n\t\t}\n\t\t// pro zobrazeni vsech hracu\n\t\tif ($_GET['show'] == \"season_players_all\" || $_GET['show'] == \"season_players_all_guid\"){\n\t\t\t$res_team = mysql_query(\"\n\t\t\tSELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id \n\t\t\tFROM $db_league_teams_sub_leagues AS ltsl \n\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id \n\t\t\tWHERE ltsl.league_teams_sub_league_league_id=\".(integer)$_GET['lid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\twhile ($ar_team = mysql_fetch_array($res_team)){\n\t\t\t\t$res_player = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id \n\t\t\t\tFROM $db_league_players AS lp \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\t\t\t\tJOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=\".(integer)$ar_team['league_teams_sub_league_league_id'].\" AND ag.admin_guid_guid != '' \n\t\t\t\tWHERE lp.league_player_team_sub_id=\".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$i=1;\n\t\t\t\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\t\tif ($_GET['show'] != \"season_players_all_guid\"){\n\t\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_team['league_team_name']).\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_player['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_player['admin_guid_guid']).\"</td>\\n\";\n\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\techo \"</table>\\n\";\n}", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "function checks() {\n\t// Check login\n\tif (isset($_COOKIE['id']) AND isset($_COOKIE['authkey'])) {\n\t\t$pdo=new PDO('mysql:host=gtogame.db.9808275.hostedresource.com;dbname=gtogame', 'gtogame', 'D7Awthkp2946!');\n\t\t$stmt=$pdo->prepare('SELECT banned, banreason, dead, health, sessauth FROM Players WHERE id = :id LIMIT 1');\n\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\t// Verify player logged in legitimately\n\t\tif ($row['sessauth'] != $_COOKIE['authkey']) {\n\t\t\tsetcookie ('id', '0', time()-300, '/', '', 0);\n\t\t\tsetcookie ('authkey', '0', time()-300, '/', '', 0);\n\t\t\theader(\"Location: index.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check health\n\t\tif ($row['health'] == 0 OR $row['dead'] > 0) {\n\t\t\theader(\"Location: dead.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check ban status\n\t\tif($row['banned'] == 1) {\n\t\t\techo \"<h1>You have been banned!</h1>If you have any questions, please contact a staff member.<br><br><strong>Reason:</strong> \".$row['banreason'];\n\t\t\texit();\t \n\t\t}\n\t} else {\n\t\theader(\"Location: index.php\");\n\t\texit();\n\t}\n}", "public function testGetListWithInvalidPromotorToken()\n {\n // Populate data\n $promotorID = $this->_populatePromotor();\n \n // Create token\n $token = str_random(5);\n $encryptedToken = $this->token->encode($promotorID, $token);\n \n // Do request\n $this->_request('GET', '/api/1.5.0/news-list', ['token' => '1234'])\n ->_result(['error' => 'no-auth']);\n }", "function get_playlists_no_more_cb26()\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$result = $db->select(tbl($this->playlist_tbl),\"*\",\" playlist_type='\".$this->type.\"' AND userid='\".userid().\"'\");\r\n\t\t\r\n\t\tif(count($result)>0)\r\n\t\t\treturn $result;\r\n\t\treturn false;\r\n\t}", "public function testCreateListValidationFailed(): void\n {\n $this->post('/mailchimp/lists');\n\n $content = \\json_decode($this->response->getContent(), true);\n\n $this->assertResponseStatus(self::HTTP_STATUS_BAD_REQUEST);\n self::assertArrayHasKey('message', $content);\n self::assertArrayHasKey('errors', $content);\n self::assertEquals('Invalid data given', $content['message']);\n\n foreach (\\array_keys(static::$listData) as $key) {\n if (\\in_array($key, static::$notRequired, true)) {\n continue;\n }\n\n self::assertArrayHasKey($key, $content['errors']);\n }\n }", "public function testRemoveMemberFromListSuccessfully(): void\n {\n // create list\n $this->createListMemberViaApi(MailChimpData::$listData);\n\n // create list member\n $this->post(\"/mailchimp/lists/{$this->listId}/members/\", MailChimpData::$listMemberData);\n $listMember = \\json_decode($this->response->content(), true);\n\n // remove member from list\n $this->delete(\\sprintf('/mailchimp/lists/%s/members/%s', $this->listId, $listMember['list_member_id']));\n\n $this->assertResponseOk();\n self::assertEmpty(\\json_decode($this->response->content(), true));\n }", "public function testFetchList() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t\n\t\t// Fetch the list\n\t\t$listCopy = $jsonpad->fetchList($listData[\"name\"]);\n\t\t$this->assertSame($list->getName(), $listCopy->getName());\n\t\t\n\t\t// Delete the list\n\t\t$listCopy->delete();\n\t}", "public function allow_inventory_access(){\n if (!empty($this->flags['player_battle'])){ return false; }\n elseif (!empty($this->flags['challenge_battle'])){ return false; }\n return true;\n }", "protected function _check_videos_transient() {\n\n\t\t$video_urls_transient = get_transient( $this->_ttw_api_url_transient );\n\n\t\tif ( ! $video_urls_transient ) {\n\t\t\t$this->_build_videos_transient();\n\t\t}\n\t}", "public function testCreateListMemberSuccessfully(): void\n {\n // create list\n $this->createListMemberViaApi(MailChimpData::$listData);\n\n // create list member\n $this->post(\"/mailchimp/lists/{$this->listId}/members\", MailChimpData::$listMemberData);\n\n $content = \\json_decode($this->response->getContent(), true);\n\n $this->assertResponseOk();\n $this->seeJson(MailChimpData::$listMemberData);\n\n self::assertArrayHasKey('mail_chimp_id', $content);\n self::assertNotNull($content['mail_chimp_id']);\n }", "public function testCreateListSuccessfully(): void\n {\n $this->post('/mailchimp/lists', static::$listData);\n\n $content = \\json_decode($this->response->getContent(), true);\n\n $this->assertResponseOk();\n $this->seeJson(static::$listData);\n self::assertArrayHasKey('mail_chimp_id', $content);\n self::assertNotNull($content['mail_chimp_id']);\n\n $this->createdListIds[] = $content['mail_chimp_id']; // Store MailChimp list id for cleaning purposes\n }", "public function get_players()\n {\n return $this->players;\n }", "public function testGetTeamPlayersWithSuccess()\n {\n $argument = $this->teams[0]['id'];\n $this->classUnderTestConstructorArgs['teamRepository']->shouldReceive('getTeamPlayers')->with($argument, TeamService::DEFAULT_OFFSET, TeamService::DEFAULT_LIMIT)->andReturn($this->teams[0]['players']);\n $actual = $this->mockedTeamService->getTeamPlayers($this->teams[0]['id']);\n $expected = $this->teams[0]['players'];\n $this->assertEquals($actual, $expected);\n }", "public function playerList($param)\n {\n try {\n $player = Player::where('id', $param)->orWhere('first_name', $param)->orWhere('last_name', $param)->first();\n if ($player) {\n $team = $player->team()->get('name');\n if ($team) {\n return json_encode(array(\"status\" => 200, \"message\" => \"Players\", \"response\" => array($player, $team)));\n }\n return json_encode(array(\"status\" => 200, \"message\" => \"Players info without team details\", \"response\" => array($player)));\n }\n return json_encode(array(\"status\" => 500, \"message\" => \"Player not found\"));\n } catch (Throwable $e) {\n report($e);\n return json_encode(array(\"status\" => 500, \"message\" => \"Something went wrong\"));\n }\n }", "public function getPlayers ()\r\n {\r\n return $this->players;\r\n }", "public function isplayer()\n\t{\n\t\treturn $this->Players->isplayer($this->SqueezePlyrID);\n\t}", "public function testSettingPlayers()\n {\n $dice = new DicePlayers();\n $this->assertInstanceOf(\"\\Heln\\Dice\\DicePlayers\", $dice);\n\n $dice->setPlayers();\n $res = $dice->getPlayers();\n $exp = [\n \"Player\" => 0,\n \"Computer\" => 0,\n ];\n $this->assertEquals($exp, $res);\n }", "function oid_check_teams($response)\n{\n $requiredTeam = common_config('openid', 'required_team');\n if ($requiredTeam) {\n $team_resp = new Auth_OpenID_TeamsResponse($response);\n if ($team_resp) {\n $teams = $team_resp->getTeams();\n } else {\n $teams = array();\n }\n\n $match = in_array($requiredTeam, $teams);\n $is = $match ? 'is' : 'is not';\n common_log(LOG_DEBUG, \"Remote user $is in required team $requiredTeam: [\" . implode(', ', $teams) . \"]\");\n\n return $match;\n }\n\n return true;\n}", "public function isPlayerRegistered(string $player){\n \tif($this->getDataProvider()){\n \t\t//Check MySQL connection\n \t\tif($this->getDatabase() && $this->getDatabase()->ping()){\n \t\t\t$stmt = $this->getDatabase()->prepare(\"SELECT user, password, ip, firstlogin, lastlogin FROM \" . $this->getDatabaseConfig()[\"table_prefix\"] . \"serverauthdata WHERE user=?\");\n \t\t\t$stmt_player = strtolower($player);\n \t\t\t$stmt->bind_param(\"s\", $stmt_player);\n \t\t\t$stmt->execute();\n \t\t\t$stmt->store_result();\n \t\t\tif($stmt->num_rows == 0){\n \t\t\t\t//Unset User in cached array\n \t\t\t\tif(isset($this->cached_registered_users[strtolower($player)])){\n \t\t\t\t\tunset($this->cached_registered_users[strtolower($player)]);\n \t\t\t\t}\n \t\t\t\t$stmt->close();\n \t\t\t\treturn false;\n \t\t\t}else{\n \t\t\t\t//Set User in cached array\n \t\t\t\tif(!isset($this->cached_registered_users[strtolower($player)])){\n \t\t\t\t\t$this->cached_registered_users[strtolower($player)] = \"\";\n \t\t\t\t}\n \t\t\t\t$stmt->close();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}else{\n \t\t\treturn ServerAuth::ERR_GENERIC;\n \t\t}\n \t}else{\n \t\t$status = file_exists($this->getDataFolder() . \"users/\" . strtolower($player . \".yml\"));\n \t\tif($status){\n \t\t\t//Set User in cached array\n \t\t\tif(!isset($this->cached_registered_users[strtolower($player)])){\n \t\t\t\t$this->cached_registered_users[strtolower($player)] = \"\";\n \t\t\t}\n \t\t}else{\n \t\t\t//Unset User in cached array\n \t\t\tif(isset($this->cached_registered_users[strtolower($player)])){\n \t\t\t\tunset($this->cached_registered_users[strtolower($player)]);\n \t\t\t}\n \t\t}\n \t\treturn $status;\n \t}\n }", "private function _isListMemberLimitReached($listname)\r\n {\r\n $members = $this->getMembers($listname);\r\n return self::LIST_MEMBER_LIMIT < count($members->users->user);\r\n }", "public function isValidResponse(){\n\t\treturn $this->isLoaded(); \n\t}", "public function testListMemberMFAChallenges()\n {\n }", "public function isValid() : bool\n {\n return in_array($this->getStatusCode(), Response::CODE_LIST);\n }", "public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }", "static function verify()\n {\n global $pommo;\n $dbo = & Pommo::$_dbo;\n if (is_object($dbo))\n {\n $query = \"SHOW TABLES LIKE '%s'\";\n $query = $dbo->prepare($query, array($dbo->_prefix.'%'));\n if ($dbo->records($query) > 10)\n return true;\n }\n return false;\n }", "public function isValid()\n {\n foreach ($this->repo as $repository) {\n /**\n * @var Repository $repository\n */\n $repository->needAuth();\n }\n }", "public function test_teams_show_authenticated_leader_returns_403(){\n $this->signInLeader();\n $response = $this->get(route('teams.show', ['team' => 1]));\n $response->assertStatus(403);\n }", "public function valid() {\n return $this->pointer < count($this->items);\n }", "private function welcome_players()\n\t{\n\t\t$players = $this->players->all(); \n\n\t\t\n\t\t$players_array = array ();\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\t$player['equity'] = $this->players->equity($player['player']);\n\t\t\t$players_array[] = (array) $player;\n\t\t}\n\t\t$this->data['test'] = $players_array; \n\t}", "public function testGetAll()\n {\n $ret =\\App\\Providers\\ListsServiceProvider::getLists();\n \n $this->assertNotEmpty($ret);\n }", "public function test_setup_validate(){\n\t\t$listotron = new Listotron();\n\n\t\t$user1 = md5(rand() . md5(rand()));\n\t\t$now = $listotron->getNOW();\n\t\t\n\t\t// make sure it's valid\n\t\t$this->assertTrue($listotron->isValidHuh());\n\n\t\t// modify the List\n\t\t$rows = $listotron->indent(4, $user1);\n\t\t\n\t\t// make sure it's still valid\n\t\t$this->assertTrue($listotron->isValidHuh());\n\t}", "public function valid(): bool\n {\n return (current($this->items) !== false);\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 }", "private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }", "public function loadOnlinePlayers() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"All Online Players\");\n\t\t$players = $this -> database -> query(\"SELECT * FROM \" . GLOBAL_DB . \".members WHERE online=1 AND lastWorld !=-1\");\n\t\t$table = \"\";\n\t\twhile ($playerData = $players -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$user = User::getUser($playerData['UID']);\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $user -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">World \" . $user -> getLastWorld() . \"</td>\n\t\t\t</tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t\t$table = \"There are currently no online players.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"globe\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "function testPowerpackList()\n {\n $request = new PlivoRequest(\n 'GET',\n 'Account/MAXXXXXXXXXXXXXXXXXX/Powerpack/',\n []);\n $body = file_get_contents(__DIR__ . '/../Mocks/powerpackListResponse.json');\n\n $this->mock(new PlivoResponse($request,200, $body));\n\n $actual = $this->client->powerpacks->list();\n\n $this->assertRequest($request);\n\n self::assertNotNull($actual);\n }", "public function valid()\n {\n return isset($this->collection->getItems()[$this->position]);\n }", "public function testCanListWalletAddresses()\n {\n $result = Wallet::list(Wallet::BITCOIN);\n $this->assertInternalType('array', $result);\n\n $result = Wallet::list();\n $this->assertInternalType('array', $result);\n }", "public function getPlayers()\n {\n $status = $this->getStatus();\n $out = [];\n\n if (is_array($status)) {\n $info = null;\n if(isset($status['MediaContainer'])) {\n if(isset($status['MediaContainer']['Metadata'])) {\n $info = $status['MediaContainer']['Metadata'];\n }\n elseif(isset($status['MediaContainer']['Video'])) {\n $info = $status['MediaContainer']['Video'];\n }\n\t\telseif(isset($status['MediaContainer'][0]['Metadata'])) {\n $info = $status['MediaContainer'][0]['Metadata'];\n }\n }\n\n if (!empty($info)) {\n if (isset($info['Player'])) {\n $out[] = $info['Player'];\n } else {\n $f = true;\n for ($i = 0; $f === true; $i++) {\n if (isset($info[$i]['Player'])) {\n $out[] = $info[$i]['Player'];\n } else {\n $f = false;\n }\n }\n }\n\n return $out;\n }\n }\n WS::log()->debug(\"No status returned from Plex server. Probably no media is playing.\");\n\n return null;\n }", "public function questionLoadingFailed()\r\n {\r\n return (!isset($this->questionInfo->items));\r\n }", "public function getPlayers(): array;", "public function getPlayers()\n {\n return $this->players;\n }", "function checkForLists() {\n $res = true;\n foreach ($this->listFields() as $fieldName) {\n $fieldInfo = $this->getFieldInfo($fieldName);\n $res = $this->_checkForList($fieldName, $fieldInfo);\n }\n return $res;\n }", "private function canListAndCreate()\n {\n return true;\n }", "function user_listPlayersAction($config) {\n\t\t$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['kaltura']);\n\n\t\tif ($conf['partnerID'] == 0 || $conf['adminSecret'] == '' || $conf['userID'] == '')\n\t\t{\n\t\t\t$this->view->assign('error', Tx_Extbase_Utility_Localization::translate('bad_configuration', 'kaltura'));\n\t\t\treturn $this->view->render();\n\t\t}\n\n\t\ttry {\n\t\t\t$configuration = t3lib_div::makeInstance('KalturaConfiguration', $conf['partnerID']);\n\t\t\t$host = ($conf['kalturaHost'] != '')?$conf['kalturaHost'] : 'www.kaltura.com';\n\t\t\t$configuration->serviceUrl = 'http://'.$host.'/';\n\t\t\t/**\n\t\t\t * @var KalturaClient\n\t\t\t */\n\t\t\t$client = t3lib_div::makeInstance('KalturaClient', $configuration);\n\t\t\t$ks = $client->session->start($conf['adminSecret'], $conf['userID'], KalturaSessionType::ADMIN);\n\t\t\t$client->setKs($ks);\n\n\t\t\t$playerss = $client->uiConf->listAction();\n\t\t\t$add = array();\n\t\t\tforeach ($playerss as $players) \n\t\t\t\tif (is_array($players))\n\t\t\t\t\tforeach ($players as $player)\n\t\t\t\t\t\t$add[] = array((string)$player->name,intval($player->id));\n\n\t\t\t$config['items'] = array_merge($config['items'],$add);\n\n\t\t} catch (KalturaException $e) {\n\t\t\t$config['items'] = array_merge($config['items'],array(array('Could not connect to kaltura host with provided credentials','0')));\n\t\t}\n\t\treturn $config;\n\t}", "public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }", "public function testUpdateListValidationFailed(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->put(\\sprintf('/mailchimp/lists/%s', $list->getId()), ['visibility' => 'invalid']);\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseStatus(self::HTTP_STATUS_BAD_REQUEST);\n self::assertArrayHasKey('message', $content);\n self::assertArrayHasKey('errors', $content);\n self::assertArrayHasKey('visibility', $content['errors']);\n self::assertEquals('Invalid data given', $content['message']);\n }", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "public function isAvailable()\n {\n if ($this->archived) {\n return false;\n }\n\n $result = self::$db->fetchOne('select count(*) AS valid\n from jukebox.playlists\n inner join jukebox.playlist_availability on playlists.playlistid = playlist_availability.playlistid\n inner join jukebox.playlist_timeslot\n on playlist_availability.playlist_availability_id = playlist_timeslot.playlist_availability_id\n where playlists.playlistid = $1\n and playlist_availability.effective_from <= NOW()\n and (playlist_availability.effective_to is null or playlist_availability.effective_to >= NOW())\n and (\n day=EXTRACT(DOW FROM NOW())\n or (EXTRACT(DOW FROM NOW())=0 and day=7)\n )\n and start_time <= \"time\"(NOW())\n and end_time >= \"time\"(NOW())', [$this->getID()]);\n\n return $result['valid'] > 0;\n }", "function isAdmin($player) {\n\n\t\t// check for admin list entry\n\t\tif (isset($player->login) && $player->login != '' && isset($this->admin_list['TMLOGIN']))\n\t\t\tif (($i = array_search($player->login, $this->admin_list['TMLOGIN'])) !== false)\n\t\t\t\t// check for matching IP if set\n\t\t\t\tif ($this->admin_list['IPADDRESS'][$i] != '')\n\t\t\t\t\tif (!$this->ip_match($player->ip, $this->admin_list['IPADDRESS'][$i])) {\n\t\t\t\t\t\ttrigger_error(\"Attempt to use Admin login '\" . $player->login . \"' from IP \" . $player->ip . \" !\", E_USER_WARNING);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\telse\n\t\t\treturn false;\n\t}", "public function testRequestItemsAvailable()\n {\n $response = $this->get('/api/items/available');\n\n $response->assertStatus(200);\n }", "public function getAllPlayers()\n {\n return $this->players;\n }" ]
[ "0.7050542", "0.70244765", "0.66317576", "0.6226063", "0.6121532", "0.5895996", "0.58871627", "0.5840594", "0.58177185", "0.57683074", "0.57214993", "0.5680952", "0.55915695", "0.555837", "0.554711", "0.55350536", "0.5531993", "0.5530284", "0.54585344", "0.54585344", "0.54506624", "0.5406106", "0.5383299", "0.53726035", "0.53723735", "0.5363639", "0.531584", "0.52825665", "0.5277841", "0.52618366", "0.52566683", "0.5248876", "0.52013004", "0.5192695", "0.51529545", "0.515042", "0.5140239", "0.5133998", "0.5128375", "0.5114988", "0.51149493", "0.51048636", "0.50975984", "0.50785244", "0.5057327", "0.50532657", "0.5052286", "0.50508815", "0.5043968", "0.50412494", "0.50382376", "0.5033891", "0.5029162", "0.5015765", "0.50155866", "0.5005945", "0.5003169", "0.49956954", "0.4990394", "0.49833965", "0.49765378", "0.49685478", "0.4965938", "0.49614552", "0.4950146", "0.49477836", "0.49436584", "0.4938447", "0.4936714", "0.49289396", "0.4927094", "0.49245536", "0.49241728", "0.49172863", "0.49054083", "0.49007013", "0.48995066", "0.48964173", "0.48960674", "0.48939463", "0.48930848", "0.4888824", "0.4878716", "0.4873992", "0.48621514", "0.48562926", "0.4855223", "0.48532173", "0.48467878", "0.48448455", "0.48359334", "0.4835287", "0.48302528", "0.4830047", "0.4829968", "0.4829859", "0.4824878", "0.4824007", "0.48182154", "0.48165786" ]
0.7006917
2
Verifies the disconnected player list can properly be retrieved.
public function test_list_disconnected_players() { $playerList = $this->postScriptumServer->listDisconnectedPlayers(); $this->assertCount(3, $playerList); foreach ($playerList as $player) { if ($player->getId() === 88) { $this->assertSame(195, $player->getDisconnectedSince()); } else if ($player->getId() === 84) { $this->assertSame(108, $player->getDisconnectedSince()); } else if ($player->getId() === 42) { $this->assertSame(3, $player->getDisconnectedSince()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(0, $playerList);\n }", "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(3, $playerList);\n\n foreach ($playerList as $player) {\n if ($player->getId() === 88) {\n $this->assertSame(195, $player->getDisconnectedSince());\n } else if ($player->getId() === 84) {\n $this->assertSame(108, $player->getDisconnectedSince());\n } else if ($player->getId() === 42) {\n $this->assertSame(3, $player->getDisconnectedSince());\n }\n }\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }", "private function checkOnlineList()\n {\n $this->online->checkOnlineList($this->loginTime);\n }", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function ListValidatePlayer()\n {\n $users = User::where([\n ['isEnabled', 0],\n ['isDelete', 0]\n ])\n ->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function playersThatArePlayingLogins() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$specLogins = array();\n\t\tforeach ($spectators as $spec) {\n\t\t\t$specLogins[] = trim($spec->login);\n\t\t}\n\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\t\t$allPlayersLogins = array();\n\t\tforeach ($allPlayers as $pl) {\n\t\t\t$allPlayersLogins[] = trim($pl->login);\n\t\t}\n\n\t\treturn array_diff($allPlayersLogins, $specLogins);\n\t}", "public function test_connection() {\n\t\treturn is_array( $this->_get_lists() );\n\t}", "public function test_connection() {\n\t\t/**\n\t\t * just try getting a list as a connection test\n\t\t */\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_Mailchimp $mc */\n\t\t\t$mc = $this->get_api();\n\n\t\t\t$mc->request( 'lists' );\n\t\t} catch ( Thrive_Dash_Api_Mailchimp_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function listDisconnectedPlayers() : string\n {\n return $this->sourceQuery->Rcon('AdminListDisconnectedPlayers');\n }", "function get_playlists_no_more_cb26()\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$result = $db->select(tbl($this->playlist_tbl),\"*\",\" playlist_type='\".$this->type.\"' AND userid='\".userid().\"'\");\r\n\t\t\r\n\t\tif(count($result)>0)\r\n\t\t\treturn $result;\r\n\t\treturn false;\r\n\t}", "public function invalidPlayersProvider()\n {\n return [\n [[]], // no players\n [['Alice']], // too few players\n [['Alice', 'Bob', 'Carol', 'Eve', 'One too many']] // too many players\n ];\n }", "public function valid()\n {\n return isset($this->channels[$this->key()]);\n }", "public static function prune_playlists() { \n\n\t\t/* Just delete if no matching session row */\n\t\t$sql = \"DELETE FROM `tmp_playlist` USING `tmp_playlist` \" . \n\t\t\t\"LEFT JOIN session ON session.id=tmp_playlist.session \" . \n\t\t\t\"WHERE session.id IS NULL AND tmp_playlist.type != 'vote'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\treturn true;\n\n\t}", "function ticketbud_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $ticketbud_unused_api_key;\n\tif ( $ticketbud_unused_api_key )\n\t\treturn true;\n\t$servers = ticketbud_get_server_connectivity();\n\treturn !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}", "public function checkOutsideConnection()\n {\n // Require only on this function to not overload memory with not needed classes\n require_once _PS_MODULE_DIR_ . 'doofinder/lib/EasyREST.php';\n $client = new EasyREST(true, 3);\n $result = $client->get(sprintf('%s/auth/login', self::DOOMANAGER_URL));\n\n return $result && $result->originalResponse && isset($result->headers['code'])\n && (strpos($result->originalResponse, 'HTTP/2 200') || $result->headers['code'] == 200);\n }", "public function checkIsModelListCorrupted()\n {\n try {\n $this->helperService->getAllModels();\n }\n catch(Exception $e) {\n return true;\n }\n return false;\n }", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function test_showAddToWishList_AddToWishListIsNotAvailable_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(false);\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertFalse($actual);\r\n\t}", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "private function _checkExist()\n {\n $ret = ['valid' => true, 'message' => []];\n\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $eitherOptions = ['username', 'email'];\n\n $choseOptions = array_intersect($eitherOptions, array_keys($this->data));\n\n foreach ($choseOptions as $option) {\n if ($option == 'username') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `username` = :username\";\n } elseif ($option == 'email') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `email` = :email\";\n }\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute([$option => $this->data[$option]]);\n\n if ($stmt->fetchColumn() != 0) {\n $ret['valid'] = false;\n $ret['message'][] = $option . '{' . $this->data[$option] . '} has been occupied, please try again.';\n }\n }\n\n\n return $ret;\n }", "protected function disconnectIfConnected() {}", "public function checkChanges()\n {\n //loop through all connected sockets\n foreach ($this->changed as $changed_socket) {\n //check for any incomming data\n while (socket_recv($changed_socket, $buf, 1024, 0) >= 1) {\n $received_text = $this->unmask($buf); //unmask data\n $this->processCommunication($changed_socket, $received_text);\n break 2; //exits this loop\n }\n\n $buf = @socket_read($changed_socket, 1024, PHP_NORMAL_READ);\n if ($buf === false) { // check disconnected client\n foreach ($this->clients as $clientId => $sockets) {\n if (!in_array($changed_socket, $sockets)) {\n continue;\n }\n\n foreach ($sockets as $key => $socket) {\n if ($socket == $changed_socket) {\n // remove client for $clients array\n socket_getpeername($changed_socket, $ip);\n unset($this->clients[$clientId][$key]);\n break 2;\n }\n }\n }\n }\n }\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function hasDlcsList()\n {\n return $this->dlcs !== null;\n }", "public function removeSpectatorsAndNotConnectedPlayers() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$playersThatArePlaying = $this->playersThatArePlayingLogins();\n\n\t\t/*\n\t\t * Setting every player to spectator and then just iterating over\n\t\t * players that are currently playing and setting correct flag!\n\t\t * */\n\t\tforeach ($this->matchScore->blueTeamPlayers as $player) {\n\t\t\t$player->isSpectator = true;\n\t\t}\n\t\tforeach ($this->matchScore->redTeamPlayers as $player) {\n\t\t\t$player->isSpectator = true;\n\t\t}\n\n\t\tforeach ($playersThatArePlaying as $player) {\n\t\t\tif (array_key_exists($player, $this->matchScore->blueTeamPlayers)) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$player]->isSpectator = false;\n\t\t\t}\n\t\t\tif (array_key_exists($player, $this->matchScore->redTeamPlayers)) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$player]->isSpectator = false;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($spectators as $spectator) {\n\t\t\t$login = trim($spectator->login);\n\n\t\t\tif (array_key_exists($login, $this->matchScore->blueTeamPlayers)) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login]->isSpectator = true;\n\t\t\t}\n\t\t\tif (array_key_exists($login, $this->matchScore->redTeamPlayers)) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$login]->isSpectator = true;\n\t\t\t}\n\t\t}\n\t}", "public function disconnect() : bool\n {\n return false;\n }", "public function missing_cd_metadata() {\n\n\t\t\t$dvd_id = abs(intval($this->id));\n\n\t\t\t$sql = \"SELECT COUNT(1) FROM tracks WHERE dvd_id = $dvd_id;\";\n\t\t\t$var = $this->get_one($sql);\n\t\t\tif(!$var)\n\t\t\t\treturn true;\n\n\t\t\t$sql = \"SELECT COUNT(1) FROM tracks WHERE dvd_id = $dvd_id AND length IS NULL;\";\n\t\t\t$var = $this->get_one($sql);\n\t\t\tif($var)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\n\t\t}", "public function testShowListNotFoundException(): void\n {\n $this->get('/mailchimp/lists/invalid-list-id');\n\n $this->assertListNotFoundResponse('invalid-list-id');\n }", "public function notAuthenticated() {\n $objUser = App_Factory_Security::getSecurity()->getObjuser();\n\n if(!($objUser instanceof App_Data_User)) {\n return true;\n }\n \n if($objUser->getUID() !== $this->getlngPlayer1() && $objUser->getUID() !== $this->getlngPlayer2()) {\n return true;\n }\n\n return false;\n }", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "static function verify()\n {\n global $pommo;\n $dbo = & Pommo::$_dbo;\n if (is_object($dbo))\n {\n $query = \"SHOW TABLES LIKE '%s'\";\n $query = $dbo->prepare($query, array($dbo->_prefix.'%'));\n if ($dbo->records($query) > 10)\n return true;\n }\n return false;\n }", "public function hasPacketsList()\n {\n return $this->packets !== null;\n }", "public function isPlayer()\r\n\t{\r\n\t\t\treturn count($this->getPlayerProfiles()) > 0;\r\n\t}", "function playerDisconnect($player) {\n\n\t\t// check for relay server\n\t\tif (!$this->server->isrelay && array_key_exists($player[0], $this->server->relayslist)) {\n\t\t\t// log console message\n\t\t\t$this->console('>>> relay server {1} ({2}) disconnected', $player[0],\n\t\t\t stripColors($this->server->relayslist[$player[0]]['NickName'], false));\n\n\t\t\tunset($this->server->relayslist[$player[0]]);\n\t\t\treturn;\n\t\t}\n\n\t\t// delete player and put him into the player item\n\t\t// ignore event if disconnect fluke after player already left,\n\t\t// or on relay if player from master server (which wasn't added)\n\t\tif (!$player_item = $this->server->players->removePlayer($player[0]))\n\t\t\treturn;\n\n\t\t// log console message\n\t\t$this->console('>> player {1} left the game [{2} : {3} : {4}]',\n\t\t $player_item->pid,\n\t\t $player_item->login,\n\t\t $player_item->nickname,\n\t\t formatTimeH($player_item->getTimeOnline() * 1000, false));\n\n\t\t// throw 'player disconnects' event\n\t\t$this->releaseEvent('onPlayerDisconnect', $player_item);\n\t}", "public function testRetrieveListUnsuccessfulReason()\n {\n }", "public function isDeletable() {\n\t\t$sql = \"SELECT COUNT(*) AS members FROM wcf\".WCF_N.\"_user_to_group_premium WHERE premiumGroupID = ?\"; \n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array($this->premiumGroupID));\n\t\t$row = $statement->fetchArray();\n\t\t\n\t\treturn ($row['members'] > 0) ? false : true; \n\t}", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function checkInServerList()\n {\n $serverList = preg_split('/\\r\\n|[\\r\\n]/', ConfPPM::getConf('server_list'));\n $myIP = array();\n $myIP[] = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['GEOIP_ADDR']) ? $_SERVER['GEOIP_ADDR'] : '127.0.0.1';\n if (empty(array_intersect($serverList, $myIP))) {\n return false;\n } else {\n return true;\n }\n }", "protected function isConnectSuccessful() {}", "abstract public function _get_connected();", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "private function isNotCommon(): bool\n {\n $query = $this->databaseConnection->prepare(\"SELECT count(id) FROM blacklistedPasswords WHERE password = :passwordString\");\n $query->bindValue(':passwordString', $this->password);\n $query->execute();\n $count = $query->fetchColumn();\n if ($count == 0) {\n return true;\n }\n array_push($this->errorMessages, \"Not a valid password.\");\n return false;\n }", "public function test_showAddToWishList_IsAvailableCannotCheckedOutCannotPlaceHolds_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(true);\r\n\t\t$this->prepareisCheckOutAvailable(false);\r\n\t\t$this->prepareIsPlaceHoldAvailable(false);\r\n\t\t\t\t\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertTrue($actual);\r\n\t}", "function etherpadlite_get_participants($etherpadliteid) {\n return false;\n}", "protected function _check_videos_transient() {\n\n\t\t$video_urls_transient = get_transient( $this->_ttw_api_url_transient );\n\n\t\tif ( ! $video_urls_transient ) {\n\t\t\t$this->_build_videos_transient();\n\t\t}\n\t}", "protected function assertNoSynDifferences() {\n $sync = $this->container->get('config.storage.sync');\n $active = $this->container->get('config.storage');\n // Ensure that we have no configuration changes to import.\n $storage_comparer = new StorageComparer(\n $sync,\n $active,\n $this->container->get('config.manager')\n );\n $changelist = $storage_comparer->createChangelist()->getChangelist();\n // system.mail is changed by \\Drupal\\simpletest\\InstallerTestBase::setUp()\n // this is a good idea because it prevents tests emailling.\n $key = array_search('system.mail', $changelist['update'], TRUE);\n if ($key !== FALSE) {\n unset($changelist['update'][$key]);\n }\n $return = $this->assertIdentical($changelist, $storage_comparer->getEmptyChangelist());\n // Output proper diffs.\n $controller = ConfigController::create($this->container);\n foreach ($changelist['update'] as $config_name) {\n $diff = $controller->diff($config_name);\n $this->verbose(\\Drupal::service('renderer')->renderPlain($diff));\n }\n return $return;\n }", "protected function validate()\r\n {\r\n return ( is_array( $this->bot ) && !empty( $this->channel ) );\r\n }", "public function all_user_connected() {\n try\n {\n $max_last_ping = time() - 31;\n $stmt = $this->db->prepare(\"SELECT * FROM connected_user WHERE last_ping > :last_ping\");\n $stmt->execute(array(\n 'last_ping' => $max_last_ping\n ));\n\n while($result = $stmt->fetch()) {\n $listid[] = $result['id_user'];\n }\n \n return $listid;\n }\n catch(PDOException $e) {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "protected function checkDownloadsPossible() {}", "public function privacyTest()\n {\n $this->prepareTestDB();\n \n $user_a = UNL_MediaHub_User::getByUid('test_a');\n $user_b = UNL_MediaHub_User::getByUid('test_b');\n \n //Logged out - most recent\n $list = new UNL_MediaHub_MediaList();\n $list->run();\n \n foreach ($list->items as $media) {\n $this->assertEquals('PUBLIC', $media->privacy, 'recent media for logged out users should be public');\n }\n\n //Logged in (user A) - most recent\n UNL_MediaHub_AuthService::getInstance()->setUser($user_a);\n \n //check with a caption requirement date set\n $original_requirement_date = UNL_MediaHub_Controller::$caption_requirement_date;\n UNL_MediaHub_Controller::$caption_requirement_date = '2015-09-24';\n \n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n 1, //media_a because it is new and missing a text track, but user is part of its feed\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n 4, //media_d because it is public (and old, missing text track)\n 5, //media_e because it is public (and old, missing text track)\n //NOT media_f because it is private\n //NOT media_g because it is unlisted\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n //Logged in (user B) - most recent\n UNL_MediaHub_AuthService::getInstance()->setUser($user_b);\n\n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n //NOT media_a because it is new and missing a text track\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n //4, //NOT media_d because it is private (and user is not a member of its feed)\n //5, //NOT media_e because it is unlisted (and user is not a member of its feed)\n 6, //media_f because it is private (because user_b in feed_b, which media_f is in)\n 7, //media_g because it is unlisted (because user_b in feed_b, which media_g is in)\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n //now check with a caption requirement date NOT set\n UNL_MediaHub_Controller::$caption_requirement_date = false;\n \n $list = new UNL_MediaHub_MediaList();\n $list->run();\n $expected_ids = array(\n 1, //media_a because it is new and missing a text track, but the caption requirement date is set to false\n 2, //media_b because it is public (new and has text track)\n 3, //media_c because it is public (and old, missing text track)\n //4, //NOT media_d because it is private (and user is not a member of its feed)\n //5, //NOT media_e because it is unlisted (and user is not a member of its feed)\n 6, //media_f because it is private (because user_b in feed_b, which media_f is in)\n 7, //media_g because it is unlisted (because user_b in feed_b, which media_g is in)\n );\n $found_ids = $this->getListIds($list);\n sort($found_ids);\n $this->assertEquals($expected_ids, $found_ids, 'users with access to media should see private and unlisted media');\n\n UNL_MediaHub_Controller::$caption_requirement_date = $original_requirement_date;\n }", "public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "public function isDeclined(): bool;", "public function isValid () {\n\tif ($this->doConnect()) return true;\n\treturn false;\n }", "function checks() {\n\t// Check login\n\tif (isset($_COOKIE['id']) AND isset($_COOKIE['authkey'])) {\n\t\t$pdo=new PDO('mysql:host=gtogame.db.9808275.hostedresource.com;dbname=gtogame', 'gtogame', 'D7Awthkp2946!');\n\t\t$stmt=$pdo->prepare('SELECT banned, banreason, dead, health, sessauth FROM Players WHERE id = :id LIMIT 1');\n\t\t$stmt->bindParam(':id', $_COOKIE['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\t// Verify player logged in legitimately\n\t\tif ($row['sessauth'] != $_COOKIE['authkey']) {\n\t\t\tsetcookie ('id', '0', time()-300, '/', '', 0);\n\t\t\tsetcookie ('authkey', '0', time()-300, '/', '', 0);\n\t\t\theader(\"Location: index.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check health\n\t\tif ($row['health'] == 0 OR $row['dead'] > 0) {\n\t\t\theader(\"Location: dead.php\");\n\t\t\texit();\n\t\t}\n\t\t// Check ban status\n\t\tif($row['banned'] == 1) {\n\t\t\techo \"<h1>You have been banned!</h1>If you have any questions, please contact a staff member.<br><br><strong>Reason:</strong> \".$row['banreason'];\n\t\t\texit();\t \n\t\t}\n\t} else {\n\t\theader(\"Location: index.php\");\n\t\texit();\n\t}\n}", "public function is_connected()\n {\n $result = @$this->mcache->getExtendedStats();\n $canconnect = false;\n\n if($result) {\n foreach($result as $server => $stats) {\n if($stats) {\n $canconnect = true;\n break;\n }\n }\n }\n \n return $canconnect;\n }", "function isLost(){\n\tglobal $userid;\n\tif(!isConnected() && !isVisitor()) return true;\n\n\treturn false;\n}", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function check_shutdown() {\r\n\t\t$pending_queries = QueryManager::$pending_queries;\r\n\t\t$shutdown_duration = $this->get_shutdown_duration();\r\n\t\t$live_sockets = 0;\r\n\t\t\r\n\t\tforeach ($this->socket_array as $socket) {\r\n\t\t\tif(!$socket->live_past_shutdown) {\r\n\t\t\t\t$live_sockets++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tif($live_sockets == 0 || $shutdown_duration > 60) {\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function assertListCorrect()\n {\n $records = Item::find()\n ->orderBy(['position' => SORT_ASC])\n ->all();\n\n foreach ($records as $recordNumber => $record) {\n $this->assertEquals($record->position, $recordNumber + 1, 'List positions have been broken!');\n }\n }", "private function failedAuthentication(Player $player)\n {\n $counter = $player->getFailedLoginAttempts();\n $player->setFailedLoginAttempts(++$counter);\n $limit = $this->messages->get('app.acc.attempts');\n /**\n * If counter's value equals (or exceeds) number 3 –\n * ban player and send him message by email and/or browser,\n * that he has just been banned.\n * \n * Exceeding number 3 is possible,\n * if counting procedure failed previous time(s). \n * Adding \"greater than\" character to comparision operator prevents\n * further mistakes by adding this possibility to blocking procedure.\n */\n if ($counter >= $limit) {\n /**\n * Ban player\n */\n $player->setEnabled(false);\n $player->setBlockedToken(Uuid::uuid4()->toString());\n /**\n * Send email with link to unblock account.\n * If message delivering fails, prepare message to player,\n * that he should send email to administrator about disabling,\n * if he want to enable account.\n * Else prepare message to player, that his account is disabled\n */\n $email = $player->getEmail();\n $title = $this->messages->get('app.acc.banned.msg.title');\n $part = $this->messages->get('app.acc.banned.msg');\n $url = $this->router->generate(\n 'enable',\n ['blocked_token' => $player->getBlockedToken()],\n UrlGeneratorInterface::ABSOLUTE_URL\n );\n $content = $part.$url;\n $name = $this->emailer->sendEmail($email, $title, $content) ?\n 'app.acc.banned.email' : 'app.mail.fail';\n $this->flasher->add($name);\n }\n /**\n * Change entry updating date\n */\n $player->setEntryUpdatingDate(new \\DateTime());\n $this->entityManager->persist($player);\n $this->entityManager->flush();\n }", "public function canpoweroff()\n\t{\n\t\treturn $this->Players->canpoweroff($this->SqueezePlyrID);\n\t}", "public function panelist_dwid_availability() {\n\t\t$partner_users = $this->PartnerUser->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'PartnerUser.partner' => 'mbd',\n\t\t\t\t'PartnerUser.created >=' => date(DB_DATETIME, strtotime('-14 days'))\n\t\t\t)\n\t\t));\n\t\t\n\t\t$missing_dwids = $missing_from_stales = array();\n\t\t$this->out('Analyzing '.count($partner_users).' exported panelists to MBD');\n\t\tforeach ($partner_users as $partner_user) {\n\t\t\t$user_id = $partner_user['PartnerUser']['user_id'];\n\t\t\tif (empty($partner_user['PartnerUser']['uid'])) {\n\t\t\t\t$missing_dwids[] = $user_id;\n\n\t\t\t\t// confirm they are missing from stale\n\t\t\t\t$count = $this->MbdStale->find('count', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'MbdStale.user_id' => $partner_user['PartnerUser']['user_id']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\tif ($count == 0) {\n\t\t\t\t\t$missing_from_stales[] = $user_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$missing_dwid_pct = round(count($missing_dwids) / count($partner_users) * 100, 2); \n\t\t$missing_stale_pct = round(count($missing_from_stales) / count($partner_users) * 100, 2); \n\t\t$diff = array_diff($missing_dwids, $missing_from_stales);\n\t\t\n\t\t$this->out(count($missing_dwids).' missing DWIDs ('.$missing_dwid_pct.'%)');\n\t\t$this->out(count($missing_from_stales).' missing from stales ('.$missing_stale_pct.'%)');\n\t}", "private function check_for_excessive_dropped_users() {\n $is_validated = true;\n $invalid_courses = array(); // intentional local array\n $ratio = 0;\n $diff = 0;\n foreach($this->data as $course => $rows) {\n if (!validate::check_for_excessive_dropped_users($rows, $this->semester, $course, $diff, $ratio)) {\n $invalid_courses[] = array('course' => $course, 'diff' => $diff, 'ratio' => round(abs($ratio), 3));\n $is_validated = false;\n }\n }\n\n if (!empty($invalid_courses)) {\n usort($invalid_courses, function($a, $b) { return $a['course'] <=> $b['course']; });\n $msg = \"The following course(s) have an excessive ratio of dropped students.\\n Stats show mapped courses combined in base courses.\\n\";\n array_unshift($invalid_courses, array('course' => \"COURSE\", 'diff' => \"DIFF\", 'ratio' => \"RATIO\")); // Header\n foreach ($invalid_courses as $invalid_course) {\n $msg .= \" \" .\n str_pad($invalid_course['course'], 18, \" \", STR_PAD_RIGHT) .\n str_pad($invalid_course['diff'], 6, \" \", STR_PAD_LEFT) .\n str_pad($invalid_course['ratio'], 8, \" \", STR_PAD_LEFT) .\n PHP_EOL;\n }\n $msg .= \" No upsert performed on any/all courses in Submitty due to suspicious data sheet.\";\n\n $this->log_it($msg);\n return false;\n }\n\n return true;\n }", "function playerDisconnect($player) {\n\n\t\t// delete player and put him into the player item ...\n\t\t$player_item = new Player();\n\t\t$player_item = $this->server->players->removePlayer($player[0]);\n\n\t\t// display message ...\n\t\t$this->console('>> player {1} left the game [{2}]',\n\t\t$player_item->id,\n\t\t$player_item->login);\n\n\t\t// release a new player disconnect event ...\n\t\t$this->releaseEvent('onPlayerDisconnect', $player_item);\n\t}", "public function playersThatArePlaying() {\n\t\t$playersThatArePlayingLogins = $this->playersThatArePlayingLogins();\n\t\t$playersThatArePlaying = array();\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\n\t\tforeach ($allPlayers as $player) {\n\t\t\tif (in_array($player->login, $playersThatArePlayingLogins)) {\n\t\t\t\t$playersThatArePlaying[] = $player;\n\t\t\t}\n\t\t}\n\n\t\treturn $playersThatArePlaying;\n\t}", "public function isExtListUpdateNecessary() {}", "public function valid()\n {\n if ($this->list === null)\n $this->rewind(); // loads from the table\n if ($this->list === null)\n return false;\n $key = key($this->list);\n $valid = ($key !== NULL && $key !== FALSE);\n return $valid;\n }", "public function checkVideos() : boolean {\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildPostUrl());\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t\t$fixed = json_decode($result);\n\t\t$videos = $fixed->data;\n\t\techo '<pre>';\n\t\tvar_dump($videos);\n\t\tdie();\n\t\treturn $videos;\n\t}", "public function isValid()\n\t{\n\t \treturn $this->_redis !== null;\n\t}", "public function canBeRemoved() {}", "public function testRemoveMemberFromListSuccessfully(): void\n {\n // create list\n $this->createListMemberViaApi(MailChimpData::$listData);\n\n // create list member\n $this->post(\"/mailchimp/lists/{$this->listId}/members/\", MailChimpData::$listMemberData);\n $listMember = \\json_decode($this->response->content(), true);\n\n // remove member from list\n $this->delete(\\sprintf('/mailchimp/lists/%s/members/%s', $this->listId, $listMember['list_member_id']));\n\n $this->assertResponseOk();\n self::assertEmpty(\\json_decode($this->response->content(), true));\n }", "public function testRemoveListSuccessfully(): void\n {\n $this->createMailchimpList($list);\n\n $this->delete(\\sprintf('/mailchimp/lists/%s', $list['list_id']));\n\n $this->assertResponseOk();\n self::assertEmpty(\\json_decode($this->response->content(), true));\n }", "public function hasLobby()\n {\n return $this->lobbies()->exists();\n }", "public function valid() {\n return $this->pointer < count($this->items);\n }", "public abstract function hasWaitingLobby(): bool;", "private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }", "public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function hasTimeoutList()\n {\n return $this->get(self::TIMEOUTLIST) !== null;\n }", "public function panelist_uninvited() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\t$results = $http->get($this->settings['hostname.mbd'].'/ignite/getinvites?X-ApiKey='.$this->settings['mbd.api_key'], $this->options);\t\t\n\t\t$results = json_decode($results, true);\n\t\t\n\t\t$mbd_panelist_ids = array_unique(Set::extract('/panelistId', $results)); \n\t\t\n\t\t$this->PartnerUser->bindModel(array('belongsTo' => array('User')));\n\t\t$partner_users = $this->PartnerUser->find('all', array(\n\t\t\t'fields' => array('User.id'),\n\t\t\t'conditions' => array(\n\t\t\t\t'PartnerUser.partner' => 'mbd',\n\t\t\t\t'PartnerUser.uid is not null',\n\t\t\t\t'User.last_touched >=' => date(DB_DATETIME, strtotime('-48 hours'))\n\t\t\t)\n\t\t));\n\t\t\n\t\t$active_panelists = Set::extract('/User/id', $partner_users); \n\t\t\n\t\t$this->out('Found '.count($mbd_panelist_ids).' MBD invites');\n\t\t$this->out('Found '.count($active_panelists).' active MV panelists');\n\t\t$diff = array_diff($active_panelists, $mbd_panelist_ids); \n\t\t$this->out('Found '.count($diff).' panelists that were not invited to MBD');\n\t}", "public function isOnline() {}", "public function testCanListWalletAddresses()\n {\n $result = Wallet::list(Wallet::BITCOIN);\n $this->assertInternalType('array', $result);\n\n $result = Wallet::list();\n $this->assertInternalType('array', $result);\n }", "private function _inBlacklist()\n\t {\n\t\t$result = $this->_db->exec(\"SELECT COUNT(`phone`) as count FROM `blacklist` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\t$row = $result->getRow();\n\t\t$count = $row['count'];\n\n\t\tif($count > 0)\n\t\t {\n\t\t\treturn true;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn false;\n\t\t } //end if\n\n\t }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['nickname'] === null) {\n $invalidProperties[] = \"'nickname' can't be null\";\n }\n if ((mb_strlen($this->container['nickname']) < 1)) {\n $invalidProperties[] = \"invalid value for 'nickname', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['username'] === null) {\n $invalidProperties[] = \"'username' can't be null\";\n }\n if ((mb_strlen($this->container['username']) < 1)) {\n $invalidProperties[] = \"invalid value for 'username', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['password'] === null) {\n $invalidProperties[] = \"'password' can't be null\";\n }\n if ((mb_strlen($this->container['password']) < 1)) {\n $invalidProperties[] = \"invalid value for 'password', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['merchant_seller_id'] === null) {\n $invalidProperties[] = \"'merchant_seller_id' can't be null\";\n }\n if ((mb_strlen($this->container['merchant_seller_id']) < 1)) {\n $invalidProperties[] = \"invalid value for 'merchant_seller_id', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['mws_auth_token'] === null) {\n $invalidProperties[] = \"'mws_auth_token' can't be null\";\n }\n if ((mb_strlen($this->container['mws_auth_token']) < 1)) {\n $invalidProperties[] = \"invalid value for 'mws_auth_token', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['email'] === null) {\n $invalidProperties[] = \"'email' can't be null\";\n }\n if ($this->container['auth_code'] === null) {\n $invalidProperties[] = \"'auth_code' can't be null\";\n }\n if ((mb_strlen($this->container['auth_code']) < 1)) {\n $invalidProperties[] = \"invalid value for 'auth_code', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['account_number'] === null) {\n $invalidProperties[] = \"'account_number' can't be null\";\n }\n if ((mb_strlen($this->container['account_number']) < 1)) {\n $invalidProperties[] = \"invalid value for 'account_number', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['ftp_username'] === null) {\n $invalidProperties[] = \"'ftp_username' can't be null\";\n }\n if ((mb_strlen($this->container['ftp_username']) < 1)) {\n $invalidProperties[] = \"invalid value for 'ftp_username', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['ftp_password'] === null) {\n $invalidProperties[] = \"'ftp_password' can't be null\";\n }\n if ((mb_strlen($this->container['ftp_password']) < 1)) {\n $invalidProperties[] = \"invalid value for 'ftp_password', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['api_key'] === null) {\n $invalidProperties[] = \"'api_key' can't be null\";\n }\n if ((mb_strlen($this->container['api_key']) < 1)) {\n $invalidProperties[] = \"invalid value for 'api_key', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['api_secret'] === null) {\n $invalidProperties[] = \"'api_secret' can't be null\";\n }\n if ((mb_strlen($this->container['api_secret']) < 1)) {\n $invalidProperties[] = \"invalid value for 'api_secret', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['contract_id'] === null) {\n $invalidProperties[] = \"'contract_id' can't be null\";\n }\n if ((mb_strlen($this->container['contract_id']) < 1)) {\n $invalidProperties[] = \"invalid value for 'contract_id', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['client_id'] === null) {\n $invalidProperties[] = \"'client_id' can't be null\";\n }\n if ((mb_strlen($this->container['client_id']) < 1)) {\n $invalidProperties[] = \"invalid value for 'client_id', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['pickup_number'] === null) {\n $invalidProperties[] = \"'pickup_number' can't be null\";\n }\n if ((mb_strlen($this->container['pickup_number']) < 1)) {\n $invalidProperties[] = \"invalid value for 'pickup_number', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['distribution_center'] === null) {\n $invalidProperties[] = \"'distribution_center' can't be null\";\n }\n if ((mb_strlen($this->container['distribution_center']) < 1)) {\n $invalidProperties[] = \"invalid value for 'distribution_center', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['site_id'] === null) {\n $invalidProperties[] = \"'site_id' can't be null\";\n }\n if ($this->container['account'] === null) {\n $invalidProperties[] = \"'account' can't be null\";\n }\n if ((mb_strlen($this->container['account']) < 1)) {\n $invalidProperties[] = \"invalid value for 'account', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['passphrase'] === null) {\n $invalidProperties[] = \"'passphrase' can't be null\";\n }\n if ((mb_strlen($this->container['passphrase']) < 1)) {\n $invalidProperties[] = \"invalid value for 'passphrase', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['address1'] === null) {\n $invalidProperties[] = \"'address1' can't be null\";\n }\n if ((mb_strlen($this->container['address1']) < 1)) {\n $invalidProperties[] = \"invalid value for 'address1', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['city'] === null) {\n $invalidProperties[] = \"'city' can't be null\";\n }\n if ((mb_strlen($this->container['city']) < 1)) {\n $invalidProperties[] = \"invalid value for 'city', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['company'] === null) {\n $invalidProperties[] = \"'company' can't be null\";\n }\n if ((mb_strlen($this->container['company']) < 1)) {\n $invalidProperties[] = \"invalid value for 'company', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['country_code'] === null) {\n $invalidProperties[] = \"'country_code' can't be null\";\n }\n if ((mb_strlen($this->container['country_code']) < 1)) {\n $invalidProperties[] = \"invalid value for 'country_code', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['first_name'] === null) {\n $invalidProperties[] = \"'first_name' can't be null\";\n }\n if ((mb_strlen($this->container['first_name']) < 1)) {\n $invalidProperties[] = \"invalid value for 'first_name', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['last_name'] === null) {\n $invalidProperties[] = \"'last_name' can't be null\";\n }\n if ((mb_strlen($this->container['last_name']) < 1)) {\n $invalidProperties[] = \"invalid value for 'last_name', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['phone'] === null) {\n $invalidProperties[] = \"'phone' can't be null\";\n }\n if ((mb_strlen($this->container['phone']) < 1)) {\n $invalidProperties[] = \"invalid value for 'phone', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['postal_code'] === null) {\n $invalidProperties[] = \"'postal_code' can't be null\";\n }\n if ((mb_strlen($this->container['postal_code']) < 1)) {\n $invalidProperties[] = \"invalid value for 'postal_code', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['state'] === null) {\n $invalidProperties[] = \"'state' can't be null\";\n }\n if ((mb_strlen($this->container['state']) < 1)) {\n $invalidProperties[] = \"invalid value for 'state', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['agree_to_eula'] === null) {\n $invalidProperties[] = \"'agree_to_eula' can't be null\";\n }\n if ($this->container['mailer_id'] === null) {\n $invalidProperties[] = \"'mailer_id' can't be null\";\n }\n if (($this->container['mailer_id'] < 0)) {\n $invalidProperties[] = \"invalid value for 'mailer_id', must be bigger than or equal to 0.\";\n }\n\n if ($this->container['induction_site'] === null) {\n $invalidProperties[] = \"'induction_site' can't be null\";\n }\n if ((mb_strlen($this->container['induction_site']) < 1)) {\n $invalidProperties[] = \"invalid value for 'induction_site', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['activation_key'] === null) {\n $invalidProperties[] = \"'activation_key' can't be null\";\n }\n if ((mb_strlen($this->container['activation_key']) < 1)) {\n $invalidProperties[] = \"invalid value for 'activation_key', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['contact_name'] === null) {\n $invalidProperties[] = \"'contact_name' can't be null\";\n }\n if ((mb_strlen($this->container['contact_name']) < 1)) {\n $invalidProperties[] = \"invalid value for 'contact_name', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['access_key'] === null) {\n $invalidProperties[] = \"'access_key' can't be null\";\n }\n if ((mb_strlen($this->container['access_key']) < 1)) {\n $invalidProperties[] = \"invalid value for 'access_key', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['sendle_id'] === null) {\n $invalidProperties[] = \"'sendle_id' can't be null\";\n }\n if ($this->container['account_country_code'] === null) {\n $invalidProperties[] = \"'account_country_code' can't be null\";\n }\n if ((mb_strlen($this->container['account_country_code']) < 1)) {\n $invalidProperties[] = \"invalid value for 'account_country_code', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['account_postal_code'] === null) {\n $invalidProperties[] = \"'account_postal_code' can't be null\";\n }\n if ((mb_strlen($this->container['account_postal_code']) < 1)) {\n $invalidProperties[] = \"invalid value for 'account_postal_code', the character length must be bigger than or equal to 1.\";\n }\n\n if ($this->container['agree_to_technology_agreement'] === null) {\n $invalidProperties[] = \"'agree_to_technology_agreement' can't be null\";\n }\n if (!is_null($this->container['address2']) && (mb_strlen($this->container['address2']) < 1)) {\n $invalidProperties[] = \"invalid value for 'address2', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['meter_number']) && (mb_strlen($this->container['meter_number']) < 1)) {\n $invalidProperties[] = \"invalid value for 'meter_number', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['profile_name']) && (mb_strlen($this->container['profile_name']) < 1)) {\n $invalidProperties[] = \"invalid value for 'profile_name', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['merchant_id']) && ($this->container['merchant_id'] < 0)) {\n $invalidProperties[] = \"invalid value for 'merchant_id', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['company_name']) && (mb_strlen($this->container['company_name']) < 1)) {\n $invalidProperties[] = \"invalid value for 'company_name', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['street_line1']) && (mb_strlen($this->container['street_line1']) < 1)) {\n $invalidProperties[] = \"invalid value for 'street_line1', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['street_line2']) && (mb_strlen($this->container['street_line2']) < 1)) {\n $invalidProperties[] = \"invalid value for 'street_line2', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['street_line3']) && (mb_strlen($this->container['street_line3']) < 1)) {\n $invalidProperties[] = \"invalid value for 'street_line3', the character length must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['title']) && (mb_strlen($this->container['title']) < 1)) {\n $invalidProperties[] = \"invalid value for 'title', the character length must be bigger than or equal to 1.\";\n }\n\n return $invalidProperties;\n }", "public function getPlayers();", "public function getPlayers();", "function get_removed_status() {\n\n\techo \"Verifying status ads (is removed or no) \\r\\n\";\n\t //check only ads, which have status publish\n\t$sql = \"SELECT count(id) cnt from cian_general_data where ad_remove is null\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$cnt = mysqli_fetch_assoc($result)['cnt'];\n\n\t$OFFSET = 0; $index = 1;\n\n\twhile ($OFFSET <= $cnt) {\n\t\t$sql = \"SELECT id from cian_general_data where ad_remove is null LIMIT 50 OFFSET {$OFFSET}\";\n\t\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\n\t\twhile ($array = mysqli_fetch_assoc($result)) {\n\t\t\t//sleep(1); //на всякий\n\t \n\t echo \"{$index} - checking remove status ad: {$array['id']} \\r\\n\";\n\n\t // if (info_ad($array['id'], $GLOBALS['endpoints']['page']) == null) {\n\t // \t//ads has been removed. change status\n\t // \techo \"found unactive ad: {$array['id']} \\r\\n\";\n\t // \t$sql = \"update cian_general_data set ad_remove=curdate() WHERE id={$array['id']}\";\n\t // \t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t // }\n\t // else {\n\t // \techo \"ad: {$array['id']} is active\\r\\n\";\n\t // }\n\n\t $index++;\n\n\n\t }\n\n\t $OFFSET += 50;\n\t}\n\t\t\n\n}", "public function testFetchList() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t\n\t\t// Fetch the list\n\t\t$listCopy = $jsonpad->fetchList($listData[\"name\"]);\n\t\t$this->assertSame($list->getName(), $listCopy->getName());\n\t\t\n\t\t// Delete the list\n\t\t$listCopy->delete();\n\t}", "public function testEmptyDomainList()\n {\n $domainSearcher = new DomainSearcher();\n $this->assertSame(0,count($domainSearcher->getDomainList()));\n $this->assertTrue(true);\n }", "function CheckDisponiblityGame($IdJoinGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT MaxPlayersGame, (SELECT COUNT(fkGamePlace) FROM fishermenland.place WHERE fkGamePlace = '$IdJoinGame') as UsedPlaces FROM fishermenland.game WHERE idGame = '$IdJoinGame'\");\n $reqArray = $req->fetch();\n\n return $reqArray;\n}", "public function isReadyPair() : bool;", "private function getFailedList()\n\t{\n\t\treturn $this->failed_list;\n\t}", "function cicleinscription_verify_username_blacklist($username){\n\tglobal $DB;\n\t\n\t$result = $DB->get_record('ci_blacklist', array('username'=>$username, 'statusblacklist' => 's'));\n\t\n\treturn $result ? $result : false;\n}" ]
[ "0.77570873", "0.76441556", "0.61054873", "0.6088999", "0.60659385", "0.60154957", "0.601074", "0.58628076", "0.58405006", "0.57007873", "0.5678933", "0.56211114", "0.54537207", "0.52979136", "0.52176505", "0.5153377", "0.5098705", "0.50837123", "0.5053778", "0.49932352", "0.49922234", "0.49891528", "0.49830925", "0.4975611", "0.49646503", "0.4963765", "0.49479437", "0.4933382", "0.49278748", "0.48859105", "0.48858282", "0.48777223", "0.4876576", "0.48750243", "0.48656014", "0.48652932", "0.48612553", "0.4846957", "0.48439223", "0.48429886", "0.48384082", "0.48282546", "0.48272884", "0.48266515", "0.481752", "0.48170093", "0.4799041", "0.4798625", "0.47911093", "0.4778704", "0.4778525", "0.47753134", "0.4772217", "0.4760022", "0.47589517", "0.4752823", "0.47494292", "0.47435024", "0.47433534", "0.4738633", "0.4736753", "0.47346854", "0.47252947", "0.4724032", "0.47238937", "0.47164184", "0.47113413", "0.4699396", "0.46960297", "0.46939924", "0.46918628", "0.4690232", "0.46876433", "0.46857256", "0.4680371", "0.46797746", "0.46777433", "0.4673064", "0.46697953", "0.4668053", "0.46680105", "0.46634775", "0.46578127", "0.46568134", "0.46554554", "0.46455202", "0.46409827", "0.46360436", "0.46320885", "0.46300098", "0.46243906", "0.46173254", "0.46173254", "0.46156746", "0.46156475", "0.46086016", "0.4605246", "0.4603862", "0.45980087", "0.4597181" ]
0.7647972
1
Verifies the broadcast command does work properly
public function test_admin_Broadcast() { $this->assertTrue($this->postScriptumServer->adminBroadcast('Hello World!')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBroadcasted();", "public function test_admin_Broadcast()\n {\n $this->assertTrue($this->btwServer->adminBroadcast('Hello World!'));\n }", "public function test_admin_Broadcast()\n {\n $this->assertTrue($this->btwServer->adminBroadcast('Hello World!'));\n }", "public function broadcastOn();", "public function broadcastOn();", "public function testPendingValidationNoMapping()\n {\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public function testIsValid()\n {\n $running = new RunningBroadcast(null, null, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, null, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(null, 2, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(null, 2, 3);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, 2, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, 2, 3);\n self::assertEquals($running->isValid(), true);\n }", "function broadcast(){\n return (long2ip(ip2long($this->network())\n | (~(ip2long($this->netmask())))));\n }", "public function broadcastWhen() {\n $return = false;\n $ids_to_broadcast = [$this->message->userId, $this->message->receiverUserId];\n if (in_array($this->message->userId, $ids_to_broadcast) || in_array($this->message->receiverUserId, $ids_to_broadcast)) $return = true;\n return $return;\n }", "public function hasServerTvBroadcastTime()\n {\n return $this->server_tv_broadcast_time !== null;\n }", "public function adminBroadcast(string $msg) : bool\n {\n return $this->_consoleCommand('AdminBroadcast', $msg, 'Message broadcasted');\n }", "function works() {\n\t$data = createMessagePayload('Flarum is able to contact this Telegram room. Great!');\n\n\ttry {\n\t\t$result = Request::sendMessage($data);\n\n\t\treturn $result->isOk();\n\t} catch (TelegramException $e) {\n\t\treturn false;\n\t}\n}", "public function broadcastOn()\n {\n return ['scammer'];\n }", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "public function broadcastMessage($message)\n {\n $response = $this->sendCommand(static::RCMD_BROADCAST_MSG, $message);\n return $response->getData() === 'Broadcast Sent!';\n }", "public function testShouldAllowToSendSms()\n\t {\n\t\tdefine(\"GNOKII_COMMAND\", \"sh \" . __DIR__ . \"/mock/mock.sh\");\n\t\tdefine(\"SMSC_NUMBER\", \"+79043490000\");\n\n\t\t$sender = new PhpGnokii();\n\t\t$this->assertTrue($sender->send(\"+79526191914\", \"test\"));\n\t }", "public function can_perform_loopback()\n {\n }", "protected function onReceive(string $payload) {\n\n\t\t\t$sp = explode(':', $payload, 3);\n\n\t\t\t// extract handler\n\t\t\t$message = $sp[0];\n\t\t\t$handler = $this->handlers[$message] ?? null;\n\t\t\tif (!$handler)\n\t\t\t\tthrow new SystemBroadcastUnhandledException(\"No handler for system broadcast message \\\"$message\\\" registered\");\n\n\t\t\t// extract data\n\t\t\t$dataEncoded = $sp[2] ?? '';\n\t\t\t$data = null;\n\t\t\tif ($dataEncoded != '') {\n\t\t\t\t$data = @json_decode($dataEncoded, true);\n\t\t\t\tif (json_last_error())\n\t\t\t\t\tthrow new RuntimeException('JSON decode failed: ' . json_last_error_msg());\n\t\t\t}\n\n\t\t\t// check signature\n\t\t\t$signatureData = $sp[1] ?? null;\n\t\t\tif ($signatureData) {\n\t\t\t\t$spSig = explode('|', $signatureData, 4);\n\n\t\t\t\t// check algorithm\n\t\t\t\t$algorithm = $spSig[0] ?? null;\n\t\t\t\tif (!in_array($algorithm, $this->verificationAlgorithms()))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid signature algorithm \\\"$algorithm\\\"\");\n\n\t\t\t\t// get secret\n\t\t\t\t$keyName = $spSig[1] ?? null;\n\t\t\t\tif (!in_array($algorithm, $this->verificationAlgorithms()))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" without signature key name\");\n\t\t\t\t$secret = $this->verificationKeys()[$keyName] ?? null;\n\t\t\t\tif (!$secret)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with unknown signature key \\\"$keyName\\\"\");\n\n\t\t\t\t// get timestamp\n\t\t\t\t$timestamp = $spSig[2] ?? 0;\n\t\t\t\tif (!$timestamp || !is_numeric($timestamp))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid timestamp \\\"$timestamp\\\"\");\n\t\t\t\t$now = time();\n\t\t\t\t$timeDiff = abs($now - $timestamp);\n\t\t\t\tif ($timeDiff > $this->timeTolerance)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with timestamp \\\"$timestamp\\\" exceeding the maximum tolerance of \\\"{$this->timeTolerance}\\\". Current system time is $now.\");\n\n\n\t\t\t\t// verify signature\n\t\t\t\t$signature = $spSig[3];\n\t\t\t\tif (!$signature)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with missing signature\");\n\t\t\t\t$expectedSign = hash_hmac($algorithm, $this->stringToSign($message, $dataEncoded, $timestamp), $secret);\n\t\t\t\tif (!hash_equals($expectedSign, $signature))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid signature \\\"$signature\\\". Valid signature would be \\\"$expectedSign\\\"\");\n\n\t\t\t}\n\t\t\telse if ($this->usesSignatures()) {\n\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling unauthenticated system broadcast message \\\"$message\\\"\");\n\t\t\t}\n\n\n\t\t\tcall_user_func($handler, $data, $this, $message);\n\t\t}", "public function test_dotorg_communication()\n {\n }", "public function notify() : bool{}", "public function isSent() {}", "public function deviceConditionDoesNotMatchRobot() {}", "public function deviceConditionDoesNotMatchRobot() {}", "public function broadcastEvent(\\Montage\\Event\\Event $event);", "private function test_availability() {\r\n\r\n $this->add_log('test_availability: Testing ws availability...', 'DEBUG');\r\n\r\n $params = new stdClass();\r\n $params->from = @new SoapVar($this->sender, XSD_STRING, \"string\", \"http://www.w3.org/2001/XMLSchema\");\r\n $this->call_function('disponibilitat', $params);\r\n $this->add_log('test_availability: Server avalaible', 'DEBUG');\r\n }", "public function broadcastAs()\n {\n return 'game.won_by_robot';\n }", "public function broadcastOn()\n {\n return ['absensi-new'];\n }", "public function broadcast($server, $message);", "protected function validate()\r\n {\r\n return ( is_array( $this->bot ) && !empty( $this->channel ) );\r\n }", "public function testShouldNotAllowToSendSmsIfGnokiiCommandIsNotDefined()\n\t {\n\t\tdefine(\"SMSC_NUMBER\", \"+79043490000\");\n\n\t\tdefine(\"EXCEPTION_GNOKII_COMMAND_IS_NOT_SET\", 1);\n\t\t$this->expectException(Exception::class);\n\t\t$this->expectExceptionCode(EXCEPTION_GNOKII_COMMAND_IS_NOT_SET);\n\t\t$sender = new PhpGnokii();\n\t }", "public function test_receive_notify_unsafe()\n {\n\n $payum = m::spy('Payum\\Core\\Payum');\n $request = m::spy('Illuminate\\Http\\Request');\n $responseFactory = m::spy('Illuminate\\Contracts\\Routing\\ResponseFactory');\n $converter = m::spy('Payum\\Core\\Bridge\\Symfony\\ReplyToSymfonyResponseConverter');\n\n $gatewayName = 'foo.gateway';\n $gateway = m::spy('Payum\\Core\\GatewayInterface');\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $payum\n ->shouldReceive('getGateway')->with($gatewayName)->andReturn($gateway);\n\n $payumService = new PayumService($payum, $request, $responseFactory, $converter);\n $payumService->receiveNotifyUnsafe($gatewayName);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $payum->shouldHaveReceived('getGateway')->with($gatewayName)->once();\n $gateway->shouldHaveReceived('execute')->with(m::type('Payum\\Core\\Request\\Notify'))->once();\n $responseFactory->shouldHaveReceived('make')->with(null, 204);\n }", "public function broadcastOn()\n {\n return [ 'Test' ];\n }", "public function testChannelsReplies()\n {\n }", "public function broadcastOn()\n {\n\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function broadcastOn()\n {\n return [];\n }", "public function test_loopback_requests()\n {\n }", "function ok()\r\n {\r\n \tif (!$this->_socket || !is_resource($this->_socket)) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$response = $this->getresp();\r\n\t\tforeach ($response as $v)\r\n\t\t{\r\n\t\t\tif (!empty($v) && !preg_match(\"/^[123]/\", $v)) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t\t/*\r\n\t\tif (ereg(\"^[123]\", $response)) {\r\n \t\treturn TRUE;\r\n \t} else {\r\n \t\treturn FALSE;\r\n \t}*/\r\n }", "function testResendVerification() {\n $this->assertFalse($this->oObject->resendVerification());\n }", "function recvBroadcast( $user, $publisher,\n\t\t\t$msg, $contextType )\n\t{\n\t\tif ( $contextType != 'text/plain' )\n\t\t\treturn;\n\n\t\t$userId = findUserId( $user );\n\t\t$publisherId = findIdentityId( $publisher );\n\t\t$publisherRshipId = findRelationshipId( $userId, $publisherId );\n\t\t$messageId = $msg[0]['message-id'];\n\n\t\tdbQuery( \"\n\t\t\tINSERT IGNORE INTO activity\n\t\t\t(\n\t\t\t\tuser_id, publisher_id, time_published,\n\t\t\t\ttime_received, pub_type, message_id, message\n\t\t\t)\n\t\t\tVALUES ( %l, %l, now(), now(), %e, %e, %e )\",\n\t\t\t$userId, $publisherRshipId,\n\t\t\tPUB_TYPE_POST, $messageId, $msg[1]\n\t\t);\n\t}", "public function testValidation()\n {\n $req = new Request\\Ban('', []);\n self::assertFalse($req->isValid());\n\n $req = new Request\\Ban('', 'value');\n self::assertTrue($req->isValid());\n\n $req = new Request\\Ban('', ['value']);\n self::assertTrue($req->isValid());\n\n $req = new Request\\Ban('host', []);\n self::assertFalse($req->isValid());\n\n $req = new Request\\Ban('host', ['value']);\n self::assertTrue($req->isValid());\n }", "public static function getBroadcast()\n {\n return new Address(self::LONG_BROADCAST);\n }", "public function setBroadcasted($broadcasted);", "public function check_sync()\n {\n }", "public function broadcast($text, $ignored=null){ }", "public function testVerify()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+456', 'TEST_SECRET')\n );\n\n // Assert false when the phone is not stored\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'CLIENT_SECRET')\n );\n\n // Assert true when the phone and secret are properly given\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'TEST_SECRET')\n );\n }", "public function testFirstCommand()\n {\n $this->receiver->expects($this->once())\n ->method('comeOutOfTheDressingRoom');\n $this->receiver->expects($this->once())\n ->method('pickTheBallsUp');\n $this->receiver->expects($this->once())\n ->method('putThemAway');\n $this->invoker->slideThePaperUnderTheDoor();\n }", "public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }", "public function testChannelsKick()\n {\n }", "public function testChannelsJoin()\n {\n }", "public function harSending() {\n try {\n $this->getSending();\n return true;\n } catch( Exception $e ) {\n if( $e->getCode() == 144001 ) {\n return false;\n }\n throw $e;\n }\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "public function testShouldGetFireMessage()\n {\n $app = [];\n $command = m::mock('Zizaco\\Confide\\RoutesCommand', [$app]);\n $command->shouldAllowMockingProtectedMethods();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $command->shouldReceive('getFireMessage')\n ->passthru();\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $this->assertTrue(is_string($command->getFireMessage(true)));\n $this->assertTrue(is_string($command->getFireMessage(false)));\n }", "public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }", "public function testScheduleCommand()\n {\n $this->artisan('schedule:run')\n ->expectsOutput('No scheduled commands are ready to run.');\n }", "public function testSend()\n {\n }", "public function testSend()\n {\n }" ]
[ "0.69082236", "0.66991156", "0.66991156", "0.6169791", "0.6169791", "0.57542425", "0.5725016", "0.5725016", "0.5725016", "0.5725016", "0.5693092", "0.56548315", "0.5500017", "0.5326541", "0.53026444", "0.5294171", "0.5219728", "0.51821285", "0.51215005", "0.5089883", "0.5080837", "0.50801367", "0.5064733", "0.5039059", "0.50306994", "0.50211996", "0.5019893", "0.49898195", "0.4989729", "0.4988971", "0.49724105", "0.49701044", "0.49700066", "0.49680588", "0.49578562", "0.49357316", "0.49216765", "0.49107212", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.49059683", "0.48966828", "0.48875272", "0.4875392", "0.48653597", "0.48564965", "0.48349026", "0.48194072", "0.4811748", "0.48114955", "0.48090932", "0.47989216", "0.47799855", "0.47799855", "0.47762132", "0.47742626", "0.47702202", "0.4765949", "0.4765949", "0.4765949", "0.4762072", "0.4759666", "0.47563833", "0.4751022", "0.4751022" ]
0.67587143
1
Verifies the change map command does work properly
public function test_admin_change_map() { $this->assertTrue($this->postScriptumServer->adminChangeMap('Heelsum Single 01')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function adminChangeMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminChangeMap', $map, 'Changed map to');\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah Insurgency v1'));\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah AAS v1'));\n }", "public function process_cmdmap() {}", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "protected function hasMappingErrorOccurred() {}", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function testRebuild()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsRebuild'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function checkCoordinates() : void\n {\n $this->checkLatitudes();\n $this->checkLongitudes();\n }", "public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }", "function mkd_re_enable_maps_in_admin() {\n return true;\n }", "public function test_check_on_earth_valid()\n {\n $coord = new stdClass();\n $coord->x = -120;\n $coord->y = 43;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertTrue($checked);\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->postScriptumServer->adminSetNextMap('Heelsum Single 01'));\n }", "public function testProjectAssignmentsUpdateAvailability()\n {\n }", "public function test_check_on_earth_invalid()\n {\n $coord = new stdClass();\n $coord->x = -133;\n $coord->y = 5543;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertFalse($checked);\n }", "function newMap($map) {\n\n\t\t// log if not a restart\n\t\t$this->server->gamestate = Server::RACE;\n\t\tif ($this->restarting == 0)\n\t\t\t$this->console_text('Begin Map');\n\n\t\t// refresh game info\n\t\t$this->client->query('GetCurrentGameInfo', 1);\n\t\t$gameinfo = $this->client->getResponse();\n\t\t$this->server->gameinfo = new Gameinfo($gameinfo);\n\n\t\t// check for restarting map\n\t\t$this->changingmode = false;\n\t\tif ($this->restarting > 0) {\n\t\t\t// check type of restart and signal an instant one\n\t\t\tif ($this->restarting == 2) {\n\t\t\t\t$this->restarting = 0;\n\t\t\t} else { // == 1\n\t\t\t\t$this->restarting = 0;\n\t\t\t\t// throw postfix 'restart map' event\n\t\t\t\t$this->releaseEvent('onRestartMap2', $map);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// refresh server name & options\n\t\t$this->getServerOptions();\n\n\t\t// reset record list\n\t\t$this->server->records->clear();\n\t\t// reset player votings\n\t\t//$this->server->players->resetVotings();\n\n\t\t// create new map object\n\t\t$map_item = new Map($map);\n\n\t\t// in Rounds/Team/Cup mode if multilap map, get forced laps\n\t\tif ($map_item->laprace &&\n\t\t ($this->server->gameinfo->mode == Gameinfo::RNDS ||\n\t\t $this->server->gameinfo->mode == Gameinfo::TEAM ||\n\t\t $this->server->gameinfo->mode == Gameinfo::CUP)) {\n\t\t\t$map_item->forcedlaps = $this->server->gameinfo->forcedlaps;\n\t\t}\n\n\t\t// obtain map's GBX data, MX info & records\n\t\t$map_item->gbx = new GBXChallMapFetcher(true);\n\t\ttry\n\t\t{\n\t\t\t$map_item->gbx->processFile($this->server->mapdir . $map_item->filename);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\ttrigger_error($e->getMessage(), E_USER_WARNING);\n\t\t}\n\t\t$map_item->mx = findMXdata($map_item->uid, true);\n\n\t\t// throw main 'begin map' event\n\t\t$this->releaseEvent('onBeginMap', $map_item);\n\n\t\t// log console message\n\t\t$this->console('map changed [{1}] >> [{2}]',\n\t\t stripColors($this->server->map->name, false),\n\t\t stripColors($map_item->name, false));\n\n\t\t// check for relay server\n\t\tif (!$this->server->isrelay) {\n\t\t\t// check if record exists on new map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t$score = ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t str_pad($cur_record->score, 5, ' ', STR_PAD_LEFT) :\n\t\t\t\t formatTime($cur_record->score));\n\n\t\t\t\t// log console message of current record\n\t\t\t\t$this->console('current record on {1} is {2} and held by {3}',\n\t\t\t\t stripColors($map_item->name, false),\n\t\t\t\t trim($score),\n\t\t\t\t stripColors($cur_record->player->nickname, false));\n\n\t\t\t\t// replace parameters\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($map_item->name),\n\t\t\t\t trim($score),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else {\n\t\t\t\tif ($this->server->gameinfo->mode == Gameinfo::STNT)\n\t\t\t\t\t$score = ' ---';\n\t\t\t\telse\n\t\t\t\t\t$score = ' --.--';\n\n\t\t\t\t// log console message of no record\n\t\t\t\t$this->console('currently no record on {1}',\n\t\t\t\t stripColors($map_item->name, false));\n\n\t\t\t\t// replace parameters\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($map_item->name));\n\t\t\t}\n\t\t\tif (function_exists('setRecordsPanel'))\n\t\t\t\tsetRecordsPanel('local', $score);\n\n\t\t\t// if no maprecs, show the original record message to all players\n\t\t\tif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\tif (($this->settings['show_recs_before'] & 4) == 4 && function_exists('send_window_message'))\n\t\t\t\t\tsend_window_message($this, $message, false);\n\t\t\t\telse\n\t\t\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\t\t\t}\n\t\t}\n\n\t\t// update the field which contains current map\n\t\t$this->server->map = $map_item;\n\n\t\t// throw postfix 'begin map' event (various)\n\t\t$this->releaseEvent('onBeginMap2', $map_item);\n\n\t\t// show top-8 & records of all online players before map\n\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\tshow_maprecs($this, false, 1, $this->settings['show_recs_before']); // from chat.records2.php\n\t\t}\n\t}", "public function adminSetNextMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminSetNextMap', $map, 'Set next map to');\n }", "public function tellInvalidPin()\n {\n }", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange('Test'));\n }", "protected function setExpectedFlushChangesOutput($map)\n {\n // build a mock of the extension overriding flushChanges to prevent writing to the queue\n $mockExtension = $this->getMockBuilder(SiteTreePublishingEngine::class)\n ->setMethods(['flushChanges'])\n ->getMock();\n\n // IF YOU'RE OF A NERVOUS DISPOSITION, LOOK AWAY NOW\n // stub the flushChanges method and make sure that each call is able to assert the correct items are in the\n $mockExtension\n ->expects($this->exactly(count($map)))\n ->method('flushChanges')\n ->willReturnOnConsecutiveCalls(...$this->transformMapToCallback($map, $mockExtension));\n\n // register our extension instance so it's applied to all SiteTree objects\n Injector::inst()->registerService($mockExtension, SiteTreePublishingEngine::class);\n }", "public function test_if_failed_update()\n {\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "protected function changeStateCheck()\n {\n if (empty($this->boardNewMoves)) {\n throw new BoardException(Yii::t('app', 'No move detected.'));\n }\n // Make sure 1 move has been made.\n if (count($this->boardNewMoves) > 1) {\n throw new BoardException(Yii::t('app', 'Only one move per request allowed.'));\n }\n\n // Make sure proper character used.\n $allowedCharacter = $this->moveCharacterMap[($this->getTotalMoves() + 1) % 2];\n if (($moveCharacter = $this->getNewMoveCharacter()) != $allowedCharacter) {\n throw new BoardException(Yii::t('app', 'You have to use character \"{allowedCharacter}\" instead of \"{moveCharacter}\"', [\n 'allowedCharacter' => $allowedCharacter,\n 'moveCharacter' => $moveCharacter,\n ]));\n }\n\n // Make sure that character has been placed into the proper position (not overriding existing).\n if (in_array($this->boardArr[$this->getNewMovePosition()], $this->moveCharacterMap)) {\n throw new BoardException(Yii::t('app', 'You are not allowed to override existing moves.'));\n }\n }", "function after_change()\n\t{\n\t\treturn true;\n\t}", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "protected function isUnchanged() {}", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test'));\n }", "public function testNothingModified()\n {\n $check = $this->_cs->checkEntitiesChanged(rand(0, 9999), array(self::ENTITY_NAME));\n $this->assertTrue($check);\n }", "private function _checkMap()\n {\n foreach($this->_map as $alias => $field)\n {\n if(!is_array($field))\n {\n $this->_map[$alias] = array(\n self::MAP_FIELD => $field\n );\n }\n if(isset($field[self::MAP_TYPE]) && in_array($field[self::MAP_TYPE],\n self::$_relationTypes))\n {\n switch($field[self::MAP_TYPE])\n {\n case self::RELATION_PARENT:\n if(empty($field[self::MAP_KEY]) || empty($field[self::MAP_FOREIGN_KEY]))\n {\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n }\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $mapper->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $alias . ucfirst($mapper->getKeyField());\n }\n break;\n\n case self::RELATION_CHILD:\n case self::RELATION_CHILDREN:\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n /** @var Core_Entity_Mapper_Abstract */\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n $backRelation = $mapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n if(!isset($field[self::MAP_SAVE]))\n {\n $field[self::MAP_SAVE] = true;\n }\n if(!isset($field[self::MAP_DELETE]))\n {\n $field[self::MAP_DELETE] = true;\n }\n break;\n\n case self::RELATION_M2M:\n /** @var Core_Entity_Mapper_Abstract */\n $targetMapper = $field[self::MAP_MAPPER];\n $targetMapper = new $targetMapper();\n\n /** @var Core_Entity_Mapper_Abstract */\n $middleMapper = $field[self::MAP_MIDDLE_MAPPER];\n $middleMapper = new $middleMapper();\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $backRelation = $middleMapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation == null)\n {\n throw new Core_Entity_Exception('Middle Mapper Not configured for m2m relation \"' . get_class($this) . '->' . get_class($middleMapper) . '\"');\n }\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n $field[self::MAP_SAVE] = false;\n $field[self::MAP_DELETE] = false;\n break;\n\n default:\n $log = Core_Log_Manager::getInstance()->getLog('default');\n if(!empty($log))\n {\n $log->log(\"[\" . get_class($this) . \"]\\t\" . 'Unknown relation type \"' . $field[self::MAP_TYPE] . '\"',\n Zend_Log::NOTICE);\n }\n throw new Core_Entity_Exception('Unknown relation type \"' . $field[self::MAP_TYPE] . '\"');\n break;\n }\n $this->_map[$alias] = $field;\n }\n }\n }", "public function toggle_ready_state() {\n\t\t$x = Server::get_instance(CONF_ENGINE_SERVER_URL)\n\t\t\t->cmd_map_chooser_ffa_toggle_ready_state($this->uid);\n\t\t$this->available_maps = (array)$x->available_maps;\n\t\t$this->chosen_map_index = $x->chosen_map_index;\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "private function checkMainSnakUpdate( Statement $oldStatement ) {\n\t\t$newMainSnak = $this->statement->getMainSnak();\n\t\t$oldPropertyId = $oldStatement->getMainSnak()->getPropertyId();\n\n\t\tif ( !$oldPropertyId->equals( $newMainSnak->getPropertyId() ) ) {\n\t\t\t$guid = $this->statement->getGuid();\n\t\t\tthrow new ChangeOpException( \"Claim with GUID $guid uses property \"\n\t\t\t\t. $oldPropertyId . \", can't change to \"\n\t\t\t\t. $newMainSnak->getPropertyId() );\n\t\t}\n\t}", "function _check ($from_lines, $to_lines) {\r\n if (serialize($from_lines) != serialize($this->orig()))\r\n trigger_error(\"Reconstructed original doesn't match\", E_USER_ERROR);\r\n if (serialize($to_lines) != serialize($this->_final()))\r\n trigger_error(\"Reconstructed final doesn't match\", E_USER_ERROR);\r\n\r\n $rev = $this->reverse();\r\n if (serialize($to_lines) != serialize($rev->orig()))\r\n trigger_error(\"Reversed original doesn't match\", E_USER_ERROR);\r\n if (serialize($from_lines) != serialize($rev->_final()))\r\n trigger_error(\"Reversed final doesn't match\", E_USER_ERROR);\r\n\r\n\r\n $prevtype = 'none';\r\n foreach ($this->edits as $edit) {\r\n if ( $prevtype == $edit->type )\r\n trigger_error(\"Edit sequence is non-optimal\", E_USER_ERROR);\r\n $prevtype = $edit->type;\r\n }\r\n\r\n $lcs = $this->lcs();\r\n trigger_error(\"Diff okay: LCS = $lcs\", E_USER_NOTICE);\r\n }", "public function testPendingValidationWithMapping()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_NONE_VALIDATED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 12345\n );\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_PARTIALLY_VALIDATED,\n StripeMock::PAYMENT_INTENT_STATUS_REQUIRES_CAPTURE,\n 12345\n );\n $this->executeCommand();\n $this->assertCount(1, $messages = $this->validateReceiver->getSent());\n $this->assertCount(2, $messages[0]->getMessage()->getOrders());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public function changeDefaultMap() \n\t{\n \t\t$mapId = $_POST['mapId'];\n\t\t$gameId = $_SESSION['jogoid'];\n\n\t\t$this->model->removeDefaultMapByGame($gameId);\n\t\t$this->model->defineDefaultMap($mapId);\n\t}", "public function test_dirty_deg()\n {\n $coord = \"52.5g\\t-89.0r\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], 52.5);\n $this->assertEquals($dd[1], -89.0);\n }", "public function testUpdatePlaceSuccess(): void\n {\n\n $response = $this->post(route('place-update'), [\n \"id\" => $this->placeFactory->id,\n \"name\" => \"juan\",\n \"company_id\" => $this->companyFactory->id,\n \"is_active\" => 1\n ], [\n 'Accept' => 'application/json'\n ]);\n\n $response->assertStatus(200);\n $response->assertJson([\n 'message' => 'profesional actualizado con éxito'\n ]);\n }", "public function is_correct_location() {\r\n\t\treturn true;\r\n\t}", "public function testGetChangeIssue()\n {\n }", "public function testRefresh()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsRefresh'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function isValid() : bool {\n if($valid = parent::isValid()){\n // check if source/target system are not equal\n // check if source/target belong to same map\n if(\n is_object($this->source) &&\n is_object($this->target) &&\n $this->get('source', true) === $this->get('target', true) ||\n $this->source->get('mapId', true) !== $this->target->get('mapId', true)\n ){\n $valid = false;\n }\n }\n\n return $valid;\n }", "function test_checkMode_newArgs()\n {\n $result = $this->bax->_checkMode($this->bax->_newArgs());\n $this->assertTrue($result === true);\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "private function setUserMapPlace() {\n\t\t$this->mapPlaceManager->unsetMapPlace($this->user->id);\n\n\t\t$count = $this->mapPlaceManager->getFreeMapPlaceCount();\n\t\tif($count < 10 || GlobalConfig::ALWAYS_EXTEND_MAP ) {\n\t\t\t$mapManager = new MapManager($this->db);\n\t\t\t$mapManager->extendMap();\n\t\t}\n\t\t\t\n\t\t$mapPlace = $this->mapPlaceManager->getRandomFreeMapPlace();\n\t\t$mapPlace->userid = $this->user->id;\n\t\tif(!$mapPlace) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->mapPlaceManager->updateMapPlace($mapPlace);\n\t\t\treturn true;\n\t\t}\n\t}", "function map_action($Server_ID, $Map_ID, $Map_Action_ID) {\n\n\t$Box_ID = getBOX($Server_ID);\n\n\tif ($Map_Action_ID == 1) {\n\t\tif (!function_exists(\"ssh2_connect\")) {\n\t\t\t$return = false;\n\t\t}\n\n\t\tif(!($ssh_conn = ssh2_connect(server_ip($Server_ID), box_ssh($Box_ID)))) {\n\t\t $return = false;\n\t\t} else {\n\t\t\tif(!ssh2_auth_password($ssh_conn, server_username($Server_ID), server_password($Server_ID))) {\n\t\t \t$return = false;\n\t\t } else {\n\t\t \t\t$stream = ssh2_shell($ssh_conn, 'xterm');\n\n\t\t \t\tfwrite($stream, 'cd cstrike/maps/'.PHP_EOL);\n\t\t\t\tsleep(1);\n\n\t\t\t\tfwrite($stream, 'wget http://gb-hoster.me/assets/maps/'.map_file($Map_ID).PHP_EOL);\n\t\t\t\tsleep(2);\n\n\t\t\t\t$add_to_pl_list = add_to_plugin_list($Server_ID, $Map_ID);\n\t\t\t\tif (!$add_to_pl_list) {\n\t\t\t\t\t$return = false;\n\t\t\t\t} else {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if ($Plugin_Action_ID == 2) {\n\t\tif (!function_exists(\"ssh2_connect\")) {\n\t\t\t$return = false;\n\t\t}\n\n\t\tif(!($ssh_conn = ssh2_connect(server_ip($Server_ID), box_ssh($Box_ID)))) {\n\t\t $return = false;\n\t\t} else {\n\t\t\tif(!ssh2_auth_password($ssh_conn, server_username($Server_ID), server_password($Server_ID))) {\n\t\t \t$return = false;\n\t\t } else {\n\t\t \t\t$stream = ssh2_shell($ssh_conn, 'xterm');\n\n\t\t \t\tfwrite($stream, 'cd cstrike/addons/maps/'.PHP_EOL);\n\t\t\t\tsleep(1);\n\n\t\t\t\tfwrite($stream, 'rm '.map_file($Plugin_ID).PHP_EOL);\n\t\t\t\tsleep(2);\n\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $return;\n}", "public static function text_change_check()\n {\n }", "public function Change_Password_Validation($sorce){\r\n\r\n if (empty($sorce['current_password']))\r\n {\r\n \t$this->_flag = false;\r\n\r\n Session::put('e_password', 'You must enter your old password');\r\n }\r\n if($this->_flag){\r\n\r\n // Copy send values into local instances\r\n $password1 = $sorce['password1'];\r\n $password2 = $sorce['password2'];\r\n\r\n // Check if password is too long\r\n if(self::check_Max($password1)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Your new password is too long, max '.$this->_max.' chars!');\r\n }\r\n\r\n // Check if password is too short\r\n else if(self::check_Min($password1)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Your new password is too short , min '.$this->_min.' chars!');\r\n }\r\n\r\n // Check if passwords are the same\r\n else if(self::check_If_The_Same_Passwords($password1,$password2)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_password1', 'Different new passwords!');\r\n }\r\n }\r\n }", "function _is_geometry_modified($old_slice, $new_slice) {\n $old_nodes_ids = array_keys($old_slice['nodes']);\n $new_nodes_ids = array_keys($new_slice['nodes']);\n if ($old_nodes_ids != $new_nodes_ids)\n return true;\n\n foreach ($new_slice['nodes'] as $node) {\n if (isset($node['action']))\n return true;\n }\n\n return false;\n }", "public function testUpdateCPasswordNotGiven(): void { }", "public function recreateMapsIfTriggered()\n {\n if ($this->isRecreationTriggered) {\n $this->recreateMaps();\n }\n }", "function filesystemValidator( &$errors, &$warnings , &$conflictsMap ) {\n $valid = 0;\n foreach( $conflictsMap as $key => $value ){\n $valid = 2;\n $errors[ $key ] = $value;\n }\n return $valid;\n}", "public function testMapViolation()\n {\n $violation = $this->getConstraintViolation();\n $form = $this->getForm('street');\n\n $this->validator->expects($this->once())\n ->method('validate')\n ->will($this->returnValue(array($violation)));\n\n $this->violationMapper->expects($this->once())\n ->method('mapViolation')\n ->with($violation, $form, false);\n\n $this->listener->validateForm(new FormEvent($form, null));\n }", "private function setmapMode(){\n\n\t\t$this->mapMode = array(\n\t\t\t'befe'=>\t$this->settings['mapMode'], /* bad content from outside ... so use properly */\n\t\t\t'isbe'=>\tstristr($this->settings['mapMode'],'backend') !== false,\n\t\t);\n\t}", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n }", "private function testMappingPossible($mcToGeMapping)\n {\n $geIds = array(); // Grid element layout IDs\n foreach ($mcToGeMapping as $id) {\n if (!empty($id)) {\n $geIds[] = (string) $id;\n } else {\n $geIds[] = 1;\n }\n }\n $ids = array_unique($geIds, SORT_NUMERIC);\n\n $select_fields = 'uid, hidden';\n $where = 'uid IN(' . implode(',', $ids) . ') AND deleted = 0';\n $orderBy = '';\n $table = 'tx_gridelements_backend_layout';\n\n $availability = array();\n $resource = $this->execSelect($select_fields, $where, $orderBy, $table);\n if ($resource === false) {\n return $availability;\n }\n\n foreach ($ids as $id) {\n $availability[$id] = 'unavailable';\n }\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $hidden = (int) $row['hidden'];\n $availability[$row['uid']] = $hidden ? 'hidden' : 'visible';\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n return $availability;\n }", "public function isDiffChangeAllowed() {\r\n return true;\r\n }", "function can_change_password() {\n\t\treturn false;\n\t}", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "public function equals(Map $map): bool;", "public function testNothingModifiedLastRunSet()\n {\n $this->_cs->updateLastRun($this->_name);\n sleep(2);\n\n $check = $this->_cs->checkEntitiesChanged($this->_name, array(self::ENTITY_NAME));\n $this->assertFalse($check);\n }", "public function testChangeMemberPassword()\n {\n }", "protected function _havePIMChanges()\n {\n throw new Horde_ActiveSync_Exception('Must be implemented in concrete class.');\n }", "protected static function _ensureCMapInstance(&$cmap) {}", "function globeValidation(&$broker){\n\t$result = validGlobe($broker);\n\tif ($result == -1) return -1;\n\telse if ($result == 0) listUnassigned($broker);\n\telse updateAssigned($broker, $result); //globe ID and project\n}", "public function test_clean_coord()\n {\n $coord = \"-45d.4dt5;0dds\";\n $clean = \\SimpleMappr\\Mappr::cleanCoord($coord);\n $this->assertEquals($clean, -45.450);\n }", "private function is_map_center_valid() {\n\t\t\tif ( isset( $this->map_center_valid ) ) {\n\t\t\t\treturn $this->map_center_valid;\n\t\t\t}\n\n\t\t\t$this->active_radius = ( $this->slplus->SmartOptions->distance_unit->value === 'miles' ) ? SLPlus::earth_radius_mi : SLPlus::earth_radius_km;\n\t\t\t$this->map_center_valid = $this->is_valid_lat( $this->slplus->SmartOptions->map_center_lat->value ) && $this->is_valid_lng( $this->slplus->SmartOptions->map_center_lng->value );\n\n\t\t\treturn $this->map_center_valid;\n\t\t}", "public function testIsValidException()\n\t{\n\t\t$data = $this->getMock('Blackbox_Data', array());\n\t\t$data->expects($this->never())->method('__set');\n\t\t$data->expects($this->never())->method('__unset');\n\n\t\t$this->target->isValid($data, $this->state_data);\n\t}", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "function runningPlay() {\n\t\t// request information about the new map\n\t\t// ... and callback to function newMap()\n\t}", "public function test_normal()\n {\n $origin = [\n 'coordinates' => '1,5',\n 'direction' => Compass::EAST,\n ];\n\n $this->postJson('/api/set-coordinates', $origin);\n\n $command = [\n 'command' => Navigation::TEST_COMMAND,\n 'obstacles' => false,\n ];\n\n $response = $this->postJson('api/send-command', $command);\n\n $coordinates = Coordinate::all();\n\n $positions = [\n [1, 5],\n [2, 5],\n [3, 5],\n [3, 4],\n [3, 3],\n [4, 3],\n [5, 3],\n [6, 3],\n [6, 2],\n ];\n\n $error = false;\n foreach ($positions as $position) {\n $this->assertDatabaseHas(Coordinate::class, [Coordinate::X_AXIS=> $position[0] , Coordinate::Y_AXIS => $position[1]]);\n }\n\n $this->assertDatabaseCount(Movement::class, 10);\n\n $last_movement = Movement::orderBy('id', 'desc')->first();\n\n $last_movement_error_check = false;\n if ($last_movement->coordinates->position_x != 6 || $last_movement->coordinates->position_y != 3) {\n $last_movement_error_check = true;\n }\n\n $this->assertFalse($last_movement_error_check);\n\n $data = [\n 'movements' => Movement::orderBy('id', 'desc')->get()->toArray(),\n 'obstacles' => Coordinate::orderBy('id', 'asc')->where('has_obstacle', 1)->get()->toArray(),\n ];\n\n $response->assertJson($data);\n }", "public function update(User $user, Echelonmap $echelonmap)\n {\n return $user->hasPermission('update-reference-echelonmap');\n }", "public function run_chg_pass_if()\n\t{\n\t\t$msg='';\n\t\tif(isset($_POST['old_pass']))\n\t\t{\n\t\t\tif(md5($_POST['old_pass'])==$_SESSION['waf_user']['pass'])\n\t\t\t\t{\n\t\t\t\t\tif($_POST['pass']!=$_POST['pass1'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg='Passwords not equal! Try again.';\n\t\t\t\t\t}else{\n\t\t\t\t\t$this->change_password($_SESSION['waf_user']['id'],$_POST['pass']);\n\t\t\t\t\t$msg='Password successfully changed';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t$msg='Old Password wrong! Password not changed';\t\n\t\t\t\t}\n\t\t}\n\t\t$this->error=$msg;\n\t}", "function can_change_password() {\n return false;\n }", "public function validate_mapping_file($user,$project){\n\n $path_input = \"owncloud/data/$user/files/$project/input/map.txt\";\n $folder_test = \"owncloud/data/$user/files/$project/test\";\n $file = FCPATH.$path_input;\n\n $cmd = \"/usr/bin/python Scriptqiime/validate_mapping_file.py -m $file -o $folder_test\";\n $output = shell_exec($cmd);\n $chk = trim($output);\n # No errors or warnings were found in mapping file.\n if($chk == \"No errors or warnings were found in mapping file.\"){\n return('Noerror');\n }else{\n return('Error');\n }\n }", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "protected function checkChangeTariff()\n {\n $this->tariffChangePage->open()\n ->checkPageTitle('change to a different tariff')\n ->checkAccountId()\n ->verifyTariffChangeForm()\n ->checkWeHaveCurrentTariff()\n ->navigateToContactUsViaSideButton();\n }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function isDiffChangeAllowed() {\n return true;\n }", "public function testUpdatePasswordsDontMatch(): void { }", "public function test_next_map()\n {\n $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap());\n }", "private function _checkBoundary($newBoundary, $newBox) {}", "public function test2()\n {\n $rows = $this->dataLayer->tstTestMap1(0);\n $this->assertInternalType('array', $rows);\n $this->assertCount(0, $rows);\n }", "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "public function verifyKeys() {\n $data = $this->getClientInformation();\n $result = $this->updateSite($data);\n // lastResponseCode will either be TRUE, REQUEST_ERROR, AUTH_ERROR, or\n // NETWORK_ERROR.\n return $this->lastResponseCode === TRUE ? TRUE : $this->lastResponseCode;\n }", "public function testPingTreeUpdateTargets()\n {\n }", "protected function update_tables($map)\n\t{\n\t\t\n\t}", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "public function checkIfCompletelyResolved(): void;", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->postScriptumServer->adminRestartMatch());\n }", "public function testQueryChangesetFailure()\n\t{\n\t\t$param = 'open';\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 500;\n\t\t$returnData->body = $this->errorString;\n\t\t$returnData->osm = new SimpleXMLElement($this->sampleXml);\n\n\t\t$path = 'changesets/' . $param;\n\n\t\t$this->client->expects($this->once())\n\t\t->method('get')\n\t\t->with($path)\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->object->queryChangeset($param);\n\t}", "public function test_squad_server_admin_force_team_change_by_id()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange(0));\n }", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "public static function buildingChanges($mapID){\n $firepitArray = buildingController::getMapBuildings($mapID,\"Firepit\");\n foreach ($firepitArray as $firepit){\n }\n //This function creates a small animal in each zones with a trap\n $trapArray = buildingController::getMapBuildings($mapID,\"Trap\");\n foreach ($trapArray as $trap) {\n $zone = new zoneController($trap->getZoneID());\n $chances = rand(0,$zone->getCounter());\n if ($chances < 2) {\n $item = new itemController(\"\");\n $item->createNewItemByID(\"I0007\", $mapID,$trap->getZoneID(),\"ground\");\n $item->insertItem();\n chatlogZoneController::trapWorked($zone->getZoneID());\n }\n }\n //This function reduced the smoke signal building\n $smokeArray = buildingController::getMapBuildings($mapID,\"Smoke\");\n foreach ($smokeArray as $smoke){\n $building = new buildingController($smoke->getBuildingID());\n $currentFuel = $building->getFuelRemaining();\n $currentFuel = $currentFuel-1;\n $building->setFuelRemaining($currentFuel);\n if ($currentFuel <= 0){\n $zone = new zoneController($building->getZoneID());\n $zone->removeBuilding(buildingController::returnBuildingID(\"Smoke\"));\n $building->deleteBuilding();\n $zone->updateZone();\n chatlogZoneController::smokeExpired($zone->getZoneID());\n } else {\n $building->postBuildingDatabase();\n }\n }\n $seedlingArray = buildingController::getMapBuildings($mapID,\"Seedling\");\n foreach ($seedlingArray as $seed) {\n $building = new buildingController($seed->getBuildingID());\n if($building->getStaminaRequired() === $building->getStaminaSpent()){\n $zone = new zoneController($building->getZoneID());\n $change = false;\n if ($zone->getBiomeType() <3 && $zone->getBiomeType() >0){\n $change = 3;\n chatlogZoneController::seedlingToScrub($zone->getZoneID());\n } else if ($zone->getBiomeType() == 3){\n $change = 4;\n chatlogZoneController::seedlingToForest($zone->getZoneID());\n }\n if ($change !== false) {\n $zone->removeBuilding(buildingController::returnBuildingID(\"Seedling\"));\n $zone->setBiomeType($change);\n $zone->resetFindingChances();\n $building->deleteBuilding();\n $zone->updateZone();\n }\n }\n }\n $rockArray = buildingController::getMapBuildings($mapID,\"HeatRock\");\n foreach ($rockArray as $rock){\n $building = new buildingController($rock->getBuildingID());\n $firepitBuilding = buildingController::getConstructedBuildingID(\"Firepit\",$building->getZoneID());\n if (array_key_exists(\"ERROR\",$firepitBuilding)){\n $building->setFuelRemaining(0);\n } else {\n $building->modifyFuelRemaining(1);\n }\n $building->postBuildingDatabase();\n }\n }" ]
[ "0.706797", "0.706797", "0.6732472", "0.5693152", "0.56480783", "0.5568288", "0.55609846", "0.55246776", "0.5499689", "0.5499689", "0.54659414", "0.5463292", "0.5347335", "0.53297144", "0.53146344", "0.5309306", "0.52852696", "0.5256249", "0.5212162", "0.52060014", "0.51980376", "0.5156037", "0.5150325", "0.5103207", "0.50791126", "0.50785726", "0.5070088", "0.50655675", "0.5062453", "0.50551367", "0.5049732", "0.5047818", "0.503872", "0.5016873", "0.4972961", "0.49695164", "0.49368602", "0.49333727", "0.4931602", "0.4926431", "0.49151057", "0.49137235", "0.49007958", "0.48987094", "0.48955998", "0.48861393", "0.48856756", "0.48825043", "0.48815718", "0.4875375", "0.4873615", "0.48640424", "0.48628864", "0.4859665", "0.48559618", "0.48486575", "0.48279077", "0.48261988", "0.48249814", "0.48215476", "0.48175886", "0.48160952", "0.4794365", "0.47910112", "0.4782406", "0.47796094", "0.47773916", "0.4774919", "0.47709972", "0.47707894", "0.47703412", "0.4769413", "0.47673315", "0.4762184", "0.47529265", "0.47529134", "0.4751027", "0.4746801", "0.47446144", "0.47440925", "0.47408488", "0.47371718", "0.47345126", "0.47321844", "0.4726851", "0.4724638", "0.47233206", "0.47166905", "0.47118437", "0.47045165", "0.47036844", "0.47031194", "0.46989113", "0.46910793", "0.46901482", "0.46888408", "0.46829608", "0.46823776", "0.46812007", "0.46796748" ]
0.6946586
2
Verifies the set next map command does work properly
public function test_admin_set_next_map() { $this->assertTrue($this->postScriptumServer->adminSetNextMap('Heelsum Single 01')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_next_map()\n {\n $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap());\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah AAS v1'));\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah Insurgency v1'));\n }", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "public function adminSetNextMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminSetNextMap', $map, 'Set next map to');\n }", "public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }", "protected function hasMappingErrorOccurred() {}", "public function hasLastrealmapid(){\n return $this->_has(33);\n }", "public function hasLastmapid(){\n return $this->_has(28);\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->postScriptumServer->adminChangeMap('Heelsum Single 01'));\n }", "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function process_cmdmap() {}", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "function next(){ \r\n\t $this->valid = (FALSE !== next($this->array)); \r\n\t }", "public function needsIncrementOffset();", "function geoCodeXSet($modmap){\n // Cas ou l'on passe directement un oid\n if(!is_array($modmap)) $modmap=$this->xset->rdisplay($modmap);\n $nq = 0; $nqn = 0;\n $fname = $modmap['ofname']->raw;\n $ftable = $modmap['oftable']->raw;\n XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet start\");\n $xset = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.$ftable);\n $rs = selectQuery($xset->select_query(array()));\n $tests = 0;\n $delay = 0;\n while($rs && ($ors = $rs->fetch())){\n \n $pending = true;\n \n while($pending){\n\t$foo = array();\n\t$ofc = $xset->getField($fname);\n\t$fv = $ofc->edit($ors[$fname], $foo);\n\tif($fv->type == 'A' && ($fv->accuracy == '' || $fv->accuracy == 'N/A' || empty($fv->upd) || $ors['UPD'] > $fv->upd || \n\t\t\t\t$modmap['oUPD']->raw > $fv->upd)){\n\t $gar = array();\n\t $addressfields = explode(' ', $modmap['ofgcaddr']->raw);\n\t foreach($addressfields as $foo=>$afn){\n\t $afv = trim($ors[$afn]);\n\t if (!empty($afv))\n\t $gar['address'][] = array('value'=>$afv, 'retry'=>true, 'default'=>NULL);\n\t }\n\t $gar['city'] = array('value'=>$ors[$modmap['ofgctown']->raw], 'retry'=>true, 'default'=>NULL);\n\t $gar['zipcode'] = array('value'=>$ors[$modmap['ofgczipc']->raw], 'retry'=>false, 'default'=>NULL);\n\t $gar['country'] = array('value'=>$ors[$modmap['ofgccntr']->raw], 'retry'=>false, 'default'=>NULL);\n\t $nq += 1;\n\t $rg = $this->googleGeoCode($gar, 0, $ors['KOID']);\n\t list ($ok, $mess, $accuracy, $coords, $maddress, $retry, $query) = $rg;\n\t XLogs::notice(get_class($this).get_class($this).\"::googleGeoCode $ok $mess $retry $query\");\n\t $tests += 1;\n\t if ($ok){\n\t $pending = false;\n\t $fres = array('latlng'=>$coords[1].';'.$coords[0],\n\t\t\t 'autogc'=>1,\n\t\t\t 'accuracy'=>$accuracy);\n\t $xset->procEdit(array('_options'=>array('local'=>true),\n\t\t\t\t 'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t $fname=>$fres,\n\t\t\t\t 'oid'=>$ors['KOID']));\n\t } else if ($mess == 'too many query'){\n\t $delay += 100000; // pending reste a true\n\t XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet delaying $delay $nq\");\n\t XLogs::update('geocoding', NULL, \"incr delaying $delay $nq\");\n\t }else{\n\t $pending =false;\n\t $fres = array('latlng'=>'',\n\t\t\t 'autogc'=>1,\n\t\t\t 'accuracy'=>0);\n\t $xset->procEdit(array('_options'=>array('local'=>true),\n\t\t\t\t 'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t $fname=>$fres,\n\t\t\t\t 'oid'=>$ors['KOID']));\n\t \n\t }\n\t} else { \n\t XLogs::notice(get_class($this),get_class($this).\"::geCodeXSet up to date \".$ors['KOID']);\n\t $nqn += 1;\n\t $pending = false;\n\t $delay = 0;\n\t}\n\tusleep($delay);\n\tXLogs::notice('XModMap', \"geoCodeXSet query $nq ommitted $nqn of {$rs->rowCount()}\");\n }\n }\n XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet end\");\n return array('nq'=>$nq, 'nqn'=>$nqn, 'nt'=>$rs->rowCount());\n }", "function runningPlay() {\n\t\t// request information about the new map\n\t\t// ... and callback to function newMap()\n\t}", "public function hasMaps(){\n return $this->_has(15);\n }", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function tellInvalidPin()\n {\n }", "private function setUserMapPlace() {\n\t\t$this->mapPlaceManager->unsetMapPlace($this->user->id);\n\n\t\t$count = $this->mapPlaceManager->getFreeMapPlaceCount();\n\t\tif($count < 10 || GlobalConfig::ALWAYS_EXTEND_MAP ) {\n\t\t\t$mapManager = new MapManager($this->db);\n\t\t\t$mapManager->extendMap();\n\t\t}\n\t\t\t\n\t\t$mapPlace = $this->mapPlaceManager->getRandomFreeMapPlace();\n\t\t$mapPlace->userid = $this->user->id;\n\t\tif(!$mapPlace) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->mapPlaceManager->updateMapPlace($mapPlace);\n\t\t\treturn true;\n\t\t}\n\t}", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "public function test2()\n {\n $rows = $this->dataLayer->tstTestMap1(0);\n $this->assertInternalType('array', $rows);\n $this->assertCount(0, $rows);\n }", "public function isMappingSetUp()\r\n\t{\t\r\n\t\t// Return boolean\r\n\t\treturn ($this->getMappedIdFieldExternal() !== false);\r\n\t}", "protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function testPendingValidationWithMapping()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_NONE_VALIDATED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 12345\n );\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_PARTIALLY_VALIDATED,\n StripeMock::PAYMENT_INTENT_STATUS_REQUIRES_CAPTURE,\n 12345\n );\n $this->executeCommand();\n $this->assertCount(1, $messages = $this->validateReceiver->getSent());\n $this->assertCount(2, $messages[0]->getMessage()->getOrders());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public function hasMapid(){\n return $this->_has(4);\n }", "private function _checkMap()\n {\n foreach($this->_map as $alias => $field)\n {\n if(!is_array($field))\n {\n $this->_map[$alias] = array(\n self::MAP_FIELD => $field\n );\n }\n if(isset($field[self::MAP_TYPE]) && in_array($field[self::MAP_TYPE],\n self::$_relationTypes))\n {\n switch($field[self::MAP_TYPE])\n {\n case self::RELATION_PARENT:\n if(empty($field[self::MAP_KEY]) || empty($field[self::MAP_FOREIGN_KEY]))\n {\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n }\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $mapper->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $alias . ucfirst($mapper->getKeyField());\n }\n break;\n\n case self::RELATION_CHILD:\n case self::RELATION_CHILDREN:\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n /** @var Core_Entity_Mapper_Abstract */\n $mapper = $field[self::MAP_MAPPER];\n $mapper = new $mapper();\n $backRelation = $mapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n if(!isset($field[self::MAP_SAVE]))\n {\n $field[self::MAP_SAVE] = true;\n }\n if(!isset($field[self::MAP_DELETE]))\n {\n $field[self::MAP_DELETE] = true;\n }\n break;\n\n case self::RELATION_M2M:\n /** @var Core_Entity_Mapper_Abstract */\n $targetMapper = $field[self::MAP_MAPPER];\n $targetMapper = new $targetMapper();\n\n /** @var Core_Entity_Mapper_Abstract */\n $middleMapper = $field[self::MAP_MIDDLE_MAPPER];\n $middleMapper = new $middleMapper();\n if(empty($field[self::MAP_KEY]))\n {\n $field[self::MAP_KEY] = $this->getKeyField();\n }\n if(empty($field[self::MAP_FOREIGN_KEY]))\n {\n $backRelation = $middleMapper->_findRelationToMapperSettings(get_class($this),\n self::RELATION_PARENT);\n if($backRelation == null)\n {\n throw new Core_Entity_Exception('Middle Mapper Not configured for m2m relation \"' . get_class($this) . '->' . get_class($middleMapper) . '\"');\n }\n if($backRelation != null && !empty($backRelation[self::MAP_FOREIGN_KEY]))\n {\n $field[self::MAP_FOREIGN_KEY] = $backRelation[self::MAP_FOREIGN_KEY];\n }\n else\n {\n $field[self::MAP_FOREIGN_KEY] = $this->_getPureModelNameField() . ucfirst($this->getKeyField());\n }\n }\n $field[self::MAP_SAVE] = false;\n $field[self::MAP_DELETE] = false;\n break;\n\n default:\n $log = Core_Log_Manager::getInstance()->getLog('default');\n if(!empty($log))\n {\n $log->log(\"[\" . get_class($this) . \"]\\t\" . 'Unknown relation type \"' . $field[self::MAP_TYPE] . '\"',\n Zend_Log::NOTICE);\n }\n throw new Core_Entity_Exception('Unknown relation type \"' . $field[self::MAP_TYPE] . '\"');\n break;\n }\n $this->_map[$alias] = $field;\n }\n }\n }", "public function handleBeginMap() {\n\t\t$this->resetScores();\n\t}", "public function showNextMap() : string\n {\n return $this->sourceQuery->Rcon('ShowNextMap');\n }", "public function test1()\n {\n $map = $this->dataLayer->tstTestMap1(100);\n $this->assertInternalType('array', $map);\n $this->assertCount(3, $map);\n $this->assertEquals(1, $map['c1']);\n $this->assertEquals(2, $map['c2']);\n $this->assertEquals(3, $map['c3']);\n }", "public function testNext()\n {\n $this->collection->next();\n $this->assertEquals(1, $this->collection->key());\n $this->assertEquals(2, $this->collection->current());\n\n $this->collection->last();\n $this->collection->next();\n $this->assertNull($this->collection->key());\n $this->assertFalse($this->collection->current());\n }", "function onBeginMap($map, $warmUp, $matchContinuation) {\n\n\t\tforeach ($this->storage->players as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t\tforeach ($this->storage->spectators as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t}", "public function rewind()\n {\n $this->valid = (reset($this->keys) !== false);\n }", "private function testMirrors(){\n \n while(list($idx,$val)= each($this->t_mirrors)){\n\t\tif(!$this->ping(str_replace(\"http://\", \"\", $this->t_mirrors[$idx]), 80, 10)){\n unset($this->t_mirrors[$idx]);\n }else{\n $mirInUse=array();\n $mirInUse[]=$this->t_mirrors[$idx];\n $this->t_mirrors=$mirInUse;\n //var_dump($this->t_mirrors);\n return;\n }\n }\n }", "public function testAccessMappingsInvalid(): void\n {\n $helper = new AccessTokenMappingHelper();\n\n $handler = new InvalidMappingHandlerStub();\n\n $this->expectException(InvalidMappingException::class);\n $this->expectExceptionMessage(\n 'Unknown mapping format. Mapping must return a multidimensional array with a single key.'\n );\n\n $helper->buildIndexMappings($handler);\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "function newMap($map) {\n\n\t\t// log if not a restart\n\t\t$this->server->gamestate = Server::RACE;\n\t\tif ($this->restarting == 0)\n\t\t\t$this->console_text('Begin Map');\n\n\t\t// refresh game info\n\t\t$this->client->query('GetCurrentGameInfo', 1);\n\t\t$gameinfo = $this->client->getResponse();\n\t\t$this->server->gameinfo = new Gameinfo($gameinfo);\n\n\t\t// check for restarting map\n\t\t$this->changingmode = false;\n\t\tif ($this->restarting > 0) {\n\t\t\t// check type of restart and signal an instant one\n\t\t\tif ($this->restarting == 2) {\n\t\t\t\t$this->restarting = 0;\n\t\t\t} else { // == 1\n\t\t\t\t$this->restarting = 0;\n\t\t\t\t// throw postfix 'restart map' event\n\t\t\t\t$this->releaseEvent('onRestartMap2', $map);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// refresh server name & options\n\t\t$this->getServerOptions();\n\n\t\t// reset record list\n\t\t$this->server->records->clear();\n\t\t// reset player votings\n\t\t//$this->server->players->resetVotings();\n\n\t\t// create new map object\n\t\t$map_item = new Map($map);\n\n\t\t// in Rounds/Team/Cup mode if multilap map, get forced laps\n\t\tif ($map_item->laprace &&\n\t\t ($this->server->gameinfo->mode == Gameinfo::RNDS ||\n\t\t $this->server->gameinfo->mode == Gameinfo::TEAM ||\n\t\t $this->server->gameinfo->mode == Gameinfo::CUP)) {\n\t\t\t$map_item->forcedlaps = $this->server->gameinfo->forcedlaps;\n\t\t}\n\n\t\t// obtain map's GBX data, MX info & records\n\t\t$map_item->gbx = new GBXChallMapFetcher(true);\n\t\ttry\n\t\t{\n\t\t\t$map_item->gbx->processFile($this->server->mapdir . $map_item->filename);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\ttrigger_error($e->getMessage(), E_USER_WARNING);\n\t\t}\n\t\t$map_item->mx = findMXdata($map_item->uid, true);\n\n\t\t// throw main 'begin map' event\n\t\t$this->releaseEvent('onBeginMap', $map_item);\n\n\t\t// log console message\n\t\t$this->console('map changed [{1}] >> [{2}]',\n\t\t stripColors($this->server->map->name, false),\n\t\t stripColors($map_item->name, false));\n\n\t\t// check for relay server\n\t\tif (!$this->server->isrelay) {\n\t\t\t// check if record exists on new map\n\t\t\t$cur_record = $this->server->records->getRecord(0);\n\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t$score = ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t str_pad($cur_record->score, 5, ' ', STR_PAD_LEFT) :\n\t\t\t\t formatTime($cur_record->score));\n\n\t\t\t\t// log console message of current record\n\t\t\t\t$this->console('current record on {1} is {2} and held by {3}',\n\t\t\t\t stripColors($map_item->name, false),\n\t\t\t\t trim($score),\n\t\t\t\t stripColors($cur_record->player->nickname, false));\n\n\t\t\t\t// replace parameters\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_CURRENT'),\n\t\t\t\t stripColors($map_item->name),\n\t\t\t\t trim($score),\n\t\t\t\t stripColors($cur_record->player->nickname));\n\t\t\t} else {\n\t\t\t\tif ($this->server->gameinfo->mode == Gameinfo::STNT)\n\t\t\t\t\t$score = ' ---';\n\t\t\t\telse\n\t\t\t\t\t$score = ' --.--';\n\n\t\t\t\t// log console message of no record\n\t\t\t\t$this->console('currently no record on {1}',\n\t\t\t\t stripColors($map_item->name, false));\n\n\t\t\t\t// replace parameters\n\t\t\t\t$message = formatText($this->getChatMessage('RECORD_NONE'),\n\t\t\t\t stripColors($map_item->name));\n\t\t\t}\n\t\t\tif (function_exists('setRecordsPanel'))\n\t\t\t\tsetRecordsPanel('local', $score);\n\n\t\t\t// if no maprecs, show the original record message to all players\n\t\t\tif (($this->settings['show_recs_before'] & 1) == 1) {\n\t\t\t\tif (($this->settings['show_recs_before'] & 4) == 4 && function_exists('send_window_message'))\n\t\t\t\t\tsend_window_message($this, $message, false);\n\t\t\t\telse\n\t\t\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\t\t\t}\n\t\t}\n\n\t\t// update the field which contains current map\n\t\t$this->server->map = $map_item;\n\n\t\t// throw postfix 'begin map' event (various)\n\t\t$this->releaseEvent('onBeginMap2', $map_item);\n\n\t\t// show top-8 & records of all online players before map\n\t\tif (($this->settings['show_recs_before'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\tshow_maprecs($this, false, 1, $this->settings['show_recs_before']); // from chat.records2.php\n\t\t}\n\t}", "function CheckSequence()\n\t{\n\t\treturn true;\n\t}", "public function next()\n {\n $this->valid = (false !== next($this->sessionData)); \n }", "public function testRebuild()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsRebuild'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }", "public function hasMapping();", "public function adminChangeMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminChangeMap', $map, 'Changed map to');\n }", "public function testIndexAdminMaps()\n {\n parent::setUpPage();\n parent::setSession('administrator');\n\n $link = $this->webDriver->findElement(WebDriverBy::linkText('All Maps'));\n $link->click();\n $map_list = $this->webDriver->findElements(WebDriverBy::cssSelector('#usermaps > table > tbody > tr'));\n $this->assertEquals(count($map_list), 2);\n }", "public function testOffsetExists()\n\t{\n\t\t$this->assertTrue(isset($this->instance[1]));\n\t}", "private function _checkEnd($position){\r\n return $position == $this->_endPoint ? true : false;\r\n /*\r\n * If it's possible that there is no solution for labyrinth\r\n * this function should check if algorithm didn't go back to start tile\r\n */\r\n }", "private function movement_check($data) {\n if ($this->SQL->GetPlayerData(Session::get('PlayerGUID'))->AP == 0){\n $data['location_err'] = true;\n }\n // Get Player Gameboard location\n $location = $this->SQL->GetPlayerLocation(Session::get('PlayerGUID'));\n // Look up Gameboard data\n $MapData = $this->SQL->GetMap($location->ID);\n // Check if desired destination is in GetMap (stop teleportation)\n $isTooFar = true;\n foreach ($MapData as $value) {\n if ($value->ID == $data['location']){$isTooFar = false;}\n }\n // Set error flag if an error was found\n $data['HAS_ERRORS'] = true;\n if (\n empty($data['location_err']) &&\n $isTooFar == false\n ) {\n $data['HAS_ERRORS'] = false;\n }\n // Return to the controller\n return($data);\n }", "public function test_check_on_earth_valid()\n {\n $coord = new stdClass();\n $coord->x = -120;\n $coord->y = 43;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertTrue($checked);\n }", "public function has_next_page()\n {\n }", "function eat() {\n while($this->map[$this->row - 1][$this->column] == '-' or\n $this->map[$this->row][$this->column + 1] == '-' or\n $this->map[$this->row + 1][$this->column] == '-' or\n $this->map[$this->row][$this->column - 1] == '-') {\n \n $step = rand(UP, LEFT);\n switch ($step) {\n case UP:\n if($this->map[$this->row - 1][$this->column] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->row -= 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case RIGHT:\n if($this->map[$this->row][$this->column + 1] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->column += 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case DOWN:\n if($this->map[$this->row + 1][$this->column] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->row += 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n \n case LEFT:\n if($this->map[$this->row][$this->column - 1] == '-') {\n $this->map[$this->row][$this->column] = '*';\n $this->column -= 1;\n $this->map[$this->row][$this->column] = '+';\n $this->showMap();\n break;\n }\n }\n }\n }", "private function nextShard()\n\t{\n\t\t$key = current($this->keys);\n\t\tnext($this->keys);\n\t\tif ($key === false)\n\t\t\treturn false;\n\n\t\t$this->model->setShardAttribute($key);\n\t\t$sql = str_replace('{{table}}', $this->model->tableName(), $this->sql);\n\t\t$this->query = $this->model->getDbConnection()->createCommand($sql)->query($this->params);\n\n\t\treturn true;\n\t}", "function endMap($race) {\n\n\t\t// check for RestartChallenge flag\n\t\tif ($race[4]) {\n\t\t\t$this->restarting = 1;\n\t\t\t// check whether changing game mode or any player has a time/score,\n\t\t\t// then there will be ChatTime, otherwise it's an instant restart\n\t\t\tif ($this->changingmode)\n\t\t\t\t$this->restarting = 2;\n\t\t\telse\n\t\t\t\tforeach ($race[0] as $pl) {\n\t\t\t\t\tif ($pl['BestTime'] > 0 || $pl['Score'] > 0) {\n\t\t\t\t\t\t$this->restarting = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// log type of restart and signal an instant one\n\t\t\tif ($this->restarting == 2) {\n\t\t\t\t$this->console_text('Restart Map (with ChatTime)');\n\t\t\t} else { // == 1\n\t\t\t\t$this->console_text('Restart Map (instant)');\n\t\t\t\t// throw main 'restart map' event\n\t\t\t\t$this->releaseEvent('onRestartMap', $race);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// log if not a restart\n\t\t$this->server->gamestate = Server::SCORE;\n\t\tif ($this->restarting == 0)\n\t\t\t$this->console_text('End Map');\n\n\t\t// show top-8 & all new records after map\n\t\tif (($this->settings['show_recs_after'] & 2) == 2 && function_exists('show_maprecs')) {\n\t\t\tshow_maprecs($this, false, 3, $this->settings['show_recs_after']); // from chat.records2.php\n\t\t} elseif (($this->settings['show_recs_after'] & 1) == 1) {\n\t\t\t// fall back on old top-5\n\t\t\t$records = '';\n\n\t\t\tif ($this->server->records->count() == 0) {\n\t\t\t\t// display a no-new-record message\n\t\t\t\t$message = formatText($this->getChatMessage('RANKING_NONE'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t 'after');\n\t\t\t} else {\n\t\t\t\t// display new records set up this round\n\t\t\t\t$message = formatText($this->getChatMessage('RANKING'),\n\t\t\t\t stripColors($this->server->map->name),\n\t\t\t\t 'after');\n\n\t\t\t\t// go through each record\n\t\t\t\tfor ($i = 0; $i < 5; $i++) {\n\t\t\t\t\t$cur_record = $this->server->records->getRecord($i);\n\n\t\t\t\t\t// if the record is set then display it\n\t\t\t\t\tif ($cur_record !== false && $cur_record->score > 0) {\n\t\t\t\t\t\t// replace parameters\n\t\t\t\t\t\t$record_msg = formatText($this->getChatMessage('RANKING_RECORD_NEW'),\n\t\t\t\t\t\t $i+1,\n\t\t\t\t\t\t stripColors($cur_record->player->nickname),\n\t\t\t\t\t\t ($this->server->gameinfo->mode == Gameinfo::STNT ?\n\t\t\t\t\t\t $cur_record->score : formatTime($cur_record->score)));\n\t\t\t\t\t\t$records .= $record_msg;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// append the records if any\n\t\t\tif ($records != '') {\n\t\t\t\t$records = substr($records, 0, strlen($records)-2); // strip trailing \", \"\n\t\t\t\t$message .= LF . $records;\n\t\t\t}\n\n\t\t\t// show ranking message to all players\n\t\t\tif (($this->settings['show_recs_after'] & 4) == 4 && function_exists('send_window_message'))\n\t\t\t\tsend_window_message($this, $message, true);\n\t\t\telse\n\t\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\t\t}\n\n\t\t// get rankings and call endMapRanking as soon as we have them\n\t\t// $this->addCall('GetCurrentRanking', array(2, 0), false, 'endMapRanking');\n\t\tif (!$this->server->isrelay)\n\t\t\t$this->endMapRanking($race[0]);\n\n\t\t// throw prefix 'end map' event (chat-based votes)\n\t\t$this->releaseEvent('onEndMap1', $race);\n\t\t// throw main 'end map' event\n\t\t$this->releaseEvent('onEndMap', $race);\n\t}", "public function testGetCodeForInternalOffsetMethodWithOffsetOutOfMinBounds(): void\n {\n $obj = new BaseApiCodes();\n $min = Lockpick::getConstant($obj, 'RESERVED_MIN_API_CODE_OFFSET');\n\n $this->expectException(\\OutOfBoundsException::class);\n Lockpick::call($obj, 'getCodeForInternalOffset', [$min - 1]);\n }", "public function canSetTheSameOffsetSeveralTimes()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $this->assertNotSame($object0, $object1);\n $this->object[0]=$object0;\n $this->assertSame($object0, $this->object[0]);\n $this->object[0]=$object1;\n $this->assertSame($object1, $this->object[0]);\n }", "public function testGetCodeForInternalOffsetMethodWithOffsetOutOfMaxBounds(): void\n {\n $obj = new BaseApiCodes();\n $max = Lockpick::getConstant($obj, 'RESERVED_MAX_API_CODE_OFFSET');\n\n $this->expectException(\\OutOfBoundsException::class);\n Lockpick::call($obj, 'getCodeForInternalOffset', [$max + 1]);\n }", "public function toggle_ready_state() {\n\t\t$x = Server::get_instance(CONF_ENGINE_SERVER_URL)\n\t\t\t->cmd_map_chooser_ffa_toggle_ready_state($this->uid);\n\t\t$this->available_maps = (array)$x->available_maps;\n\t\t$this->chosen_map_index = $x->chosen_map_index;\n\t}", "public function test_check_on_earth_invalid()\n {\n $coord = new stdClass();\n $coord->x = -133;\n $coord->y = 5543;\n $checked = \\SimpleMappr\\Mappr::checkOnEarth($coord);\n $this->assertFalse($checked);\n }", "public function incrementFailures(): bool;", "public function testStartNextTurn()\n {\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 1;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n\n $exp = 0;\n $res = $gamestate[\"currentPoints\"];\n $this->assertEquals($exp, $res);\n\n $exp = false;\n $res = $gamestate[\"turnIsOver\"];\n $this->assertEquals($exp, $res);\n\n $exp = $this->game->getPlayer($gamestate[\"turnCounter\"]);\n $res = $gamestate[\"active\"];\n $this->assertEquals($exp, $res);\n\n $this->game->startNextTurn();\n $gamestate = $this->game->getGamestate();\n\n $exp = 0;\n $res = $gamestate[\"turnCounter\"];\n $this->assertEquals($exp, $res);\n }", "public function checkCoordinates() : void\n {\n $this->checkLatitudes();\n $this->checkLongitudes();\n }", "function beginMap($race) {\n\t\t// request information about the new map\n\t\t// ... and callback to function newMap()\n\n\t\t// if new map, check WarmUp state\n\t\tif ($race)\n\t\t\t$this->warmup_phase = $race[1];\n\n\t\tif (!$race) {\n\t\t\t$this->addCall('GetCurrentMapInfo', array(), '', 'newMap');\n\t\t} else {\n\t\t\t$this->newMap($race[0]);\n\t\t}\n\t}", "public function testConfigureAddressMapLink() {\n $field_name = $this->field->getName();\n $this->drupalGet($this->nodeDisplayEditUrl);\n $this->assertNotEmpty((bool) $this->xpath('//select[@name=\"fields[' . $field_name . '][type]\"]'), 'Address field formatter shown as required.');\n\n // Test that the summary is correct when no settings have been set.\n $this->assertTrue($this->contains('Linked Address: Not Linked'));\n $this->assertTrue($this->contains('Map Link Type'), 'true');\n $this->assertTrue($this->contains('Map Link Position'), 'true');\n }", "protected function _getNextCode() {}", "public function valid()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return isset($mapKeys[$this->iteratorPosition]);\n }", "public function next() {\n // Intentionally empty, cursor is forwaded inside valid()\n }", "public function moveMarker(): void\n {\n $ind = $this->getPlayerIndexMarker();\n $this->players[$ind]->marker = false;\n\n if (++$ind >= count($this->players)) {\n $ind = 0;\n }\n $this->players[$ind]->marker = true;\n }", "public function next(): bool;", "protected abstract function perform_next();", "#[\\ReturnTypeWillChange]\n public function rewind()\n {\n $this->valid = (reset($this->keys) !== false);\n }", "public function testRefresh()\n {\n parent::setUpPage();\n\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElements(WebDriverBy::className('toolsRefresh'))[0];\n $link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function testLoadUserMap()\n {\n parent::setUpPage();\n parent::setSession();\n $map_title = \"Sample Map User\";\n $this->webDriver->findElement(WebDriverBy::linkText('Preview'))->click();\n $default_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $link = $this->webDriver->findElement(WebDriverBy::linkText('My Maps'));\n $link->click();\n $map_link = $this->webDriver->findElement(WebDriverBy::linkText($map_title));\n $map_link->click();\n parent::waitOnMap();\n $new_img = $this->webDriver->findElement(WebDriverBy::id('mapOutputImage'))->getAttribute('src');\n $this->assertEquals($this->webDriver->findElement(WebDriverBy::id('mapTitle'))->getText(), $map_title);\n $this->assertNotEquals($default_img, $new_img);\n $this->assertContains(MAPPR_MAPS_URL, $new_img);\n }", "public function advance();", "public function fill()\n {\n // Load the serialized map.\n // If there is none or it isn't current we will generate it anew.\n if (!$this->load()) {\n $this->generate();\n }\n\n // Still here? Sounds good\n return true;\n }", "function valid() \n {\n return $this->offsetExists($this->position);\n }", "private function setmapMode(){\n\n\t\t$this->mapMode = array(\n\t\t\t'befe'=>\t$this->settings['mapMode'], /* bad content from outside ... so use properly */\n\t\t\t'isbe'=>\tstristr($this->settings['mapMode'],'backend') !== false,\n\t\t);\n\t}", "public function testIndexUserMaps()\n {\n parent::setUpPage();\n parent::setSession();\n\n $map_list = $this->webDriver->findElements(WebDriverBy::cssSelector('#usermaps > table > tbody > tr'));\n $this->assertEquals(count($map_list), 1);\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function is_valid_offset($offset)\n {\n }", "public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }", "public function processRemapStack() {}", "function verify()\n{\n $mdb2 =& GetMDB2();\n $mdb2->loadModule('Manager');\n $mdb2->loadModule('Reverse', null, true);\n\n //$indexes is an array where the key is the index name, the value is true if the index is unique\n $indexes = Index::getTableIndexList($this->module->ModuleID);\n if(isset($indexes[$this->name])){\n\n if($this->unique != $indexes[$this->name]){\n return 'update';\n }\n\n //verify index fields\n if($this->unique){\n $db_info = $mdb2->reverse->getTableConstraintDefinition($this->module->ModuleID, $this->name);\n } else {\n $db_info = $mdb2->reverse->getTableIndexDefinition($this->module->ModuleID, $this->name);\n }\n mdb2ErrorCheck($db_info);\n\n $match = true;\n reset($this->fields);\n foreach($db_info['fields'] as $db_fieldname => $db_field_props){\n $def_fieldname = key($this->fields);\n if($db_fieldname != $def_fieldname){\n $match = false;\n }\n next($this->fields);\n }\n\n if($match){\n return 'ok';\n } else {\n return 'update';\n }\n\n } else {\n return 'add';\n }\n\n}", "public function hasMapareas(){\n return $this->_has(30);\n }", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }" ]
[ "0.7176545", "0.70906556", "0.7056645", "0.6848051", "0.6822363", "0.66957504", "0.6047744", "0.59268945", "0.58230567", "0.5736064", "0.5708287", "0.5708287", "0.56693184", "0.55760986", "0.55047345", "0.5459054", "0.5459054", "0.54217076", "0.53869563", "0.5307856", "0.52699584", "0.5197039", "0.5160301", "0.50935733", "0.5080907", "0.50629574", "0.50462955", "0.5032553", "0.5014325", "0.500521", "0.49904335", "0.49853712", "0.49836656", "0.49803704", "0.4977161", "0.49741995", "0.4963396", "0.49526572", "0.49148896", "0.49054706", "0.48960218", "0.48751995", "0.48591298", "0.48572192", "0.48424363", "0.48410907", "0.48284617", "0.4824614", "0.4811818", "0.4808081", "0.4798859", "0.47971722", "0.47909075", "0.4781819", "0.4778856", "0.47568628", "0.4752449", "0.47511613", "0.4743138", "0.47298494", "0.47174266", "0.47167787", "0.4708946", "0.46954092", "0.4693398", "0.4688068", "0.46841195", "0.4675592", "0.46636948", "0.46628815", "0.46507418", "0.46465012", "0.46310112", "0.46156466", "0.46124297", "0.4611915", "0.45941675", "0.457338", "0.4571863", "0.4571134", "0.4570478", "0.4567906", "0.45646858", "0.45639527", "0.45544142", "0.45529053", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45497462", "0.45474786", "0.45464852", "0.45428118", "0.4539672", "0.45345876" ]
0.72295284
0
Verifies the restart match command does work properly
public function test_admin_restart_match() { $this->assertTrue($this->postScriptumServer->adminRestartMatch()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n }", "public function adminRestartMatch() : bool\n {\n return $this->_consoleCommand('AdminRestartMatch', '', 'Game restarted');\n }", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n\n sleep(30);\n }", "function restart()\n {\n $this->destroy();\n if( $this->_state !== 'destroyed' ) {\n // @TODO :: generated error here\n return false;\n }\n\n $this->_state = 'restart';\n\t\t$this->_start();\n\t\t$this->_state\t=\t'active';\n\n\t\t$this->_setCounter();\n\n return true;\n }", "abstract protected function _restart();", "public static function isRestart () {\n\t\tif (self::$restart == true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function restart() {\n $cmd = sprintf(\"./control.sh restart %s -game %s -ip %s -port %d -maxplayers %d -map %s -rcon %s\", $this->sid, $this->gameId, $this->ip, $this->port, $this->maxplayers, $this->map, $this->rcon);\n ssh($cmd, $this->host);\n log_action('RESTART');\n }", "protected function restart(): void\n {\n // TODO\n }", "public function restart() {\n\t\t$this->invoke(\"restart\");\n\t}", "public function adminEndMatch() : bool\n {\n return $this->_consoleCommand('AdminEndMatch', '', 'Match ended');\n }", "public function check()\n {\n if ($this->needsRestart()) {\n $this->prepareRestart($command) && $this->restart($command);\n return;\n }\n\n $originalIniScanDir = getenv(self::ENV_INI_SCAN_DIR_OLD);\n\n if ($originalIniScanDir) {\n putenv(self::ENV_INI_SCAN_DIR_OLD);\n putenv(self::ENV_INI_SCAN_DIR . '=' . $originalIniScanDir);\n } else {\n putenv(self::ENV_INI_SCAN_DIR);\n }\n }", "public function runMatch()\n {\n }", "public function assertPsKillVersion($match)\n {\n $this->assertNotEmpty($match);\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function match() {\r\n\t\treturn false;\r\n\t}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function testMatch()\n {\n $password = 'pass';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n\n $password = 'p4ss';\n $matches = LeetMatch::match($password);\n $this->assertCount(5, $matches);\n\n $password = 'p4ssw0rd';\n $matches = LeetMatch::match($password);\n $this->assertCount(11, $matches);\n\n // Test translated characters that are not a dictionary word.\n $password = '76+(';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n }", "private function prepareRestart(&$command)\n {\n $iniFiles = array();\n if ($loadedIni = php_ini_loaded_file()) {\n $iniFiles[] = $loadedIni;\n }\n\n $additional = $this->getAdditionalInis($iniFiles, $replace);\n if ($this->writeTmpIni($iniFiles, $replace)) {\n $command = $this->getCommand($additional);\n }\n\n return !empty($command) && putenv(self::ENV_ALLOW.'=1');\n }", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "public function tryresetAction() {\n return true;\n }", "private function needsRestart()\n {\n if (PHP_SAPI !== 'cli' || !defined('PHP_BINARY')) {\n return false;\n }\n\n return !getenv(self::ENV_ALLOW) && $this->loaded;\n }", "protected function isMatch()\n {\n if($this->scope!=''){\n if($this->argv[1] != $this->scope){\n return false;\n }\n }\n\n if($this->argv[2] == $this->trigger || ($this->scope=='' && $this->argv[1] == $this->trigger)) {\n $this->match = true;\n }\n\n }", "public function restart() {\n\t\t$this->resetTriggerTime();\n\t\t$this->timer->restartEvent( $this );\n\t}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n }", "public function prepareForRestart() {\n\t\tparent::prepareForRestart();\n\t}", "function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}", "public function reInit(): bool {}", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "public function restartWith(Command $command);", "protected function restart($command)\n {\n passthru($command, $exitCode);\n exit($exitCode);\n }", "function _replayTransaction() {\n\t\t// Get hold of the failed master\n\t\t$failed = $this->_strategy->getMaster();\n\n\t\t// Try to select a new master\n\t\t$master = $this->_strategy->nextMaster();\n\t\tif ($master->isNull())\n\t\t\treturn false;\n\n\t\t// Try to rollback the failed master\n\t\t$failed->_rollback();\n\n\t\t// Replay the transaction on new master\n\t\tforeach ($this->_log as $call) {\n\t\t\t$result = call_user_func_array(array($master, $call[0]), $call[1]);\n\t\t\tif (SyndLib::isError($result))\n\t\t\t\treturn $master->isAlive() ? false : $this->_replayTransaction();\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->postScriptumServer->adminEndMatch());\n }", "public function incrementFailures(): bool;", "public function checkResetCode()\n {\n return $this->resetCode()->isValid();\n }", "public function restart()\n {\n $this->destroy();\n $this->start();\n }", "function verifyRegEx(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE_REGEX));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH_REGEX));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE_REGEX));\n $this->click(CHK_REGEX);\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function reload_firewall_process() {\n $cmdStart = \"/etc/init.d/firewall reload\";\n exec($cmdStart, $output, $return_reload);\n\n\texec(\"logger -t web -p 7 \\\"\".$cmdStart.\"\\\"\");\n if((0 === $return_reload)){\n return true;\n }else{\n return false;\n }\n}", "private function detectServerRepair()\n {\n $h = date(\"H\", time());\n if ($h == \"03\") {\n Log::write(\"Server Repair Time,\", 2, \"spider\");\n sleep(3600);\n }\n }", "public function restart(): void\n {\n $this->stop();\n $this->start();\n }", "function _validate( $restart = false )\n\t{\n\t\t// allow to restsart a session\n\t\tif( $restart ) {\n\t\t\t$this->_state\t=\t'active';\n\t\t}\n\n\t\t// check if session has expired\n\t\tif( $this->_expire )\n\t\t{\n\t\t\t$curTime =\t$this->get( 'session.timer.now' , 0 );\n\t\t\t$maxTime =\t$this->get( 'session.timer.last', 0 ) + (60 * $this->_expire);\n\n\t\t\t// empty session variables\n\t\t\tif( $maxTime < $curTime ) {\n\t\t\t\t$this->_state\t=\t'expired';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "function checkHotpResync($secret, $counter, $key, $counterwindow = 2);", "public function testNewGameStartWithLoveLove()\n {\n $match = $this->getNewMatch();\n $this->assertEquals(0, $match->getScorePlayer1());\n $this->assertEquals(0, $match->getScorePlayer2());\n }", "function testResendPassword() {\n $this->assertFalse($this->oObject->resendPassword());\n }", "protected function shouldRestart($lastRestart)\n {\n return ($this->registry->get(Registry::DAEMON_KILL_KEY) !== $lastRestart);\n }", "function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }", "function restart_openvpn($ip) {\n global $config;\n $_ipv4_regex = \"/local[ ]+$ip/\";\n if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'])) {\n foreach ($config['openvpn']['openvpn-client'] as $settings) {\n if ($settings['interface'] == $ip || preg_match($_ipv4_regex, $settings['custom_options'])) {\n log_error(\"Restarting OpenVPN client instance on {$ip} because of transition of IP $ip.\");\n openvpn_restart('client', $settings);\n }\n }\n }\n if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'])) {\n foreach ($config['openvpn']['openvpn-server'] as $settings) {\n if ($settings['interface'] == $ip || preg_match($_ipv4_regex, $settings['custom_options'])) {\n log_error(\"Restarting OpenVPN instance on {$ip} because of transition of IP $ip.\");\n openvpn_restart('server', $settings);\n }\n }\n }\n}", "function testIfmatchRunsOnlyIfNotEmpty(){\n\t\t#mdx:ifmatch3\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>''])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}", "public function restart()\n {\n session_regenerate_id(true);\n $this->setup();\n }", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "protected function testErreurs()\n\t{\n\t\t$cmd = '';\n\t}", "protected function resetGame() {\n $feedback = NULL;\n while (!is_bool($feedback)) {\n echo $this->promptMessage('reset');\n $response = $this->userInput();\n $feedback = $this->simpleAnswer($response);\n if ($feedback === TRUE)\n $this->run();\n elseif ($feedback === FALSE) {\n $this->quit();\n }\n else\n echo $feedback;\n }\n }", "public function manageNotFoundExecutableAction()\n {\n $responses = $this->triggerEvent(__FUNCTION__ . '.normalAction');\n return !$responses->stopped() && $this->flowEvaluator->attemptResume();\n }", "public function restart() {\r\n\t\t$s = $this->stop();\r\n\t\t$this->start();\r\n\t\treturn $s;\r\n\t}", "public function reset_gently()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_RESTART);\n\n if ($file->exists())\n $file->delete();\n\n $file->create('root', 'root', '0644');\n $file->add_lines(\"restart requested\\n\");\n }", "function custom_rules_is_during_password_reset(){\n\treturn (arg(0) == 'user' && arg(1) == 'reset');\n}", "public function testVerifyPasswordRecoveryToken()\n {\n }", "protected static function isContainerErrorRecreate($filename)\n {\n if (basename($filename) == basename(ContainerCollection::getContainerPath())) {\n ContainerCollection::destroyCompiledContainer();\n\n if (getenv('AUTORESTART') != 1) {\n passthru('AUTORESTART=1 ' . implode(\" \", $_SERVER['argv']), $exit_code);\n exit($exit_code);\n }\n }\n }", "public function testReactivateCharError()\n {\n $request = new Request(['type' => 'reactivateChar',\n 'data' => '-666',\n 'jsoncallback' => self::CALLBACK,\n ], []);\n\n RequestWrapper::inject($request);\n $result = $this->controller->nw_json();\n $payload = $this->extractPayload($result);\n\n // There should be no such character to reactivate\n $this->assertObjectHasAttribute('error', $payload);\n }", "public function redis_Scripting_script_invalid_command()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $this->expectException(ScriptCommandException::class);\n $this->assertEquals(1, $this->redis->script('return'));\n }", "public static function restart()\n {\n $pid = file_get_contents(self::$master_pid);\n posix_kill($pid, SIGUSR1);\n\n if (!is_dir(__APP_DIR__.\"/http_process_cache\"))\n mkdir(__APP_DIR__.\"/http_process_cache\");\n\n $file = new File(__APP_DIR__.\"/http_process_cache\");\n $file->set(\"restart_\".$pid,1,6);\n\n return 1;\n }", "public function retractArms() {\n\t\techo \"Power units have not been started.<br>\";\n\t}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}", "public function runningInFallbackMode(): void\n {\n self::assertEquals(false, $this->subject->runningInFallbackMode());\n }", "public function testClearInvalidPrefix(): void\n {\n $this->exec('cache clear foo');\n $this->assertExitCode(CommandInterface::CODE_ERROR);\n $this->assertErrorContains('The `foo` cache configuration does not exist');\n }", "function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}", "function test_singleWordMatch2()\n {\n\n $test_CountRepeats = new CountRepeats;\n $word = \"loop\";\n $phrase = \"This loop is a never ending loop.\";\n\n $result = $test_CountRepeats->RepeatCounter($word, $phrase);\n\n $this->AssertEquals(2, $result);\n }", "function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }", "protected function check_string()\n {\n $string_regex = \"/^string@.*/\";\n $backslash_regex = \"/\\\\\\/\";\n $escape_regex = \"/\\\\\\[0-9]{3}/\";\n $test = preg_match($escape_regex, $this->token);\n $result = preg_match($string_regex, $this->token);\n // checks if token is string\n if($result)\n {\n $backslashes = preg_match_all($backslash_regex, $this->token);\n // if token has backslashes\n if($backslashes > 0)\n {\n // get count of sequences\n $escapes = preg_match_all($escape_regex, $this->token);\n // if there is not same number of escapes and sequences = error\n if($escapes != $backslashes)\n {\n fwrite(STDERR, \"Error, wrong escape sequence!\\n\");\n exit(23);\n }\n }\n }\n }", "public function testROIProtectionResettingSentinel ()\n {\n\n $poc2 = $this->pocContainer['poc'];\n $cia2 = $this->pocContainer['cia'];\n $rnd = rand();\n $poc2->addPlugin($cia2);\n $cia2->setSentinel(1);\n $noh2 = $this->pocContainer['noh'];\n $noh2->pocBurner($poc2, $rnd);\n\n $this->assertNotEquals($cia2->getRefreshPage(), $noh2->getOutput());\n $this->assertEquals($cia2->getSentinel(), 0);\n\n //todo: check why it is not working!!\n //$this->assertequals($rnd, $noh2->getOutput());\n\n }", "public function restart( $args, $assoc_args ) {\n\t\t$this->site_docker_compose_execute( $args[0], 'restart', $args, $assoc_args);\n\t}", "public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }", "public function testReset()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->reset('+456')\n );\n\n // Assert true when there is value cached\n $this->assertTrue(\n SmsVerification::of($this->config)->reset('+123')\n );\n }", "public function testRunParityGame()\n\t{\n\t\t$this->assertIsArray(ParityGame\\runParityGame());\n\t\t$this->assertCount(3, ParityGame\\runParityGame());\n\t}", "public function canRetry() : bool;", "public function replay() {\r\n $this->mockState = new ReplayState($this->expectionMap);\r\n }", "public function reloadServer(): void\n {\n [\n 'state' => [\n 'host' => $host,\n 'rpcPort' => $rpcPort,\n ],\n ] = $this->serverStateFile->read();\n\n tap($this->processFactory->createProcess([\n $this->findRoadRunnerBinary(),\n 'reset',\n '-o', \"rpc.listen=tcp://$host:$rpcPort\",\n '-s',\n ], base_path()))->start()->waitUntil(function ($type, $buffer) {\n if ($type === Process::ERR) {\n throw new RuntimeException('Cannot reload RoadRunner: '.$buffer);\n }\n\n return true;\n });\n }", "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "public function restart($id);", "public function reload()\n {\n if ($this->config['server_type'] == 'process') {\n $pid = $this->getPid('worker');\n } else {\n $pid = $this->getPid('master');\n }\n\n if (empty($pid)) {\n echo \"{$this->config['process_name']} has not process\" . PHP_EOL;\n return false;\n }\n\n exec(\"kill -USR1 \" . implode(' ', $pid), $output, $return);\n\n if ($return === false) {\n echo \"{$this->config['process_name']} reload fail\" . PHP_EOL;\n return false;\n }\n echo \"{$this->config['process_name']} reload success\" . PHP_EOL;\n return true;\n }", "function checkStart(){\r\n\tif (!$this->Eq['A']['id']) $this->sendError(\"你沒有裝備武器,不能出擊。\");\r\n\telseif ($this->Player['en'] < $this->RequireEN) $this->sendError(\"EN不足,無法出擊。\");\r\n\telseif ($this->Player['sp'] < $this->SP_Cost) $this->sendError(\"SP不足,無法以 $Pl->Tactics[name] 出擊。\");\r\n}", "function resetSequence(): bool {\n return true;\n }", "private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }", "function errorlog_is_fail2ban() {\n return true; //exec() ps ef | grep python.*fail2ban-server;\n}", "function check(){\r\n if ( file_get_contents(sys_get_temp_dir().\"/{$this->file_name}\") != 'run' ) {\r\n exit('Script was canceled by file deletion.') ;\r\n }\r\n }", "public function serverDownShouldModerate(){\r\n\t\t$args = array (\r\n\t\t\t'k' => $this->accountID,\r\n\t\t\t'pwd' => $this->privateKey,\r\n\t\t\t'lofi' => $this->languageOrFrameworkID,\r\n\t\t\t'lofv' => $this->languageOrFrameworkVersion\r\n\t\t);\r\n\t\t$xmlresponse = $this->postData($this->baseURL,\"/checkStatus\",$this->useSSL,$args);\r\n\t\t$retVal = false;\r\n\t\tif ($xmlresponse){\r\n\t\t\t$doc = DOMDocument::loadXML($xmlresponse);\r\n\t\t\tif ($doc){\r\n\t\t\t\t$isRunningResponse = $doc->getElementsByTagName('isRunning');\r\n\t\t\t\tif (!($isRunningResponse && $isRunningResponse->item(0))){\r\n\t\t\t\t\t$retVal = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$retVal = !($this->strToBoolean($isRunningResponse->item(0)->nodeValue));\r\n\t\t\t\t\tif (!$retVal){\r\n\t\t\t\t\t\t$secondsSinceLastDowntime = $doc->getElementsByTagName('SecondsSinceLastDowntime')->item(0)->nodeValue;\r\n\t\t\t\t\t\t$secondsSinceLastRestart = $doc->getElementsByTagName('SecondsSinceLastRestart')->item(0)->nodeValue;\r\n\t\t\t\t\t\tif ($this->timeToCompleteForm > $secondsSinceLastRestart && $this->timeToCompleteForm < $secondsSinceLastDowntime){\r\n\t\t\t\t\t\t\t$retVal = true;\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}else{\r\n\t\t\t\t$retVal = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$retVal = true;\r\n\t\t}\r\n\t\treturn $retVal;\r\n\t}", "public function handle_exit_recovery_mode()\n {\n }", "function test_singleWordMatch()\n {\n\n $test_CountRepeats = new CountRepeats;\n $word = \"loop\";\n $phrase = \"This loop is never ending.\";\n\n $result = $test_CountRepeats->RepeatCounter($word, $phrase);\n\n $this->AssertEquals(1, $result);\n }", "protected function _validate($restart = false)\n {\n if ($restart)\n {\n $this->_state = 'active';\n\n $this->set('session.client.address', null);\n $this->set('session.client.forwarded', null);\n $this->set('session.client.browser', null);\n $this->set('session.token', null);\n }\n\n // Check if session has expired\n if ($this->_expire)\n {\n $curTime = $this->get('session.timer.now', 0);\n $maxTime = $this->get('session.timer.last', 0) + $this->_expire;\n\n // Empty session variables\n if ($maxTime < $curTime)\n {\n $this->_state = 'expired';\n\n return false;\n }\n }\n\n // Check for client address\n if (in_array('fix_adress', $this->_security) && isset($_SERVER['REMOTE_ADDR'])\n && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP) !== false)\n {\n $ip = $this->get('session.client.address');\n\n if ($ip === null)\n {\n $this->set('session.client.address', $_SERVER['REMOTE_ADDR']);\n }\n elseif ($_SERVER['REMOTE_ADDR'] !== $ip)\n {\n $this->_state = 'error';\n\n return false;\n }\n }\n\n // Record proxy forwarded for in the session in case we need it later\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP) !== false)\n {\n $this->set('session.client.forwarded', $_SERVER['HTTP_X_FORWARDED_FOR']);\n }\n\n return true;\n }", "public function testRegistrationPasswordsDontMatch(): void { }", "function resubmitFailures() {\n\tglobal $gStatusTable, $gErrBase;\n\t$cmd = \"update $gStatusTable set status=0, wptid='', wptRetCode='', medianRun=0 where status >= $gErrBase;\";\n\tdoSimpleCommand($cmd);\n}", "public function testResetPassword()\n\t{\n\t\t$return = $this->auth->requestReset($this->email);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.email_incorrect\"));\n\n\t\t$return = $this->auth->requestReset($this->newEmail);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.reset_requested\"));\n\n\t\t$uid = $this->auth->getUID($this->newEmail);\n\t\t$token = $this->auth->getUserRequestToken($uid, 'reset');\n\n\t\t// test invalid token length\n\t\t$return = $this->auth->resetPass(substr($token, 0, 5), $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_invalid'));\n\n\t\t// test incorrect token value\n\t\t$return = $this->auth->resetPass('1234567890ABCDEFGHIJ', $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_incorrect'));\n\n\t\t// test reset with weak password\n\t\t$return = $this->auth->resetPass($token, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\n\t\t// test reset with unmacth password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_nomatch'));\n\n\t\t$currentPassword = 'user@PRO#123';\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $currentPassword, $currentPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_match'));\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->password);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_reset'));\n\n\t\t$this->auth->login($this->newEmail, $this->password);\n\n\t\t$this->assertTrue($this->auth->isLogged());\n\t}", "public function testMatchingSubstringContainingRegexMetachars() {\n\t\techo 'This will match (me). Will it ? And \\[not\\] break on regex metachars';\n\n\t\t$this->expectOutputContains( 'match (me). Will it ? And \\[' );\n\t}", "public function test_with_invalid_number_drain()\n {\n $this->artisan('play:game')\n ->expectsQuestion('Enter A team players:', '18,20,50,40')\n ->expectsQuestion('Enter B team players:', '35, 10, 30, 20, 90')\n ->expectsOutput(\"Match can not play 5 players allowed each team\")\n ->assertExitCode(0);\n }", "protected function restartAgent($data) {\n \n $command = \"\";\n $bp = new utils\\BackgroundProcess($command);\n }", "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 function testClearValidPrefix(): void\n {\n Cache::add('key', 'value', 'test');\n $this->exec('cache clear test');\n\n $this->assertExitCode(CommandInterface::CODE_SUCCESS);\n $this->assertNull(Cache::read('key', 'test'));\n }", "public function testResetPassword()\n {\n }" ]
[ "0.73609245", "0.7221903", "0.7208859", "0.6367601", "0.6331943", "0.6096358", "0.5967439", "0.5864611", "0.5577808", "0.55695707", "0.5523084", "0.5491819", "0.54550093", "0.5379564", "0.53795165", "0.5377231", "0.53632176", "0.53461796", "0.52655584", "0.5247932", "0.52356416", "0.52259165", "0.5214308", "0.5205883", "0.5202957", "0.5194102", "0.5178206", "0.51615804", "0.51572865", "0.5142869", "0.51374686", "0.5129407", "0.51285833", "0.5117734", "0.51110595", "0.5102259", "0.5096918", "0.50758624", "0.5066329", "0.5058004", "0.5034654", "0.5031627", "0.5024134", "0.5010815", "0.50068", "0.49845138", "0.49688292", "0.49674848", "0.49512902", "0.4950856", "0.49387616", "0.49276915", "0.4927259", "0.49052292", "0.4866839", "0.4859494", "0.4850131", "0.48476863", "0.48445547", "0.4835316", "0.4826141", "0.48211056", "0.4820473", "0.48113352", "0.48109412", "0.47943556", "0.47923395", "0.4788122", "0.47847083", "0.47779566", "0.4771772", "0.4763441", "0.4762951", "0.47595143", "0.47592658", "0.47452012", "0.4733628", "0.47176474", "0.4715602", "0.4713875", "0.4706816", "0.46938512", "0.4686863", "0.4679362", "0.4673935", "0.46649164", "0.46491477", "0.46415704", "0.46382388", "0.46324685", "0.46311575", "0.46238157", "0.46137258", "0.4611166", "0.46011478", "0.4600222", "0.4600214", "0.45996553", "0.4597778", "0.4589116" ]
0.7437495
0
Verifies the end match command does work properly
public function test_admin_end_match() { $this->assertTrue($this->postScriptumServer->adminEndMatch()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function adminEndMatch() : bool\n {\n return $this->_consoleCommand('AdminEndMatch', '', 'Match ended');\n }", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n }", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function match() {\r\n\t\treturn false;\r\n\t}", "protected function ends()\n {\n static $re_all = '/^[\\h\\v]*$/';\n static $re_nnl = '/^[\\h]*$/';\n \n if ($this->data === null)\n return true;\n \n // if $tnl (track new lines) is true: use \\h, else: use \\h\\v\n return preg_match($this->tnl ? $re_nnl : $re_all, $this->data);\n }", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "public final function __end() : bool {\n\t\t\treturn false;\n\t\t}", "public function testExactMatchWithExpectationAfterOutput() {\n\t\techo 'foobar';\n\t\t$this->expectOutputContains( 'foobar' );\n\t}", "abstract protected function isEndToken(string $token) : bool;", "protected function _detectCompletionAndEnd()\n {\n// detect if the output has completed, and if it does\n// delete the output file and stop the loop.\n if($this->_detectCompletionBoundaryInOutput() === true)\n {\n $this->deleteOutputFile();\n $this->stop();\n }\n else if($this->_detectFailureBoundaryInOutput() === true)\n {\n $this->_error_code = $this->_getErrorCodeInOutput();\n }\n }", "public function runMatch()\n {\n }", "abstract protected function doEnd();", "public function testSendingOutputWithMismatchedLineEndingAmount() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingAmountTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function hasEnd(){\n return $this->_has(3);\n }", "public function hasEnd(){\n return $this->_has(3);\n }", "public function testSendingOutputWithMismatchedLineEndings() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingsTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function ends()\n {\n return $this->endRepeat !== \"never\";\n }", "protected function eof() { \n\t\treturn !isset($this->lines[$this->cursor]); \n\t}", "protected function isMatch()\n {\n if($this->scope!=''){\n if($this->argv[1] != $this->scope){\n return false;\n }\n }\n\n if($this->argv[2] == $this->trigger || ($this->scope=='' && $this->argv[1] == $this->trigger)) {\n $this->match = true;\n }\n\n }", "private function searchMustEnd(): bool\n {\n return in_array($this->search->fresh()->status, [\n Search::STATUS_FINISHED,\n Search::STATUS_FAILED,\n Search::STATUS_PAUSED\n ]);\n }", "function endCase() {\n\t}", "public function end() {}", "public function end() {}", "public function end() {}", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function message()\n {\n return 'This match has ended.';\n }", "public function end($end);", "public function end();", "public function end();", "public function end();", "public function end();", "public function testExactMatchWithExpectationBeforeOutput() {\n\t\t$this->expectOutputContains( 'foobar' );\n\t\techo 'foobar';\n\t}", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "public function testObEnd()\n {\n\n $tracy = new Tracy();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n\n $tracy->obStart();\n $tracy->obEnd();\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n }", "public function testMatchingSubstringsWithMismatchedLineEndingsAmount( $expected ) {\n\t\techo 'The quick brown fox\n\n\njumps over the lazy dog';\n\n\t\t$this->expectOutputContains( $expected, true );\n\t}", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "public function testMatch()\n {\n $password = 'pass';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n\n $password = 'p4ss';\n $matches = LeetMatch::match($password);\n $this->assertCount(5, $matches);\n\n $password = 'p4ssw0rd';\n $matches = LeetMatch::match($password);\n $this->assertCount(11, $matches);\n\n // Test translated characters that are not a dictionary word.\n $password = '76+(';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n }", "public function streamStatementEnd( &$sql, &$newLine ) {\n\t\tif ( $this->delimiter ) {\n\t\t\t$prev = $newLine;\n\t\t\t$newLine = preg_replace( '/' . preg_quote( $this->delimiter, '/' ) . '$/', '', $newLine );\n\t\t\tif ( $newLine != $prev ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function end();", "private function _checkEnd($position){\r\n return $position == $this->_endPoint ? true : false;\r\n /*\r\n * If it's possible that there is no solution for labyrinth\r\n * this function should check if algorithm didn't go back to start tile\r\n */\r\n }", "public function testMatchingSubstringContainingRegexMetachars() {\n\t\techo 'This will match (me). Will it ? And \\[not\\] break on regex metachars';\n\n\t\t$this->expectOutputContains( 'match (me). Will it ? And \\[' );\n\t}", "public function end(): void\n {\n }", "private function checkFinished( $status )\r\n\t{\r\n\t\t$final = \"\"; // response if found\r\n\r\n\t\tif ( strpos( $status,\"START\") !== false ) {\r\n\t\t} else if ( strpos( $status,\"FIND\") !== false ) {\r\n\t\t} else if ( strpos( $status,\"FORK\") !== false ) {\r\n\t\t} else if ( strpos( $status,\"FETCH\") !== false ) {\r\n\t\t} else if ( strpos( $status,\"DONE1\") !== false && $this->return_quick == false ) {\r\n\t\t} else if ( strpos( $status,\"DONE2\") !== false ) {\r\n\t\t} else if ( strpos( $status,\"DONE3\") !== false ) {\r\n\t\t} else {\r\n\t\t\t$final = \"Done\";\r\n\t\t}\r\n\r\n\t\tif ( $final == \"\" )\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function isLastPartOfStringReturnsInvalidArgumentDataProvider() {}", "function compare_results(&$matcher, &$expected, &$obtained, &$ismatchpassed, &$fullpassed, &$indexfirstpassed, &$indexlastpassed, &$nextpassed, &$leftpassed) {\n $ismatchpassed = ($expected['is_match'] == $obtained['is_match']);\n $fullpassed = ($expected['full'] == $obtained['full']);\n $result = $ismatchpassed && $fullpassed;\n if ($obtained['is_match'] && $expected['is_match']) { // TODO - what if we need a character with no match?\n // checking indexes\n if ($matcher->is_supporting(preg_matcher::SUBPATTERN_CAPTURING)) {\n $indexfirstpassed = ($expected['index_first'] == $obtained['index_first']);\n $indexlastpassed = ($expected['index_last'] == $obtained['index_last']);\n } else {\n $indexfirstpassed = ($expected['index_first'][0] == $obtained['index_first'][0]);\n $indexlastpassed = ($expected['index_last'][0] == $obtained['index_last'][0]);\n }\n // checking next possible character\n if ($matcher->is_supporting(preg_matcher::NEXT_CHARACTER)) {\n $nextpassed = (($expected['next'] === '' && $obtained['next'] === '') || // both results are empty\n ($expected['next'] !== '' && $obtained['next'] !== '' && strstr($expected['next'], $obtained['next']) != false)); // expected 'next' contains obtained 'next'\n } else {\n $nextpassed = true;\n }\n // checking number of characters left\n if ($matcher->is_supporting(preg_matcher::CHARACTERS_LEFT)) {\n $leftpassed = in_array($obtained['left'], $expected['left']);\n } else {\n $leftpassed = true;\n }\n $result = $result && $indexfirstpassed && $indexlastpassed && $nextpassed && $leftpassed;\n } else {\n $indexfirstpassed = true;\n $indexlastpassed = true;\n $nextpassed = true;\n $leftpassed = true;\n }\n return $result;\n }", "protected function match()\n {\n if ($this->position >= $this->length) {\n $this->stream[] = new Token(\n Tokens::T_EOF,\n null,\n $this->position\n );\n\n return false;\n }\n\n // if we don't get any matches move the position to the end of the file\n // and return true so we can get an EOF token on the next round.\n if (!preg_match($this->regex, $this->input, $matches, PREG_OFFSET_CAPTURE, $this->position)) {\n $this->position = $this->length;\n return true;\n }\n\n // if we're heare we found some tokens\n $c = count($matches);\n for ($i = 1; $i < $c; $i++) {\n if ('' === $matches[$i][0] || !isset($this->name_cache[$i-1])) {\n continue;\n }\n\n // move the position to our found offset\n $this->position = $matches[$i][1];\n\n $this->stream[] = new Token(\n $this->name_cache[$i-1],\n $matches[$i][0],\n $this->position\n );\n\n break;\n }\n\n $this->position += strlen($matches[0][0]);\n\n return true;\n }", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "public function end()\n {\n }", "public function testHandleWindowEnd()\n {\n $this->expectException(\\Dvsa\\Olcs\\Api\\Domain\\Exception\\ValidationException::class);\n $this->expectExceptionMessage('Windows which have ended cannot be edited');\n\n $cmdData = [\n 'id' => 1,\n 'irhpPermitStock' => 1,\n 'startDate' => '2017-12-01',\n 'endDate' => '2017-12-30',\n ];\n\n $command = UpdateCmd::create($cmdData);\n\n $permitWindowEntity = m::mock(PermitWindowEntity::class);\n\n $this->repoMap['IrhpPermitWindow']\n ->shouldReceive('fetchById')\n ->with($cmdData['id'])\n ->andReturn($permitWindowEntity);\n\n $permitWindowEntity\n ->shouldReceive('hasEnded')\n ->once()\n ->andReturn(true);\n\n $this->sut->handleCommand($command);\n }", "public function eof() {}", "protected function _isEndKey( $key )\n {\n $endReadingKey = $this->_options[self::OPT_END_READING_KEY];\n return ( 0 === strcmp( $key, $endReadingKey ) );\n }", "public function eof(): bool;", "protected function end() {\n // must have space after it\n return 'END ';\n }", "function mEOL(){\n try {\n // Tokenizer11.g:622:3: ( '\\\\n' | '\\\\r' ) \n // Tokenizer11.g: \n {\n if ( $this->input->LA(1)==$this->getToken('10')||$this->input->LA(1)==$this->getToken('13') ) {\n $this->input->consume();\n\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function ended();", "function check_str_end(string $string, string $end, int $len, $endLength): bool\n{\n return substr($string, $len - $endLength, $endLength) == $end;\n}", "protected function parseEnd()\n {\n return ($end = $this->matchChar(';')) ? $end : $this->peekChar('}');\n }", "public function checkToAddTrailingStop() {\n if (!$this->backtesting) {\n ///Handle Real Live Stuff\n }\n else {\n if ($this->openPosition['gl'] >= $this->optionalTrailingStopAmount) {\n $this->addTrailingStopToPosition($this->optionalTrailingStopAmount);\n }\n }\n }", "public function checkTimeEnd(): bool;", "function eol_identify(){\n global $token;\n\n get_token();\n if($token->type !== tokenType::EOL){\n fwrite(STDERR, \"ERROR : SYNTAX : End of line <eol> expected : last token: $token->data\\n\");\n exit(23);\n }\n }", "function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}", "public function testFailingOnMismatchedExpectation() {\n\t\t$test = new IncorrectOutputSingleExpectationTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertStringContainsString(\n\t\t\t\"Failed asserting that 'The quick brown fox jumps over the lazy dog' matches PCRE pattern \\\"#\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "function processEndBlockCmd ($parms, $cmdTPosBegin, $cmdTPosEnd) {\n $p = 0;\n if (!$this->parseWord($parms,$p,$blockName)) {\n $this->triggerError (\"Missing block name in \\$EndBlock command in template at offset $cmdTPosBegin.\");\n return false; }\n if (trim(substr($parms,$p)) != '') {\n $this->triggerError (\"Extra parameter in \\$EndBlock command in template at offset $cmdTPosBegin.\");\n return false; }\n if (!$this->lookupBlockName($blockName,$blockNo)) {\n $this->triggerError (\"Undefined block name \\\"$blockName\\\" in \\$EndBlock command in template at offset $cmdTPosBegin.\");\n return false; }\n $this->currentNestingLevel -= 1;\n $btr =& $this->blockTab[$blockNo];\n if (!$btr['definitionIsOpen']) {\n $this->triggerError (\"Multiple \\$EndBlock command for block \\\"$blockName\\\" in template at offset $cmdTPosBegin.\");\n return false; }\n if ($btr['nestingLevel'] != $this->currentNestingLevel) {\n $this->triggerError (\"Block nesting level mismatch at \\$EndBlock command for block \\\"$blockName\\\" in template at offset $cmdTPosBegin.\");\n return false; }\n $btr['tPosContentsEnd'] = $cmdTPosBegin;\n $btr['tPosEnd'] = $cmdTPosEnd;\n $btr['definitionIsOpen'] = false;\n return true; }", "public function assertConsoleOutputContains($match)\r\n {\r\n $response = $this->getResponse();\r\n if (false === stripos($response->getContent(), $match)) {\r\n throw new PHPUnit_Framework_ExpectationFailedException(sprintf(\r\n 'Failed asserting output CONTAINS content \"%s\", actual content is \"%s\"',\r\n $match, $response->getContent()\r\n ));\r\n }\r\n $this->assertNotSame(false, stripos($response->getContent(), $match));\r\n }", "function testIfmatchRunsOnlyIfNotEmpty(){\n\t\t#mdx:ifmatch3\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>''])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}", "private function completeMatch($match) {\r\n \t$match->isCompleted = TRUE;\r\n \t \r\n \tforeach ($this->_observers as $observer) {\r\n \t\t$observer->onMatchCompleted($match);\r\n \t}\r\n \t\r\n \t// trigger plug-ins\r\n \t$event = new MatchCompletedEvent($this->_websoccer, $this->_db, I18n::getInstance($this->_websoccer->getConfig('supported_languages')), \r\n \t\t\t$match);\r\n \tPluginMediator::dispatchEvent($event);\r\n }", "public function testTrueEndsWith()\n {\n $this->assertTrue(Str::endsWith('foo', 'o'));\n }", "public function testEndToEnd()\n {\n $transactions = $this->controller->main(\"input.csv\");\n\n $this->assertEquals([0.60, 3.00, 0.00, 0.06, 1.50, 0.00, 0.69, 0.30, 0.30, 3.00, 0.00, 0.00, 8611.41], $transactions);\n }", "public function endOfTokens(int $position = 0): bool {\n return parent::endOfTokens($position);\n }", "public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }", "public function sendReplyEnd()\n {\n }", "function StartEnd($v)\n{\n\treturn (preg_match(\"/^\\*\\*\\* (?:START|END)/m\",$v));\n}", "public function assertNotConsoleOutputContains($match)\r\n {\r\n $response = $this->getResponse();\r\n if (false !== stripos($response->getContent(), $match)) {\r\n throw new PHPUnit_Framework_ExpectationFailedException(sprintf(\r\n 'Failed asserting output DOES NOT CONTAIN content \"%s\"',\r\n $match\r\n ));\r\n }\r\n $this->assertSame(false, stripos($response->getContent(), $match));\r\n }", "function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}", "public function testTermAtEndOfCoverageFailure(){\n $coverage = array(\"name\" => \"120 Months/120,000 Miles\", \"terms\" => 120, \"miles\" => 120000);\n $test_car = CarFactory::create('Audi', 24, 10000, 100000, 2010, 42);\n $test_car->setVehicleAgeMonths();\n $test_fail = $test_car->testTermAtEndOfCoverage($coverage);\n $this->assertEquals($test_fail, 'Age above 147 months before end of new coverage.');\n }", "public function stream_eof() {\r\n\t\treturn $this->pos >= strlen($this->data);\r\n\t}", "public function testGetEnd(): void\n {\n $model = ProcessMemoryMap::load([\n \"end\" => \"end\",\n ], $this->container);\n\n $this->assertSame(\"end\", $model->getEnd());\n }", "public function eof();", "public function eof();", "public function stream_eof()\n {\n return ($this->_pos >= strlen($this->_pointer));\n }", "public function eof(): bool\n {\n return $this->content->eof();\n }", "public function isEnded() {}", "public function eof() : bool {\n return !$this->append && ($this->offset >= $this->size);\n }", "public function isEOF()\n {\n if ($this->chunkOffset === $this->numChunks - 1) {\n return $this->bufferOffset >= $this->expectedLastChunkSize;\n }\n\n return $this->chunkOffset >= $this->numChunks;\n }", "public function getEnd() {}", "private function get_is_terminated(): bool\n\t{\n\t\treturn $this->status === self::STATUS_TERMINATED;\n\t}", "public function impliesPositioningCursorAtTheEnd()\n {\n return $this->base == 'a';\n }", "public function getCharEnd();", "public function matches( Match_Target $target );", "public function eof()\n {\n }", "public function match( $data );", "function verifyRegEx(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE_REGEX));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH_REGEX));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE_REGEX));\n $this->click(CHK_REGEX);\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "protected function validateEnd($index) {\n\t\tif (!isset($this->end[$index])) {\n\t\t\t$this->end($index);\n\t\t}\n\t}", "public function assertPsKillVersion($match)\n {\n $this->assertNotEmpty($match);\n }", "function do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed, $assertionstrue = false) {\n $this->assertTrue($assertionstrue || $ismatchpassed, \"$matchername failed 'is_match' check on regex '$regex' and string '$str'\");\n if (!$ismatchpassed) {\n echo 'obtained result ' . $obtained['is_match'] . ' for \\'is_match\\' is incorrect<br/>';\n }\n $this->assertTrue($assertionstrue || $fullpassed, \"$matchername failed 'full' check on regex '$regex' and string '$str'\");\n if (!$fullpassed) {\n echo 'obtained result ' . $obtained['full'] . ' for \\'full\\' is incorrect<br/>';\n }\n if (array_key_exists('index_first', $obtained)) {\n $this->assertTrue($assertionstrue || $indexfirstpassed, \"$matchername failed 'index_first' check on regex '$regex' and string '$str'\");\n if (!$indexfirstpassed) {\n echo 'obtained result '; print_r($obtained['index_first']); echo ' for \\'index_first\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('index_last', $obtained)) {\n $this->assertTrue($assertionstrue || $indexlastpassed, \"$matchername failed 'index_last' check on regex '$regex' and string '$str'\");\n if (!$indexlastpassed) {\n echo 'obtained result '; print_r($obtained['index_last']); echo ' for \\'index_last\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('next', $obtained)) {\n $this->assertTrue($assertionstrue || $nextpassed, \"$matchername failed 'next' check on regex '$regex' and string '$str'\");\n if (!$nextpassed) {\n echo 'obtained result \\'' . $obtained['next'] . '\\' for \\'next\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('left', $obtained)) {\n $this->assertTrue($assertionstrue || $leftpassed, \"$matchername failed 'left' check on regex '$regex' and string '$str'\");\n if (!$leftpassed) {\n echo 'obtained result \\'' . $obtained['left'] . '\\' for \\'left\\' is incorrect<br/>';\n }\n }\n }", "public function testIterationEnd(): void\n {\n foreach ($this->variant as $iteration) {\n foreach (TestUtil::createResults(10, 10) as $result) {\n $iteration->setResult($result);\n }\n }\n $this->variant->computeStats();\n\n $this->logger->variantEnd($this->variant);\n $display = $this->output->fetch();\n $this->assertStringContainsString(\n '1 (σ = 0.000ms ) -2σ [ █ ] +2σ summary',\n $display\n );\n }", "public function isEnded();", "public function stream_eof()\r\n {\r\n return $this->_pos >= strlen($this->_data);\r\n }", "public function atEnd( ezcTemplateCursor $cursor, /*ezcTemplateTstNode*/ $operator, $finalize = true )\n {\n if ( $cursor->current() == ')' )\n {\n return true;\n }\n else if ( $this->readingParameter && $cursor->current() == ',' )\n {\n return true;\n }\n return false;\n }" ]
[ "0.74820113", "0.6888107", "0.63732845", "0.6371162", "0.62928724", "0.61902434", "0.60692745", "0.59760344", "0.5940732", "0.5898977", "0.58609116", "0.5847114", "0.58043635", "0.5791831", "0.57390827", "0.57390827", "0.57345915", "0.5734372", "0.5659402", "0.5623187", "0.56207675", "0.56113243", "0.5605275", "0.5605275", "0.5605275", "0.55550283", "0.54876643", "0.54857874", "0.5485079", "0.5485079", "0.5485079", "0.5485079", "0.54835206", "0.54411274", "0.54291165", "0.53975844", "0.5370178", "0.53609794", "0.5349914", "0.5340505", "0.5333877", "0.5322724", "0.5317776", "0.5316905", "0.5314245", "0.5307718", "0.52969927", "0.5295108", "0.52945304", "0.5289928", "0.5288772", "0.52794397", "0.52730036", "0.52639425", "0.52625537", "0.5258164", "0.5225794", "0.5222011", "0.521339", "0.52117914", "0.5165213", "0.5163328", "0.51586705", "0.5152096", "0.5145065", "0.5130769", "0.5124751", "0.51124096", "0.5111881", "0.51113147", "0.5109105", "0.5100516", "0.50995", "0.5098179", "0.50953215", "0.50939083", "0.5088385", "0.50882643", "0.5084174", "0.5084174", "0.50819606", "0.5065218", "0.5063339", "0.5046507", "0.50404763", "0.50397867", "0.5037781", "0.5030432", "0.50215536", "0.50074357", "0.5001403", "0.49985012", "0.49964035", "0.4993852", "0.49919978", "0.49885243", "0.49872732", "0.4987249", "0.4985575", "0.4985006" ]
0.69672436
1
Verifies the admin set max num players command does work properly
public function test_admin_set_max_num_players() { $this->assertTrue($this->postScriptumServer->adminSetMaxNumPlayers(78)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function adminSetMaxNumPlayers(int $slots) : bool\n {\n return $this->_consoleCommand('AdminSetMaxNumPlayers', $slots, 'Set MaxNumPlayers to ' . $slots);\n }", "public function getMaxPlayers(): int;", "function check_max_number_of_members($value)\n{\n\t$max_member_no_limit = $value['max_member_no_limit'];\n\tif ($max_member_no_limit == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\t$max_member = $value['max_member'];\n\treturn is_numeric($max_member);\n}", "public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"max_players\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }", "private function setNumOfPlayers(int $num) : int\n {\n\t\t$minUserNum = 2;\n\t\t$maxUserNum = count($this->availablePlayerNames);\n\n if ($num <= $minUserNum) {\n $num = $minUserNum;\n\t\t}\n\n\t\tif ($num > $maxUserNum) {\n\t\t\t$num = $maxUserNum;\n\t\t}\n\n\t\t$this->numOfPlayers = $num;\n\t\t\n\t\treturn $this->numOfPlayers;\n }", "public function setMaxPlayers(int $int) {\r\n\r\n return $this->getMain()->getDatabase()->set(\"max_players\", $int, [\"table\" => \"Games\", \"name\" => $this->getName()]);\r\n\r\n }", "function zg_ai_have_num_players($num_players) {\n\n // Goal: $num players across the game.\n $sql = 'select count(id) as count from users\n where meta like \"ai_%\";';\n $result = db_query($sql);\n $item = db_fetch_object($result);\n firep($item, 'ai item');\n $count = (int) $item->count;\n\n zg_ai_out(\"want $num_players players, have $count\");\n\n if ($count >= $num_players) {\n // zg_ai_out('woohoo! we have enough players! returning TRUE');.\n return TRUE;\n }\n\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n return FALSE;\n}", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasMaxTeam(){\n return $this->_has(7);\n }", "public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxTeams(){\n return $this->_has(11);\n }", "function validate_players ($gender)\n{\n // Build the indicies into the $_POST array appropriate for the specified\n // gender\n\n $min = 'MinPlayers' . $gender;\n $pref = 'PrefPlayers' . $gender;\n $max = 'MaxPlayers' . $gender;\n\n // Validate the individual numbers\n\n if (! (validate_int ($min, 0, 100, \"Min $gender Players\") &&\n\t validate_int ($max, 0, 100, \"Max $gender Players\") &&\n\t validate_int ($pref, 0, 100, \"Preferred $gender Players\")))\n return false;\n\n // If the user didn't fill in the preferred number, default it to the\n // maximum\n\n if (0 == $_POST[$pref])\n $_POST[$pref] = $_POST[$max];\n\n if ((int)$_POST[$min] > (int)$_POST[$pref])\n return display_error (\"Min $gender Players must be less than or equal to Preferred $gender Players\");\n\n if ((int)$_POST[$pref] > (int)$_POST[$max])\n return display_error (\"Preferred $gender Players must be less than or equal to Max $gender Players\");\n\n return true;\n}", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxMp(){\r\n return $this->_has(4);\r\n }", "public function hasMpMax(){\r\n return $this->_has(4);\r\n }", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function update_variables(){\n\n // Calculate this battle's count variables\n $perside_max = 0;\n if (!empty($this->values['players'])){\n foreach ($this->values['players'] AS $id => $player){\n $max = $player['counters']['robots_total'];\n if ($max > $perside_max){ $perside_max = $max; }\n }\n }\n $this->counters['robots_perside_max'] = $perside_max;\n\n // Define whether we're allowed to use experience or not\n $this->flags['allow_experience_points'] = true;\n if (!empty($this->flags['player_battle'])\n || !empty($this->flags['challenge_battle'])){\n $this->flags['allow_experience_points'] = false;\n }\n\n // Return true on success\n return true;\n\n }", "public function maxTries();", "public function testHasLimit() {\n $this->assertEquals(1, $this->users->limit());\n }", "public function test_get_max_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n\n $this->clear_dummy_data();\n $this->assertEquals(null, $migrator_util->get_max_version());\n\n $this->insert_dummy_version_data(array(3));\n $this->assertEquals(\"3\", $migrator_util->get_max_version());\n $this->clear_dummy_data();\n }", "function testMaxval(){\n\t\t#mdx:maxval\n\t\tParam::get('age')->filters()->maxval(150, \"Age cannot be more than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>200])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"more than 150\", $error);\n\t}", "public function hasMaxVigor(){\r\n return $this->_has(25);\r\n }", "public function testUpdateInvalidMaxOptions(): void\n {\n $menu = factory(Menu::class)->create();\n\n $request = [\n 'name' => 'test',\n 'max_depth' => 'five',\n 'max_children' => [5]\n ];\n\n $response = $this->json('PUT', '/api/menus/' . $menu->id, $request);\n\n $response->assertStatus(400);\n }", "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "private static function VerifyWidthMinAndMax()\n {\n global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;\n if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100)\n $wgEmbedVideoMinWidth = 100;\n if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024)\n $wgEmbedVideoMaxWidth = 1024;\n }", "public function getMaxAttemptTimes(): int\n {\n return 3;\n }", "public function testStoreInvalidMaxOptions(): void\n {\n $request = [\n 'name' => 'test',\n 'max_depth' => 'five',\n 'max_children' => [5]\n ];\n\n $response = $this->json('POST', '/api/menus', $request);\n\n $response->assertStatus(400);\n }", "public function setMaxModerationScore($maxMod){\r\n\t\t$this->MAX_MODERATE_SCORE = $maxMod;\r\n\t}", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function testCanSetMaxBoxesToWeightBalance()\n {\n $packer = new Packer();\n $packer->setMaxBoxesToBalanceWeight(3);\n self::assertEquals(3, $packer->getMaxBoxesToBalanceWeight());\n }", "public function testCheckMaxAmount() {\n $amount = 1000;\n $this->assertTrue($this->tranche->checkMaxAmount($amount));\n }", "function _compareItemAndBuyMaxLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasMaxChat(){\n return $this->_has(10);\n }", "public function hasHpMax(){\r\n return $this->_has(2);\r\n }", "public function testKeepPlayingSurpassLimit()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(90);\n $this->assertFalse($player -> keepPlaying(14, 100, 5));\n }", "public function test_with_invalid_number_drain()\n {\n $this->artisan('play:game')\n ->expectsQuestion('Enter A team players:', '18,20,50,40')\n ->expectsQuestion('Enter B team players:', '35, 10, 30, 20, 90')\n ->expectsOutput(\"Match can not play 5 players allowed each team\")\n ->assertExitCode(0);\n }", "public function maxAttempts(): int\n {\n return 5;\n }", "public function hasMaxHp(){\r\n return $this->_has(2);\r\n }", "private function verifyMaxLevel($maxLevel) {\n if(!is_int($maxLevel) || $maxLevel > 6 || $maxLevel < 1) {\n return $this->getResponseObject(null, null, \"Invalid Max Level. The value must be an integer and in the range [1,6]\");\n }\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasMaxSave(){\n return $this->_has(16);\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function check_if_ban_is_in_order($id, $max = 3)\r\n\t{\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT COUNT(id) AS bad_logins FROM login_attempts WHERE student_id = ? AND time > SUBDATE(NOW(), INTERVAL 5 MINUTE) AND login_success = 0;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('i', $id);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($bad_logins); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($bad_logins >= $max)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function testGetMaxLength() {\r\n\t\t$this->assertTrue ( 255 == $this->testObject->getMaxLength (), 'invalid max length was returned' );\r\n\t}", "public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}", "function max_parametr($level, $race, $con, $wis, $isNpc = 0)\n{\n\tglobal $player_max_hp, $player_max_mana, $race_con, $race_wis;\n\t\n\tif ($isNpc === 0 && $level > 120) {\n\t\t$level = 120 + ($level - 120) / 3;\n\t}\n\t$player_max_hp = getMaxHp($con + $race_con[$race], $level, $isNpc); \n\t$player_max_mana = round( ($wis+$race_wis[$race])*8+round(($wis+$wis+$race_wis[$race])*$level/2)); \n}", "public function hasMax() {\n return $this->_has(3);\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }", "public function testMaxViewsErrors() {\n //Check the max_views argument is required \n $badData = $this->goodData;\n $badData['title'] = 'titleTestMaxViewsErrors0';\n $badData['max_views'] = 0;\n $entity = $this->Links->newEntity($badData);\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views is > 0');\n $this->assertArrayHasKey('max_views', $entity->errors());\n\n $badData['max_views'] = -1;\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views cannot be negative');\n\n $badData['max_views'] = 1001;\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views cannot be more than 1000');\n\n $badData = $this->goodData;\n $badData['max_views'] = 'You shall not pass!';\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views is integer');\n }", "function checkMax($groupId, $item, $max, $pdo){\n\tif($max === null)\n\t\treturn true;\n\tif($max <= 0)\n\t\treturn false;\n\t$item = str_replace('`', '', $item);\n\t$statement = $pdo->prepare(\"SELECT `$item` FROM inventory WHERE groupId=?;\");\n\tif($statement->execute(array($groupId))){\n\t\tif($statement->rowCount() === 1)\n\t\t\treturn $statement->fetch()[$item] < $max;\n\t}\n\treturn false;\n}", "public function setMaxParticipants($maxParticipants) {\n $this->maxParticipants = $maxParticipants;\n }", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "public function maxTries() {\n\t\treturn 1;\n\t}", "public function testValidatorForMaxLengthSuccess()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n // Add datasource for checking maximum digit\n Table::insert([\n [\n 'id' => 12345678901,\n 'table_name' => \"Table Name 12345678901\",\n 'table_name_alias' => \"Table Name Alias 12345678901\",\n 'updated_by' => 1,\n 'updated_at' => '2020-01-01 00:00:00',\n ],\n ]);\n\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n //255 characters\n 'datasource_name' => '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345',\n //11 characters\n 'table_id' => 12345678901,\n 'starting_row_number' => static::$MAX_EXCEL_ROW,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n //Check response\n $updateResponse\n ->assertStatus(200);\n }", "public function getMaxPower() {\r\n return $this->getMemberCount() * $this->factionsLevel->getSettings()->maxPowerPerUser;\r\n }", "public function isSetMax()\n {\n return !is_null($this->_fields['Max']['FieldValue']);\n }", "public function testSetMaxLengthPassesWithIntegerValue() {\r\n\t\t$this->assertTrue ( $this->testObject->setMaxLength ( 123 ) instanceof XeroPoint_Control_Abstract, 'invalid object returned' );\r\n\t}", "public function hasVigorMax(){\r\n return $this->_has(6);\r\n }", "public function hasMaxAnger(){\r\n return $this->_has(6);\r\n }", "public function validatePerms(){ \n\t\treturn TRUE;\n\t}", "public function getMaximumAttempts();", "public function getCountPlayers(): int;", "public function setMax( int $max ): void {\n\t\t\t$this->maximum = $max;\n\t\t}", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function testDTAZVDisableMaxAmountPass()\n {\n if (!method_exists($this->fixture, 'setMaxAmount')) {\n $this->markTestSkipped('no method setMaxAmount()');\n return;\n }\n $this->fixture->setMaxAmount(0);\n $this->assertTrue($this->fixture->addExchange(array(\n 'name' => \"A Receivers Name\",\n 'bank_code' => \"RZTIAT22263\",\n 'account_number' => \"DE21700519950000007229\"),\n (PHP_INT_MAX-1000)/100 - 1,\n \"Test-Verwendungszweck\"\n ));\n\n $this->assertSame(1, $this->fixture->count());\n }", "public function testSettingPlayers()\n {\n $dice = new DicePlayers();\n $this->assertInstanceOf(\"\\Heln\\Dice\\DicePlayers\", $dice);\n\n $dice->setPlayers();\n $res = $dice->getPlayers();\n $exp = [\n \"Player\" => 0,\n \"Computer\" => 0,\n ];\n $this->assertEquals($exp, $res);\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "public function testGetFinalReportsMaxLengths()\n {\n $mockLogger = $this->createMock(Logger::class); //create mock Logger object\n $database = new DatabaseHelper($mockLogger, $this->pdo); //initialize database helper object\n\n $this->assertEquals(9, count($database->getFinalReportsMaxLengths()));\n }", "function increaseNbLivesTakenByPlayers($teamId, $nbLives){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'update teams set `nbLivesTakenByPlayers`=`nbLivesTakenByPlayers`+'. $nbLives .' where `id`='. $teamId .';');\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function testCanGetMaximumInvestment() : void\n {\n $this->assertEquals(50000, $this->tranche->getMaximumInvestment());\n }", "public function hasMaxlv(){\n return $this->_has(4);\n }", "function validMax($value, $max)\n {\n return $value <= $max;\n }", "public function hasMaxHand(){\n return $this->_has(8);\n }", "abstract protected function getMaxParameter(): int;", "public function getPlayersNbr ()\r\n {\r\n return $this->playersNbr;\r\n }", "public function testKeepPlayingMoreThanHalfOnDices()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(20);\n $this->assertFalse($player -> keepPlaying(19, 100, 6));\n }", "function check_group_members($value)\n{\n\tif ($value['max_member_no_limit'] == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\tif ($value['max_member'] < count($value['group_members']))\n\t{\n\t\treturn array ('group_members' => get_lang('GroupTooMuchMembers'));\n\t}\n\treturn true;\n}", "public function getServerFailureLimit()\n {\n return $this->serverFailureLimit;\n }", "function postCheckformTeamMemberValidation($data, $id) {\n if ($id === null) {\n $check = nkDB_totalNumRows(\n 'FROM '. TEAM_MEMBERS_TABLE .'\n WHERE userId = '. nkDB_quote($data['userId']) .'\n AND team = '. (int) $data['team']\n );\n\n if ($check >= 1) {\n printNotification(__('MEMBER_ALREADY_REGISTRED_IN_TEAM'), 'error');\n return false;\n }\n }\n\n return true;\n}", "public function isLimitExceeded();", "public function testMaxInvalidArgumentException()\n {\n $min = $this->ascendingSequence->getMin();\n $this->ascendingSequence->setMax($min - 1);\n $this->fail(\"Should not be able to set max < min.\");\n }", "function GetMaxLists()\n\t{\n\t\tif (!$this->Admin() && !$this->ListAdmin()) {\n\t\t\treturn $this->group->limit_list;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test'));\n }", "public function testMax()\n {\n $this->ascendingSequence->setMax(1);\n $max = $this->ascendingSequence->getMax();\n $this->assertEquals(1, $max);\n }", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "public function setMaxParticipants($max_participants)\n {\n $this->max_participants = $max_participants;\n }", "abstract public function maxMax(): int;", "protected function maxLoginAttempts()\n {\n return Arr::get(static::$config, 'attempts', 5);\n }", "function pm_limit ($showlimit = true, $disablepm = false, $userid = '', $usergroup = '')\n {\n global $lang;\n global $CURUSER;\n global $usergroups;\n if ((!$CURUSER OR !$usergroups))\n {\n return false;\n }\n\n if ((!$userid AND !$disablepm))\n {\n $userid = intval ($CURUSER['id']);\n }\n\n if ($disablepm)\n {\n $gid = intval ($usergroup);\n $getamount = sql_query ('SELECT pmquote FROM usergroups WHERE gid = ' . sqlesc ($gid) . ' LIMIT 1');\n $maxpmstorage = intval (mysql_result ($getamount, 0, 'pmquote'));\n }\n else\n {\n $maxpmstorage = intval ($usergroups['pmquote']);\n }\n\n if ($maxpmstorage == 0)\n {\n return null;\n }\n\n $count1 = mysql_num_rows (sql_query ('' . 'SELECT m.* FROM messages m WHERE m.receiver=' . $userid . ' and m.location != 0'));\n $count2 = mysql_num_rows (sql_query ('' . 'SELECT m.* FROM messages m WHERE m.sender=' . $userid . ' AND m.saved=\\'yes\\''));\n $pmscounttotal = intval ($count1 + $count2);\n $overhalf = '';\n if (($maxpmstorage <= $pmscounttotal AND $disablepm))\n {\n return false;\n }\n\n if ($showlimit)\n {\n if ($maxpmstorage <= $pmscounttotal)\n {\n $spaceused = 100;\n $spaceused2 = 0;\n $belowhalf = '';\n $overhalf = '100%';\n $warnmsg = '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tborder\">\n\t\t\t<tr>\n\t\t\t<td class=\"trow1\" align=\"center\"><span class=\"smalltext\"><strong><font color=\"#760306\">' . $lang->global['reached_warning'] . '</font></strong><br />' . $lang->global['reached_warning2'] . '</span></td>\n\t\t\t</tr></table><br />';\n }\n else\n {\n $spaceused = $pmscounttotal / $maxpmstorage * 100;\n $spaceused2 = 100 - $spaceused;\n $warnmsg = '';\n if ($spaceused <= '50')\n {\n $belowhalf = round ($spaceused, 0) . '%';\n }\n else\n {\n $overhalf = round ($spaceused, 0) . '%';\n }\n }\n\n $msg = '\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"tborder\" width=\"100%\">\n\t\t<tr>\n\t\t<td class=\"trow1\" align=\"center\"><p>' . sprintf ($lang->global['pmlimitmsg'], $pmscounttotal, $maxpmstorage) . '</p>\n\t\t<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" width=\"230\" style=\"border: solid 1px #000000;\">\n\t\t\t<tr>\n\t\t\t\t<td width=\"' . $spaceused . '\" bgcolor=\"#760306\" align=\"center\">\n\t\t\t\t<font color=\"#000000\" size=\"1\"><strong>' . $overhalf . '</font></span></td>\n\t\t\t\t<td width=\"' . $spaceused2 . '\" bgcolor=\"#035219\" align=\"center\">\n\t\t\t\t<font color=\"#000000\" size=\"1\"><strong>' . $belowhalf . '</font></span></td>\n\t\t\t\t<td width=\"130\" align=\"center\"><font color=\"#000000\" size=\"1\"><strong>' . $lang->global['pmspace'] . '</strong></font></td>\n\t\t\t</tr>\n\t\t</table></tr></td></table><br />';\n $msg = ($warnmsg ? $warnmsg . $msg : $msg);\n return $msg;\n }\n\n return true;\n }", "protected function initQueryLimit()\n {\n $url = $this->getBaseUrl(true) . 'accounts/self/capabilities?format=JSON';\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content['queryLimit']['max'];\n }", "public function testGetValidTeamByTeamId() {\n\t\t// grab a team id that exceeds the maximum allowable team id\n\t\t$team = Team::getTeamByTeamId($this->getPDO(), SprotsTest::INVALID_KEY);\n\t\t$this->assertNull($team);\n\t}" ]
[ "0.8642783", "0.8642783", "0.70288604", "0.6582735", "0.6343313", "0.6321232", "0.62790173", "0.6207885", "0.6161848", "0.6079425", "0.5897885", "0.5821605", "0.5804494", "0.57887733", "0.5751407", "0.57191855", "0.5702126", "0.56975454", "0.5673302", "0.5585022", "0.5541913", "0.55350626", "0.55321085", "0.5515474", "0.5467339", "0.5467021", "0.54641145", "0.5462319", "0.5461365", "0.54451483", "0.5435122", "0.53958726", "0.5374849", "0.5362781", "0.5344787", "0.533487", "0.53233826", "0.5321526", "0.53166324", "0.5306739", "0.52968514", "0.52944463", "0.5276478", "0.5261669", "0.5261669", "0.5261669", "0.5261669", "0.5261669", "0.525655", "0.52564913", "0.52513385", "0.52474254", "0.52447796", "0.52298373", "0.52290493", "0.5226702", "0.52167094", "0.52124065", "0.5209976", "0.52092296", "0.5207685", "0.52060115", "0.52018845", "0.51963145", "0.5195042", "0.51775396", "0.5176923", "0.5159777", "0.5157222", "0.5155161", "0.51444584", "0.51341426", "0.5131718", "0.51229143", "0.51208013", "0.51208013", "0.511823", "0.51166075", "0.51080686", "0.51066387", "0.5100696", "0.5095922", "0.5080491", "0.50787395", "0.5073439", "0.5073057", "0.50595117", "0.50568384", "0.5054201", "0.5032102", "0.50314415", "0.5023325", "0.5020748", "0.5011007", "0.5004056", "0.5003187", "0.49894047", "0.49880737", "0.49873614", "0.49866498" ]
0.8645664
0
Verifies the admin set max num players command does work properly
public function test_admin_set_password() { $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->postScriptumServer->adminSetMaxNumPlayers(78));\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function adminSetMaxNumPlayers(int $slots) : bool\n {\n return $this->_consoleCommand('AdminSetMaxNumPlayers', $slots, 'Set MaxNumPlayers to ' . $slots);\n }", "public function getMaxPlayers(): int;", "function check_max_number_of_members($value)\n{\n\t$max_member_no_limit = $value['max_member_no_limit'];\n\tif ($max_member_no_limit == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\t$max_member = $value['max_member'];\n\treturn is_numeric($max_member);\n}", "public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"max_players\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }", "private function setNumOfPlayers(int $num) : int\n {\n\t\t$minUserNum = 2;\n\t\t$maxUserNum = count($this->availablePlayerNames);\n\n if ($num <= $minUserNum) {\n $num = $minUserNum;\n\t\t}\n\n\t\tif ($num > $maxUserNum) {\n\t\t\t$num = $maxUserNum;\n\t\t}\n\n\t\t$this->numOfPlayers = $num;\n\t\t\n\t\treturn $this->numOfPlayers;\n }", "public function setMaxPlayers(int $int) {\r\n\r\n return $this->getMain()->getDatabase()->set(\"max_players\", $int, [\"table\" => \"Games\", \"name\" => $this->getName()]);\r\n\r\n }", "function zg_ai_have_num_players($num_players) {\n\n // Goal: $num players across the game.\n $sql = 'select count(id) as count from users\n where meta like \"ai_%\";';\n $result = db_query($sql);\n $item = db_fetch_object($result);\n firep($item, 'ai item');\n $count = (int) $item->count;\n\n zg_ai_out(\"want $num_players players, have $count\");\n\n if ($count >= $num_players) {\n // zg_ai_out('woohoo! we have enough players! returning TRUE');.\n return TRUE;\n }\n\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n return FALSE;\n}", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasMaxTeam(){\n return $this->_has(7);\n }", "public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxTeams(){\n return $this->_has(11);\n }", "function validate_players ($gender)\n{\n // Build the indicies into the $_POST array appropriate for the specified\n // gender\n\n $min = 'MinPlayers' . $gender;\n $pref = 'PrefPlayers' . $gender;\n $max = 'MaxPlayers' . $gender;\n\n // Validate the individual numbers\n\n if (! (validate_int ($min, 0, 100, \"Min $gender Players\") &&\n\t validate_int ($max, 0, 100, \"Max $gender Players\") &&\n\t validate_int ($pref, 0, 100, \"Preferred $gender Players\")))\n return false;\n\n // If the user didn't fill in the preferred number, default it to the\n // maximum\n\n if (0 == $_POST[$pref])\n $_POST[$pref] = $_POST[$max];\n\n if ((int)$_POST[$min] > (int)$_POST[$pref])\n return display_error (\"Min $gender Players must be less than or equal to Preferred $gender Players\");\n\n if ((int)$_POST[$pref] > (int)$_POST[$max])\n return display_error (\"Preferred $gender Players must be less than or equal to Max $gender Players\");\n\n return true;\n}", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxMp(){\r\n return $this->_has(4);\r\n }", "public function hasMpMax(){\r\n return $this->_has(4);\r\n }", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function update_variables(){\n\n // Calculate this battle's count variables\n $perside_max = 0;\n if (!empty($this->values['players'])){\n foreach ($this->values['players'] AS $id => $player){\n $max = $player['counters']['robots_total'];\n if ($max > $perside_max){ $perside_max = $max; }\n }\n }\n $this->counters['robots_perside_max'] = $perside_max;\n\n // Define whether we're allowed to use experience or not\n $this->flags['allow_experience_points'] = true;\n if (!empty($this->flags['player_battle'])\n || !empty($this->flags['challenge_battle'])){\n $this->flags['allow_experience_points'] = false;\n }\n\n // Return true on success\n return true;\n\n }", "public function maxTries();", "public function testHasLimit() {\n $this->assertEquals(1, $this->users->limit());\n }", "public function test_get_max_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n\n $this->clear_dummy_data();\n $this->assertEquals(null, $migrator_util->get_max_version());\n\n $this->insert_dummy_version_data(array(3));\n $this->assertEquals(\"3\", $migrator_util->get_max_version());\n $this->clear_dummy_data();\n }", "function testMaxval(){\n\t\t#mdx:maxval\n\t\tParam::get('age')->filters()->maxval(150, \"Age cannot be more than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>200])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"more than 150\", $error);\n\t}", "public function testUpdateInvalidMaxOptions(): void\n {\n $menu = factory(Menu::class)->create();\n\n $request = [\n 'name' => 'test',\n 'max_depth' => 'five',\n 'max_children' => [5]\n ];\n\n $response = $this->json('PUT', '/api/menus/' . $menu->id, $request);\n\n $response->assertStatus(400);\n }", "public function hasMaxVigor(){\r\n return $this->_has(25);\r\n }", "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "private static function VerifyWidthMinAndMax()\n {\n global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;\n if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100)\n $wgEmbedVideoMinWidth = 100;\n if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024)\n $wgEmbedVideoMaxWidth = 1024;\n }", "public function getMaxAttemptTimes(): int\n {\n return 3;\n }", "public function testStoreInvalidMaxOptions(): void\n {\n $request = [\n 'name' => 'test',\n 'max_depth' => 'five',\n 'max_children' => [5]\n ];\n\n $response = $this->json('POST', '/api/menus', $request);\n\n $response->assertStatus(400);\n }", "public function setMaxModerationScore($maxMod){\r\n\t\t$this->MAX_MODERATE_SCORE = $maxMod;\r\n\t}", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function testCanSetMaxBoxesToWeightBalance()\n {\n $packer = new Packer();\n $packer->setMaxBoxesToBalanceWeight(3);\n self::assertEquals(3, $packer->getMaxBoxesToBalanceWeight());\n }", "public function testCheckMaxAmount() {\n $amount = 1000;\n $this->assertTrue($this->tranche->checkMaxAmount($amount));\n }", "function _compareItemAndBuyMaxLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasMaxChat(){\n return $this->_has(10);\n }", "public function hasHpMax(){\r\n return $this->_has(2);\r\n }", "public function testKeepPlayingSurpassLimit()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(90);\n $this->assertFalse($player -> keepPlaying(14, 100, 5));\n }", "public function test_with_invalid_number_drain()\n {\n $this->artisan('play:game')\n ->expectsQuestion('Enter A team players:', '18,20,50,40')\n ->expectsQuestion('Enter B team players:', '35, 10, 30, 20, 90')\n ->expectsOutput(\"Match can not play 5 players allowed each team\")\n ->assertExitCode(0);\n }", "public function maxAttempts(): int\n {\n return 5;\n }", "public function hasMaxHp(){\r\n return $this->_has(2);\r\n }", "private function verifyMaxLevel($maxLevel) {\n if(!is_int($maxLevel) || $maxLevel > 6 || $maxLevel < 1) {\n return $this->getResponseObject(null, null, \"Invalid Max Level. The value must be an integer and in the range [1,6]\");\n }\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasMaxSave(){\n return $this->_has(16);\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function check_if_ban_is_in_order($id, $max = 3)\r\n\t{\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT COUNT(id) AS bad_logins FROM login_attempts WHERE student_id = ? AND time > SUBDATE(NOW(), INTERVAL 5 MINUTE) AND login_success = 0;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('i', $id);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($bad_logins); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($bad_logins >= $max)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function testGetMaxLength() {\r\n\t\t$this->assertTrue ( 255 == $this->testObject->getMaxLength (), 'invalid max length was returned' );\r\n\t}", "public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}", "function max_parametr($level, $race, $con, $wis, $isNpc = 0)\n{\n\tglobal $player_max_hp, $player_max_mana, $race_con, $race_wis;\n\t\n\tif ($isNpc === 0 && $level > 120) {\n\t\t$level = 120 + ($level - 120) / 3;\n\t}\n\t$player_max_hp = getMaxHp($con + $race_con[$race], $level, $isNpc); \n\t$player_max_mana = round( ($wis+$race_wis[$race])*8+round(($wis+$wis+$race_wis[$race])*$level/2)); \n}", "public function hasMax() {\n return $this->_has(3);\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }", "public function testMaxViewsErrors() {\n //Check the max_views argument is required \n $badData = $this->goodData;\n $badData['title'] = 'titleTestMaxViewsErrors0';\n $badData['max_views'] = 0;\n $entity = $this->Links->newEntity($badData);\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views is > 0');\n $this->assertArrayHasKey('max_views', $entity->errors());\n\n $badData['max_views'] = -1;\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views cannot be negative');\n\n $badData['max_views'] = 1001;\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views cannot be more than 1000');\n\n $badData = $this->goodData;\n $badData['max_views'] = 'You shall not pass!';\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)),\n 'Save: Field max_views is integer');\n }", "function checkMax($groupId, $item, $max, $pdo){\n\tif($max === null)\n\t\treturn true;\n\tif($max <= 0)\n\t\treturn false;\n\t$item = str_replace('`', '', $item);\n\t$statement = $pdo->prepare(\"SELECT `$item` FROM inventory WHERE groupId=?;\");\n\tif($statement->execute(array($groupId))){\n\t\tif($statement->rowCount() === 1)\n\t\t\treturn $statement->fetch()[$item] < $max;\n\t}\n\treturn false;\n}", "public function setMaxParticipants($maxParticipants) {\n $this->maxParticipants = $maxParticipants;\n }", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "public function maxTries() {\n\t\treturn 1;\n\t}", "public function testValidatorForMaxLengthSuccess()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n // Add datasource for checking maximum digit\n Table::insert([\n [\n 'id' => 12345678901,\n 'table_name' => \"Table Name 12345678901\",\n 'table_name_alias' => \"Table Name Alias 12345678901\",\n 'updated_by' => 1,\n 'updated_at' => '2020-01-01 00:00:00',\n ],\n ]);\n\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n //255 characters\n 'datasource_name' => '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345',\n //11 characters\n 'table_id' => 12345678901,\n 'starting_row_number' => static::$MAX_EXCEL_ROW,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n //Check response\n $updateResponse\n ->assertStatus(200);\n }", "public function getMaxPower() {\r\n return $this->getMemberCount() * $this->factionsLevel->getSettings()->maxPowerPerUser;\r\n }", "public function isSetMax()\n {\n return !is_null($this->_fields['Max']['FieldValue']);\n }", "public function testSetMaxLengthPassesWithIntegerValue() {\r\n\t\t$this->assertTrue ( $this->testObject->setMaxLength ( 123 ) instanceof XeroPoint_Control_Abstract, 'invalid object returned' );\r\n\t}", "public function hasVigorMax(){\r\n return $this->_has(6);\r\n }", "public function hasMaxAnger(){\r\n return $this->_has(6);\r\n }", "public function validatePerms(){ \n\t\treturn TRUE;\n\t}", "public function getMaximumAttempts();", "public function getCountPlayers(): int;", "public function setMax( int $max ): void {\n\t\t\t$this->maximum = $max;\n\t\t}", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function testDTAZVDisableMaxAmountPass()\n {\n if (!method_exists($this->fixture, 'setMaxAmount')) {\n $this->markTestSkipped('no method setMaxAmount()');\n return;\n }\n $this->fixture->setMaxAmount(0);\n $this->assertTrue($this->fixture->addExchange(array(\n 'name' => \"A Receivers Name\",\n 'bank_code' => \"RZTIAT22263\",\n 'account_number' => \"DE21700519950000007229\"),\n (PHP_INT_MAX-1000)/100 - 1,\n \"Test-Verwendungszweck\"\n ));\n\n $this->assertSame(1, $this->fixture->count());\n }", "public function testSettingPlayers()\n {\n $dice = new DicePlayers();\n $this->assertInstanceOf(\"\\Heln\\Dice\\DicePlayers\", $dice);\n\n $dice->setPlayers();\n $res = $dice->getPlayers();\n $exp = [\n \"Player\" => 0,\n \"Computer\" => 0,\n ];\n $this->assertEquals($exp, $res);\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "public function testGetFinalReportsMaxLengths()\n {\n $mockLogger = $this->createMock(Logger::class); //create mock Logger object\n $database = new DatabaseHelper($mockLogger, $this->pdo); //initialize database helper object\n\n $this->assertEquals(9, count($database->getFinalReportsMaxLengths()));\n }", "function increaseNbLivesTakenByPlayers($teamId, $nbLives){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'update teams set `nbLivesTakenByPlayers`=`nbLivesTakenByPlayers`+'. $nbLives .' where `id`='. $teamId .';');\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function testCanGetMaximumInvestment() : void\n {\n $this->assertEquals(50000, $this->tranche->getMaximumInvestment());\n }", "public function hasMaxlv(){\n return $this->_has(4);\n }", "function validMax($value, $max)\n {\n return $value <= $max;\n }", "public function hasMaxHand(){\n return $this->_has(8);\n }", "abstract protected function getMaxParameter(): int;", "public function getPlayersNbr ()\r\n {\r\n return $this->playersNbr;\r\n }", "public function testKeepPlayingMoreThanHalfOnDices()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(20);\n $this->assertFalse($player -> keepPlaying(19, 100, 6));\n }", "function check_group_members($value)\n{\n\tif ($value['max_member_no_limit'] == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\tif ($value['max_member'] < count($value['group_members']))\n\t{\n\t\treturn array ('group_members' => get_lang('GroupTooMuchMembers'));\n\t}\n\treturn true;\n}", "public function getServerFailureLimit()\n {\n return $this->serverFailureLimit;\n }", "function postCheckformTeamMemberValidation($data, $id) {\n if ($id === null) {\n $check = nkDB_totalNumRows(\n 'FROM '. TEAM_MEMBERS_TABLE .'\n WHERE userId = '. nkDB_quote($data['userId']) .'\n AND team = '. (int) $data['team']\n );\n\n if ($check >= 1) {\n printNotification(__('MEMBER_ALREADY_REGISTRED_IN_TEAM'), 'error');\n return false;\n }\n }\n\n return true;\n}", "public function isLimitExceeded();", "public function testMaxInvalidArgumentException()\n {\n $min = $this->ascendingSequence->getMin();\n $this->ascendingSequence->setMax($min - 1);\n $this->fail(\"Should not be able to set max < min.\");\n }", "function GetMaxLists()\n\t{\n\t\tif (!$this->Admin() && !$this->ListAdmin()) {\n\t\t\treturn $this->group->limit_list;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test'));\n }", "public function testMax()\n {\n $this->ascendingSequence->setMax(1);\n $max = $this->ascendingSequence->getMax();\n $this->assertEquals(1, $max);\n }", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "public function setMaxParticipants($max_participants)\n {\n $this->max_participants = $max_participants;\n }", "abstract public function maxMax(): int;", "protected function maxLoginAttempts()\n {\n return Arr::get(static::$config, 'attempts', 5);\n }", "protected function initQueryLimit()\n {\n $url = $this->getBaseUrl(true) . 'accounts/self/capabilities?format=JSON';\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content['queryLimit']['max'];\n }", "function pm_limit ($showlimit = true, $disablepm = false, $userid = '', $usergroup = '')\n {\n global $lang;\n global $CURUSER;\n global $usergroups;\n if ((!$CURUSER OR !$usergroups))\n {\n return false;\n }\n\n if ((!$userid AND !$disablepm))\n {\n $userid = intval ($CURUSER['id']);\n }\n\n if ($disablepm)\n {\n $gid = intval ($usergroup);\n $getamount = sql_query ('SELECT pmquote FROM usergroups WHERE gid = ' . sqlesc ($gid) . ' LIMIT 1');\n $maxpmstorage = intval (mysql_result ($getamount, 0, 'pmquote'));\n }\n else\n {\n $maxpmstorage = intval ($usergroups['pmquote']);\n }\n\n if ($maxpmstorage == 0)\n {\n return null;\n }\n\n $count1 = mysql_num_rows (sql_query ('' . 'SELECT m.* FROM messages m WHERE m.receiver=' . $userid . ' and m.location != 0'));\n $count2 = mysql_num_rows (sql_query ('' . 'SELECT m.* FROM messages m WHERE m.sender=' . $userid . ' AND m.saved=\\'yes\\''));\n $pmscounttotal = intval ($count1 + $count2);\n $overhalf = '';\n if (($maxpmstorage <= $pmscounttotal AND $disablepm))\n {\n return false;\n }\n\n if ($showlimit)\n {\n if ($maxpmstorage <= $pmscounttotal)\n {\n $spaceused = 100;\n $spaceused2 = 0;\n $belowhalf = '';\n $overhalf = '100%';\n $warnmsg = '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tborder\">\n\t\t\t<tr>\n\t\t\t<td class=\"trow1\" align=\"center\"><span class=\"smalltext\"><strong><font color=\"#760306\">' . $lang->global['reached_warning'] . '</font></strong><br />' . $lang->global['reached_warning2'] . '</span></td>\n\t\t\t</tr></table><br />';\n }\n else\n {\n $spaceused = $pmscounttotal / $maxpmstorage * 100;\n $spaceused2 = 100 - $spaceused;\n $warnmsg = '';\n if ($spaceused <= '50')\n {\n $belowhalf = round ($spaceused, 0) . '%';\n }\n else\n {\n $overhalf = round ($spaceused, 0) . '%';\n }\n }\n\n $msg = '\n\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"tborder\" width=\"100%\">\n\t\t<tr>\n\t\t<td class=\"trow1\" align=\"center\"><p>' . sprintf ($lang->global['pmlimitmsg'], $pmscounttotal, $maxpmstorage) . '</p>\n\t\t<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" width=\"230\" style=\"border: solid 1px #000000;\">\n\t\t\t<tr>\n\t\t\t\t<td width=\"' . $spaceused . '\" bgcolor=\"#760306\" align=\"center\">\n\t\t\t\t<font color=\"#000000\" size=\"1\"><strong>' . $overhalf . '</font></span></td>\n\t\t\t\t<td width=\"' . $spaceused2 . '\" bgcolor=\"#035219\" align=\"center\">\n\t\t\t\t<font color=\"#000000\" size=\"1\"><strong>' . $belowhalf . '</font></span></td>\n\t\t\t\t<td width=\"130\" align=\"center\"><font color=\"#000000\" size=\"1\"><strong>' . $lang->global['pmspace'] . '</strong></font></td>\n\t\t\t</tr>\n\t\t</table></tr></td></table><br />';\n $msg = ($warnmsg ? $warnmsg . $msg : $msg);\n return $msg;\n }\n\n return true;\n }", "public function testGetValidTeamByTeamId() {\n\t\t// grab a team id that exceeds the maximum allowable team id\n\t\t$team = Team::getTeamByTeamId($this->getPDO(), SprotsTest::INVALID_KEY);\n\t\t$this->assertNull($team);\n\t}" ]
[ "0.864593", "0.86432284", "0.86432284", "0.7029466", "0.658319", "0.63417625", "0.63219035", "0.6279764", "0.6209093", "0.6161731", "0.6078422", "0.5896648", "0.5820766", "0.58046824", "0.5787694", "0.57508343", "0.5719635", "0.57011026", "0.56964684", "0.5673186", "0.5585004", "0.55417776", "0.5534943", "0.55319643", "0.551416", "0.54667974", "0.54661083", "0.5462578", "0.5462079", "0.546097", "0.5444735", "0.5434544", "0.53956676", "0.537457", "0.5362233", "0.5343239", "0.53337014", "0.5323008", "0.5320286", "0.53168005", "0.5306549", "0.52964276", "0.5293214", "0.5274744", "0.52608985", "0.52608985", "0.52608985", "0.52608985", "0.52608985", "0.5256483", "0.525589", "0.5249939", "0.524727", "0.52432597", "0.522924", "0.52281445", "0.5227311", "0.52160865", "0.5211742", "0.52095336", "0.52088094", "0.5207624", "0.52062994", "0.5200717", "0.519542", "0.51952136", "0.5176192", "0.51753575", "0.51581", "0.51566803", "0.5155502", "0.51441026", "0.5133679", "0.5130116", "0.5124073", "0.51205456", "0.51205456", "0.51178116", "0.51169443", "0.5107251", "0.51055145", "0.5099392", "0.50950456", "0.5079815", "0.5079441", "0.50735885", "0.5070881", "0.5059609", "0.5055265", "0.5053319", "0.50318277", "0.50303733", "0.5023383", "0.50203544", "0.50109875", "0.5003551", "0.50026554", "0.4989403", "0.4987227", "0.49872196", "0.49860954" ]
0.0
-1
Verifies the kick command does work properly
public function test_admin_kick() { $this->assertTrue($this->postScriptumServer->adminKick('Marcel', 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_kick()\n {\n $this->assertTrue($this->btwServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminKickById(1, 'Test'));\n }", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->btwServer->adminKickById(1, 'Test'));\n }", "public function adminKickById(int $id, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKickById', $id . ' ' . $reason, 'Kicked player ');\n }", "public function adminKick(string $nameOrSteamId, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKick', $nameOrSteamId . ' ' . $reason, 'Kicked player ');\n }", "public function testChannelsKick()\n {\n }", "function ts3client_requestClientKickFromServer($serverConnectionHandlerID, $clientID, $kickReason) {}", "public function event_kick($who, $message, $victim)\r\n\t{\r\n\t\r\n\t}", "public function checkCLIuser() {}", "public function kick_user($params) {\n return array('status' => false, 'message' => 'KICK_USER_FAIL');\n }", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "function ts3client_requestClientKickFromChannel($serverConnectionHandlerID, $clientID, $kickReason) {}", "public function kick_user($nick, $message)\r\n\t{\r\n\t\t$this->server->send_line(\"KICK {$this->channel} {$nick} :{$message}\");\r\n\t}", "public function event_kicked($who, $why)\r\n\t{\r\n\r\n\t}", "public function doKick($nick, $channel, $reason = null)\n {\n $args = array($nick, $channel);\n\n if (!empty($reason)) {\n $args[] = $reason;\n }\n\n $this->send('KICK', $args);\n }", "public static function guest ()\n {\n return !self::check();\n }", "function kickGuests($admin = false) {\n\tglobal $_user, $_vars;\n\t\n\tif ($admin && !$_vars['admin']) {\n\t\tredirectTo(\"/\");\n\t}\n\t\n\tif (!$_user->data['is_registered']) {\n\t\tredirectTo(\"/login\");\n\t}\n}", "private function _joke()\n {\n $question = str_replace(array(\"!joke \", \"!joke\"), \"\", $this->_data->message);\n $question = escapeshellcmd($question);\n \n if ($question == \"\") {\n $value = `ruby jokes.rb`;\n }\n else {\n $value = `ruby jokes.rb $question`; \n }\n \n if ($value) {\n $this->_message($this->_data->nick.': '. $value); \n }\n else {\n $this->_message($this->_data->nick.': No jokes about '. $question .'');\n \n }\n \n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->btwServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->postScriptumServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function guest(): bool\n {\n return ! $this->check();\n }", "public function authenticateBack( $wantedNickName ){\n $MyNick = $this->waitForCommand('MyNick');\n if(!$MyNick){\n $this->lasterror = \"not awaited mynick\";\n return false;\n }\n if($MyNick->params[0] != $wantedNickName){\n $this->lasterror = $MyNick->params[0].\" instead of $wantedNickName\";\n return false;\n }\n\n if( !$this->sendCommand('MyNick '.$this->nickname) ) {\n $this->lasterror = \"not sended mynick\";\n return false;\n }\n\n if( !$this->sendCommand('Lock '.self::generateLock().\n ' Pk='.self::generatePk()) ) {\n $this->lasterror = \"not sended lock\";\n return false;\n }\n\n $Lock = $this->waitForCommand('Lock');\n if(!$Lock){\n $this->lasterror = \"not awaited lock\";\n return false;\n }\n if( !$this->sendCommand('Key '.self::lock2key($Lock->params[0])) ) {\n $this->lasterror = \"not sended key\";\n return false;\n }\n \n $Direction = $this->waitForCommand('Direction');\n if(!$Direction){\n $this->lasterror = \"not awaited direction\";\n return false;\n }\n\n $myrand = mt_rand(0, 0x7FFF);\n if( !$this->sendCommand(\"Direction Download $myrand\") ) {\n $this->lasterror = \"not sended direction\";\n return false;\n }\n\n $Key = $this->waitForCommand('Key');\n if(!$Key){\n $this->lasterror = \"not awaited key\";\n return false;\n }\n\n if($Direction->params[0]!='Upload' && $Direction->params[1] > $myrand){\n $this->needToSendFirst = true;\n }\n return true;\n }", "function Check() {\n\t\t// Check if the token has been sent.\n\t\tif(isset($_REQUEST['spack_token'])) {\n\t\t\t// Check if the token exists\n\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t// Check if the token isn't empty\n\t\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t\t$age = time()-$_SESSION[\"spackt_\".$_REQUEST['spack_token']];\n\t\t\t\t\t// Check if the token did not timeout\n\t\t\t\t\tif($age > $this->timeout*60) $this->error = 4;\n\t\t\t\t}\n\t\t\t\telse $this->error = 3;\n\t\t\t}\n\t\t\telse $this->error = 2;\n\t\t}\n\t\telse $this->error = 1;\n\t\t// Anyway, destroys the old token.\n\t\t$this->tokenDelAll();\n\t\tif($this->error==0) return true;\n\t\telse return false;\n\t}", "public function getKick()\n {\n return $this->get(self::_KICK);\n }", "public function readable_check_again() {\n\n\t\t/* Nonce check */\n\t\tcheck_ajax_referer( 'wpcd-admin', 'nonce' );\n\n\t\t/* Permision check - unsure that this is needed since the action is not destructive and might cause issues if the user sees the message and can't dismiss it because they're not an admin. */\n\t\tif ( ! wpcd_is_admin() ) {\n\t\t\twp_send_json_error( array( 'msg' => __( 'You are not authorized to perform this action - do readable check again.', 'wpcd' ) ) );\n\t\t}\n\n\t\t$this->wpapp_admin_init();\n\n\t\tif ( get_transient( 'wpcd_readable_check' ) ) {\n\t\t\t$return = array(\n\t\t\t\t'message' => __( 'Readable check successful!', 'wpcd' ),\n\t\t\t);\n\t\t\twp_send_json_success( $return );\n\t\t} else {\n\t\t\t$return = array(\n\t\t\t\t'message' => __( 'Readable check failed!', 'wpcd' ),\n\t\t\t);\n\t\t\twp_send_json_error( $return );\n\t\t}\n\n\t\twp_die();\n\t}", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "function processCheater($login, $checkpoints, $chkpt, $finish) {\n\n\t\t// collect checkpoints\n\t\t$cps = '';\n\t\tforeach ($checkpoints as $cp)\n\t\t\t$cps .= formatTime($cp) . '/';\n\t\t$cps = substr($cps, 0, strlen($cps)-1); // strip trailing '/'\n\n\t\t// report cheat\n\t\tif ($finish == -1)\n\t\t\ttrigger_error('Cheat by \\'' . $login . '\\' detected! CPs: ' . $cps . ' Last: ' . formatTime($chkpt[2]) . ' index: ' . $chkpt[4], E_USER_WARNING);\n\t\telse\n\t\t\ttrigger_error('Cheat by \\'' . $login . '\\' detected! CPs: ' . $cps . ' Finish: ' . formatTime($finish), E_USER_WARNING);\n\n\t\t// check for valid player\n\t\tif (!$player = $this->server->players->getPlayer($login)) {\n\t\t\ttrigger_error('Player object for \\'' . $login . '\\' not found!', E_USER_WARNING);\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ($this->settings['cheater_action']) {\n\n\t\tcase 1: // set to spec\n\t\t\t$rtn = $this->client->query('ForceSpectator', $login, 1);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ForceSpectator - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t} else {\n\t\t\t\t// allow spectator to switch back to player\n\t\t\t\t$rtn = $this->client->query('ForceSpectator', $login, 0);\n\t\t\t}\n\t\t\t// force free camera mode on spectator\n\t\t\t$this->client->addCall('ForceSpectatorTarget', array($login, '', 2));\n\t\t\t// free up player slot\n\t\t\t$this->client->addCall('SpectatorReleasePlayerSlot', array($login));\n\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] forced into free spectator!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} forced into spectator!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\t\t\tbreak;\n\n\t\tcase 2: // kick\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] kicked!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} kicked!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// kick the cheater\n\t\t\t$this->client->query('Kick', $login);\n\t\t\tbreak;\n\n\t\tcase 3: // ban (& kick)\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] banned!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} banned!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// update banned IPs file\n\t\t\t$this->bannedips[] = $player->ip;\n\t\t\t$this->writeIPs();\n\n\t\t\t// ban the cheater and also kick him\n\t\t\t$this->client->query('Ban', $player->login);\n\t\t\tbreak;\n\n\t\tcase 4: // blacklist & kick\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] blacklisted!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} blacklisted!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// blacklist the cheater and then kick him\n\t\t\t$this->client->query('BlackList', $player->login);\n\t\t\t$this->client->query('Kick', $player->login);\n\n\t\t\t// update blacklist file\n\t\t\t$filename = $this->settings['blacklist_file'];\n\t\t\t$rtn = $this->client->query('SaveBlackList', $filename);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] SaveBlackList (kick) - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 5: // blacklist & ban\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] blacklisted & banned!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} blacklisted & banned!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// update banned IPs file\n\t\t\t$this->bannedips[] = $player->ip;\n\t\t\t$this->writeIPs();\n\n\t\t\t// blacklist & ban the cheater\n\t\t\t$this->client->query('BlackList', $player->login);\n\t\t\t$this->client->query('Ban', $player->login);\n\n\t\t\t// update blacklist file\n\t\t\t$filename = $this->settings['blacklist_file'];\n\t\t\t$rtn = $this->client->query('SaveBlackList', $filename);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] SaveBlackList (ban) - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault: // ignore\n\t\t}\n\t}", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "public function test_character_can_don_one_shield()\n {\n // If he could hold 2 shields, his AC would change after picking up the 2nd one.\n $this->character->use(new Shield());\n $first_shield_ac = $this->character->getAc();\n $this->character->use(new Shield());\n $this->assertEquals($first_shield_ac, $this->character->getAc());\n }", "public function setKick(Down_GuildKick $value)\n {\n return $this->set(self::_KICK, $value);\n }", "private function prompt($kill = TRUE) {\n if ($kill) {\n if ($this->auth_http_method == 'BASIC')\n $this->promptBasic();\n else\n $this->promptDigest();\n } else {\n return false;\n }\n }", "private function _identifyYourself()\n {\n // If there is a nickserv password and it's us joining\n if ($this->_identifyPassword AND ($this->_data->nick == $this->_irc->_nick))\n {\n $this->_privMessage('identify '. $this->_identifyPassword, 'NickServ');\n }\n }", "public function canBoot(): bool;", "public function adminRestartMatch() : bool\n {\n return $this->_consoleCommand('AdminRestartMatch', '', 'Game restarted');\n }", "public function dress()\n {\n echo 'dresses suit'.PHP_EOL;\n }", "public function test_squad_server_admin_warn()\n {\n $this->assertTrue($this->postScriptumServer->adminWarn('Test', 'Hello World!'));\n }", "public function should_run()\n\t{\n\t\treturn (time() - (int) $this->config['titania_last_cleanup']) > (3600 * 6);\n\t}", "public function check()\n {\n return ! $this->guest();\n }", "public function testTroubleshootingModeDisabledWrongCokie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc124';\n\n\t\t// This test should fail, as the hash values do not match.\n\t\t$this->assertFalse( $this->class_instance->is_troubleshooting() );\n\t}", "function drush_sandwich_make_me_a_sandwich_validate() {\n if (drush_is_windows()) {\n // $name = drush_get_username();\n // TODO: implement check for elevated process using w32api\n // as sudo is not available for Windows\n // http://php.net/manual/en/book.w32api.php\n // http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d\n }\n else {\n $name = posix_getpwuid(posix_geteuid());\n if ($name['name'] !== 'root') {\n return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));\n }\n }\n}", "function check(){\r\n if ( file_get_contents(sys_get_temp_dir().\"/{$this->file_name}\") != 'run' ) {\r\n exit('Script was canceled by file deletion.') ;\r\n }\r\n }", "public function redis_Scripting_script_invalid_command()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $this->expectException(ScriptCommandException::class);\n $this->assertEquals(1, $this->redis->script('return'));\n }", "public function testLockSsnFailsOnLock()\n\t{\n\t\t$this->store->lockSsn('123456789');\n\t\t$this->assertFalse($this->store->lockSsn('123456789'));\n\t}", "public function guest()\n {\n return !$this->check();\n }", "public function guest()\n {\n return !$this->check();\n }", "function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}", "public function check() {}", "public function test_squad_server_admin_warn()\n {\n $this->assertTrue($this->btwServer->adminWarn('Test', 'Hello World!'));\n }", "protected function testErreurs()\n\t{\n\t\t$cmd = '';\n\t}", "public function guest() {\n\t\treturn ! $this->check();\n\t}", "public function testBadMode()\n {\n $client = new Client($this->options);\n $this->assertFalse($client->setMode('mittens'));\n $this->assertTrue($client->getMode() === 'testing');\n }", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function retractArms() {\n\t\techo \"Power units have not been started.<br>\";\n\t}", "public function testRunningInSafeMode()\n\t{\n\t\t$_GET['safe_mode'] = '1';\n\n\t\t$this->restartApplication();\n\n\t\t$this->call('orchestra::credential@login', array(), 'GET');\n\t\t$this->assertEquals('Y', \\Session::get('safe_mode'));\n\n\t\t$_GET['safe_mode'] = '0';\n\n\t\t$this->restartApplication();\n\n\t\t$this->call('orchestra::credential@login', array(), 'GET');\n\t\t$this->assertNull(\\Session::get('safe_mode'));\n\t}", "function checkStart(){\r\n\tif (!$this->Eq['A']['id']) $this->sendError(\"你沒有裝備武器,不能出擊。\");\r\n\telseif ($this->Player['en'] < $this->RequireEN) $this->sendError(\"EN不足,無法出擊。\");\r\n\telseif ($this->Player['sp'] < $this->SP_Cost) $this->sendError(\"SP不足,無法以 $Pl->Tactics[name] 出擊。\");\r\n}", "protected function checkDeck(): bool\n {\n if (empty($this->chatSettings->getString(\"defaultCardDeck\")) ||\n !($this->chatSettings->get(\"cardDeck\") instanceof CardDeck)\n ) {\n $this->setReply(\"deckNotSet\");\n\n return false;\n }\n\n return true;\n }", "public function testExecuteWithoutForce()\n {\n $commandTester = $this->createCommandTester(new DeleteCommand());\n $commandTester->execute([\n 'url' => 'my-queue-url'\n ]);\n\n $output = $commandTester->getDisplay();\n $this->assertContains('Option --force is mandatory to drop data', $output);\n }", "public function missing_user_errors()\n {\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(1);\n }", "public function _check()\n {\n }", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n\n sleep(30);\n }", "protected function checkPermission(): bool\n {\n // Must be the owner or the administrator in the group\n if ($this->message instanceof GroupMessage && $this->message->sender->permission == \"MEMBER\") {\n $this->setReply(\"deckDenied\");\n\n return false;\n }\n\n return true;\n }", "public function kick($range){\n $key = (10*round($range/10))+'y';\n $roll = mt_rand(1,6);\n return $this->kick_results_relationship[$key][$roll];\n }", "private function isGod() : bool\n {\n return $this->user->id === 1;\n }", "public function test_squad_server_admin_disband_squad()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange(1, 1));\n }", "function log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_b = '', $silent = false, $instant_ban = false)\n{\n require_code('failure');\n _log_hack_attack_and_exit($reason, $reason_param_a, $reason_param_b, $silent, $instant_ban);\n}", "public function testKeepPlayingSurpassLimit()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(90);\n $this->assertFalse($player -> keepPlaying(14, 100, 5));\n }", "public function runningInFreeMode(): void\n {\n self::assertEquals(false, $this->subject->runningInFreeMode());\n }", "function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}", "public function test_squad_server_admin_disband_squad()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange(1, 1));\n }", "function validateSetup()\n\t{\n\t\tforeach ($this->setup->getClient()->status as $key => $val)\n\t\t{\n\t\t\tif ($key != \"finish\" and $key != \"access\")\n\t\t\t{\n\t\t\t\tif ($val[\"status\"] != true)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n//$this->setup->getClient()->setSetting(\"zzz\", \"V\");\n\t\t$clientlist = new ilClientList($this->setup->db_connections);\n//$this->setup->getClient()->setSetting(\"zzz\", \"W\");\n\t\t$list = $clientlist->getClients();\n//$this->setup->getClient()->setSetting(\"zzz\", \"X\");\n\t\tif (count($list) == 1)\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"default\",$this->setup->getClient()->getId());\n\t\t\t$this->setup->ini->write();\n\n\t\t\t$this->setup->getClient()->ini->setVariable(\"client\",\"access\",1);\n\t\t\t$this->setup->getClient()->ini->write();\n\t\t}\n//$this->setup->getClient()->setSetting(\"zzz\", \"Y\");\n\t\treturn true;\n\t}", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "function process_unlock_perk($socket, $data)\n{\n global $player_array;\n\n if ($socket->process === true) {\n list($slug, $user_id, $guild_id, $user_name, $quantity) = explode('`', $data);\n $user_id = (int) $user_id;\n $guild_id = (int) $guild_id;\n start_perk($slug, $user_id, $guild_id, time() + ($quantity * 3600));\n $player = id_to_player($user_id, false);\n $display_name = userify($player, $user_name);\n\n if ($guild_id !== 0) {\n if (strpos($slug, 'guild_') === 0) {\n $type = ucfirst(explode('_', $slug)[1]);\n $duration = format_duration($quantity * 3600);\n $msg = \"$display_name unlocked $type mode for your guild for $duration!\";\n send_to_guild($guild_id, \"systemChat`$msg\");\n } elseif ($slug === 'happy_hour') {\n global $chat_room_array;\n\n $hh_lang = $quantity > 1 ? \"$quantity Happy Hours\" : 'a Happy Hour';\n if (isset($chat_room_array['main'])) {\n $main = $chat_room_array['main'];\n $main->sendChat(\"systemChat`$display_name just triggered $hh_lang!\");\n foreach ($player_array as $player) {\n if (isset($player->chat_room) && $player->chat_room !== $main) {\n $player->write(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n } else {\n sendToAll_players(\"systemChat`$display_name just triggered $hh_lang!\");\n }\n }\n }\n\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "function qconfirm(&$irc, &$data)\n {\n\t\t\tglobal $pickupchannel;\n if($data->message == \"Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except [email protected].\")\n {\n echo \"\\n\\n\\n\\nSHIIIT\\n\\n\\n\\n\";\n $irc->join($pickupchannel);\n }\n }", "function kick($b_id){\n\n //get authcode from b_id\n $this->db->from('booth')->where('b_id',$b_id);\n $query = $this->db->get();\n if (!isset($query->row(1)->{'authcode'})) {\n log_message('error','kick booth not found');\n return 0;\n }\n $authcode = $query->row(1)->{'authcode'};\n\n //get step from authcode\n $this->db->from('authcode')->where('hash',sha1($authcode));\n $query = $this->db->get();\n if (!isset($query->row(1)->{'step'})) {\n log_message('error','kick booth not found');\n return 0;\n }\n $step = $query->row(1)->{'step'};\n\n //set step+=100\n $data = array(\"step\"=>$step+100);\n $this->db->where('hash',sha1($authcode));\n $this->db->update('authcode',$data);\n\n //reset booth with free/authcode=null\n $data = array(\"status\"=>\"free\" , \"authcode\"=>\"\");\n $this->db->where('b_id',$b_id);\n $this->db->update('booth',$data);\n log_message('debug' , 'kick authcode='.$authcode.' b_id='.$b_id);\n\n \n }", "public function testKeepPlayingMoreThanHalfOnDices()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(20);\n $this->assertFalse($player -> keepPlaying(19, 100, 6));\n }", "function is_ok($cmd = \"\")\n {\n }", "public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args ) :bool\n {\n if(strtolower($cmd->getName()) == \"gms\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.gms.use\")){\n\t\t\t\t\t$sender->setGamemode(0);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Your gamemode has been set to Survival!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"gmc\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.gmc.use\")){\n\t\t\t\t\t$sender->setGamemode(1);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Your gamemode has been set to Creative!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"gma\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.gma.use\")){\n\t\t\t\t\t$sender->setGamemode(2);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Your gamemode has been set to Adventure!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"gmspc\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.gmspc.use\")){\n\t\t\t\t\t$sender->setGamemode(3);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Your gamemode has been set to Spectator!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"day\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.day.use\")){\n\t\t\t\t\t$sender->getLevel()->setTime(6000);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Set the time to Day (6000) in your world!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"night\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.night.use\")){\n\t\t\t\t\t$sender->getLevel()->setTime(16000);\n\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Set the time to Night (16000) in your world!\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n if(strtolower($cmd->getName()) == \"nv\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->getEffect(Effect::NIGHT_VISION)){\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Night Vision turned off!\");\n\t\t\t\t\t$sender->removeEffect(Effect::NIGHT_VISION);\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Night Vision turned on!\");\n\t\t\t\t\t$sender->addEffect(new EffectInstance(Effect::getEffectByName(\"NIGHT_VISION\"), INT32_MAX, 1, false));\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"This command only works in game\");\n\t\t\t}\n\t\t}\n if(strtolower($cmd->getName()) == \"clearinv\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\t$sender->getInventory()->clearAll();\n\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"tpworld\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.tpworld.use\")){\n\t\t\t\t\tif(isset($args[0])){\n\t\t\t\t\t\t$world = $args[0];\n\t\t\t\t\t\tif($this->getServer()->isLevelLoaded($world)){\n\t\t\t\t\t\t\t$level = $this->getServer()->getLevelByName($world);\n\t\t\t\t\t\t\t$sender->teleport($level->getSafeSpawn());\n\t\t\t\t\t\t\t$sender->getLevel()->addSound(new GhastShootSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" You have been teleported to \" . TF::GOLD . $world);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Error: World \" . TF::GREEN . $world . TF::GOLD . \" does not exist.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Error: missing arguments.\");\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Usage: /tpworld <freebuild|city>\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n if(strtolower($cmd->getName()) == \"itemid\"){\n if($sender instanceof Player){\n $item = $sender->getInventory()->getItemInHand()->getId();\n $damage = $sender->getInventory()->getItemInHand()->getDamage();\n $sender->sendMessage($this->mch . TF::GREEN . \" ID: \" . $item . \":\" . $damage);\n }else{\n $sender->sendMessage(\"Please use this command in-game.\");\n }\n }\n\t\tif(strtolower($cmd->getName()) == \"changesign\"){\n\t\t\tif(!$sender instanceof Player){\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!$sender->hasPermission(\"core.changesign.use\")){\n\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(empty($args[0])){\n\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Error: Missing arguments.\");\n\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Usage: /cs <line #> <text>\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tswitch($args[0]){\n\t\t\t\tcase \"1\":\n\t\t\t\t\t$this->signLines[$sender->getName()] = 0;\n\t\t\t\t\t$this->signText[$sender->getName()] = implode(\" \", array_slice($args, 1));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Tap a sign now to change the first line of text\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2\":\n\t\t\t\t\t$this->signLines[$sender->getName()] = 1;\n\t\t\t\t\t$this->signText[$sender->getName()] = implode(\" \", array_slice($args, 1));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Tap a sign now to change the second line of text\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"3\":\n\t\t\t\t\t$this->signLines[$sender->getName()] = 2;\n\t\t\t\t\t$this->signText[$sender->getName()] = implode(\" \", array_slice($args, 1));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Tap a sign now to change the third line of text\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"4\":\n\t\t\t\t\t$this->signLines[$sender->getName()] = 3;\n\t\t\t\t\t$this->signText[$sender->getName()] = implode(\" \", array_slice($args, 1));\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Tap a sign now to change the fourth line of text\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GRAY . \" Usage: /cs <line #> <text>\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"info\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\t$this->infoForm($sender);\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"portal\"){\n\t\t\tif(!isset($args[0])){\n return false;\n }\n $subCommand = array_shift($args);\n switch($subCommand){\n case 'pos1':\n if(!($sender instanceof Player)){\n $sender->sendMessage('Please run this command in-game.');\n return true;\n }\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n $this->sel1[$sender->getName()] = true;\n $sender->sendMessage($this->mch . TF::GREEN . ' Please place or break the first position');\n return true;\n case 'pos2':\n if(!($sender instanceof Player)){\n $sender->sendMessage('Please run this command in-game.');\n return true;\n }\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n $this->sel2[$sender->getName()] = true;\n $sender->sendMessage($this->mch . TF::GREEN . ' Please place or break the second position');\n return true;\n case 'create':\n if(!($sender instanceof Player)){\n $sender->sendMessage('Please run this command in-game.');\n return true;\n }\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n if(!isset($this->pos1[$sender->getName()], $this->pos2[$sender->getName()])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Please select both positions first');\n return true;\n }\n if(!isset($args[0])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Please specify the portal name');\n return true;\n }\n if($this->pos1[$sender->getName()][3] !== $this->pos2[$sender->getName()][3]){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Positions are in different levels');\n return true;\n }\n if(isset($this->portals[strtolower($args[0])])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: A portal with that name already exists');\n return true;\n }\n $this->portals[strtolower($args[0])] = [\n 'x' => min($this->pos1[$sender->getName()][0], $this->pos2[$sender->getName()][0]),\n 'y' => min($this->pos1[$sender->getName()][1], $this->pos2[$sender->getName()][1]),\n 'z' => min($this->pos1[$sender->getName()][2], $this->pos2[$sender->getName()][2]),\n 'x2' => max($this->pos1[$sender->getName()][0], $this->pos2[$sender->getName()][0]),\n 'y2' => max($this->pos1[$sender->getName()][1], $this->pos2[$sender->getName()][1]),\n 'z2' => max($this->pos1[$sender->getName()][2], $this->pos2[$sender->getName()][2]),\n 'level' => $this->pos1[$sender->getName()][3],\n 'dx' => $sender->x, 'dy' => $sender->y, 'dz' => $sender->z, 'dlevel' => $sender->getLevel()->getFolderName()\n ];\n yaml_emit_file($this->getDataFolder() . 'portals.yml', $this->portals);\n $sender->sendMessage($this->mch . TF::GREEN . ' Portal created');\n unset($this->pos1[$sender->getName()], $this->pos2[$sender->getName()]);\n return true;\n case 'list':\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n $sender->sendMessage($this->mch . TF::GREEN . ' Portals: ' . implode(', ', array_keys($this->portals)));\n return true;\n case 'delete':\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n if(!isset($this->portals[strtolower($args[0])])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: A portal with that name does not exist');\n return true;\n }\n unset($this->portals[strtolower($args[0])]);\n yaml_emit_file($this->getDataFolder() . 'portals.yml', $this->portals);\n $sender->sendMessage($this->mch . TF::GREEN . ' You have deleted the portal');\n return true;\n case 'fill':\n if(!$sender->hasPermission('core.portals.admin')){\n $sender->sendMessage($this->mch . TF::RED . ' You do not have permission to use this command');\n return true;\n }\n if(!isset($args[0])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Please specify the portal name');\n return true;\n }\n if(!isset($args[1])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Please specify the block id');\n return true;\n }\n $name = strtolower($args[0]);\n if(!isset($this->portals[$name])){\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: A portal with that name does not exist');\n return true;\n }\n\t\t\t\t\t$level = $this->getServer()->getLevelByName($this->portals[$name]['level']);\n for($x = $this->portals[$name]['x']; $x <= $this->portals[$name]['x2']; $x++){\n for($y = $this->portals[$name]['y']; $y <= $this->portals[$name]['y2']; $y++){\n for($z = $this->portals[$name]['z']; $z <= $this->portals[$name]['z2']; $z++){\n if($level->getBlockIdAt($x, $y, $z) === 0){\n $level->setBlockIdAt($x, $y, $z, $args[1]);\n if(isset($args[2])){\n $level->setBlockDataAt($x, $y, $z, $args[2]);\n }\n }\n }\n }\n }\n $sender->sendMessage($this->mch . TF::GREEN . ' Portal filled');\n return true;\n default:\n $sender->sendMessage($this->mch . TF::GOLD . ' Error: Strange argument ' . $subCommand . '.');\n $sender->sendMessage($cmd->getUsage());\n return true;\n }\n\t\t}\n\t\tif($cmd->getName() == \"lock\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.lock.use\")){\n\t\t\t\t\tif(isset($args[0])){\n\t\t\t\t\t\t$this->lockSession[$sender->getName()] = $args[0];\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Please touch the item you want to lock\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Error: Please provide a name for the Key\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif($cmd->getName() == \"unlock\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.unlock.use\")){\n\t\t\t\t\tif(isset($args[0])){\n\t\t\t\t\t\t$this->unlock($args[0]);\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" The item has been unlocked\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->unlockSession[$sender->getName()] = true;\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Please touch the item you want to unlock\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif($cmd->getName() == \"makekey\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.makekey.use\")){\n\t\t\t\t\tif(isset($args[0])){\n\t\t\t\t\t\t$item = ItemFactory::get($this->itemID);\n\t\t\t\t\t\t$item->clearCustomName();\n\t\t\t\t\t\t$item->setCustomName($args[0]);\n\t\t\t\t\t\t$sender->getInventory()->addItem($item);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Error: Please provide a name for the Key\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif($cmd->getName() == \"lockedinfo\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\tif($sender->hasPermission(\"core.lockedinfo.use\")){\n\t\t\t\t\t$this->infoSession[$sender->getName()] = true;\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Please touch the item you want information on\");\n\t\t\t\t}else{\n\t\t\t\t\t$sender->sendMessage($this->mch . TF::RED . \" You do not have permission to use this command.\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Please use this command in-game.\");\n\t\t\t}\n\t\t}\n\t\tif($cmd->getName() == \"idea\"){\n\t\t\t$idea = $this->generateIdea();\n\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" Idea generated: \" . $idea . \".\");\n\t\t}\n\t\tif($cmd->getName() == \"event\"){\n\t\t\t$theme = $this->cfg[\"comp-theme\"];\n\t\t\t$endDate = $this->cfg[\"comp-end-date\"];\n\t\t\t$sender->sendMessage($this->mch . TF::GREEN . \" This weeks Build Comp. Theme is \" . $theme . \", ending on \" . $endDate);\n\t\t}\n # All commands after this will likely need modifications more than once.\n\t\tif(strtolower($cmd->getName()) == \"hub\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\t$x = 0.5;\n\t\t\t\t$y = 44;\n\t\t\t\t$z = 0.5;\n\t\t\t\t$level = $this->getServer()->getLevelByName(\"freebuild\");\n\t\t\t\t$pos = new Position($x, $y, $z, $level);\n\t\t\t\t$sender->teleport($pos);\n\t\t\t\t$sender->getLevel()->addSound(new EndermanTeleportSound(new Vector3($sender->getX(), $sender->getY(), $sender->getZ())));\n\t\t\t\t$sender->sendMessage($this->mch . TF::GOLD . \" Teleported to Hub\");\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"Sir, you just tried to teleport a non-existent entity into a virtual game to teleport them to another world in said game. I recommend you go see a psychologist.\");\n\t\t\t}\n\t\t}\n\t\tif(strtolower($cmd->getName()) == \"rules\"){\n\t\t\tif($sender instanceof Player){\n\t\t\t\t$sender->sendMessage(\"§6§o§lServer Rules§r\");\n\t\t\t\t$sender->sendMessage(\"§f- §eNo griefing. §c(§4Ban§c)\");\n\t\t\t\t$sender->sendMessage(\"§f- §eNo advertising in any way, shape or form. §c(§4Ban§c)\");\n\t\t\t $sender->sendMessage(\"§f- §eNo NSFW/18+ Builds, Chat or Content. §c(§4Ban§c)\");\n\t\t\t $sender->sendMessage(\"§f- §eNo asking for OP/Ranks/Perms. §c(§4Kick, then Ban§c)\");\n\t\t\t $sender->sendMessage(\"§f- §eNo Drama. We've all had enough of it elsewhere, please do not bring it here. §c(§4Kick, then Ban§c)\");\n $sender->sendMessage(\"§f- §eNo Lavacasts/Other excessive usages of Lava and Water. §c(§4Ban§c)\");\n $sender->sendMessage(\"§f- §eNo Dolphin Porn. §c(§4Ban§c)\");\n\t\t\t $sender->sendMessage(\"§f- §eThat's it, have fun §b:)§e\");\n\t\t\t}else{\n\t\t\t\t$sender->sendMessage(\"If you have console access you BETTER know the fucking rules...\");\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->postScriptumServer->adminRestartMatch());\n }", "function exec_kickout_if_timeout(){\t\r\n if(!(isset($_SESSION['timeout']))){\r\n //echo \"setting time ~~~~~~~~~~~~~</ br>\";\r\n $_SESSION['timeout'] = time();\r\n }\r\n //set delay time,secs\r\n else{\r\n $delay=dev_delay();\r\n if ($_SESSION['timeout'] + $delay < time()) {\r\n $_SESSION = array();\r\n session_destroy();\r\n //return a little feeedback message\r\n //echo \"<div class='alert alert-success' role='alert'>由于长时间未操作,您已退出系统,请重新登录!</div>\";\r\n\r\n header(\"Location:login.php?timeout&redirect_to=\" . urlencode($_SERVER['REQUEST_URI']));\r\n die();\r\n \r\n } else {\r\n $cha=time()-$_SESSION['timeout'];\r\n $cha_div=$cha / 60 ;\r\n $delay_min=$delay / 60;\r\n echo '\r\n <script type=\"text/javascript\">console.log(\"您距离上一次操作相差'.$cha.'秒,即'.$cha_div.' 分钟,超过'.$delay_min.'分钟会强制退出!\")</script> \r\n ';\r\n $_SESSION['timeout'] = time();\r\n // session ok\r\n }\r\n }\r\n}", "public function nuke(){ return $this->APICall( 'nuke', \"Could not nuke database \" . $this->description() ); }", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "private function _demonize()\n {\n umask(self::$umask);\n\n if (pcntl_fork() != 0)\n {\n exit();\n }\n\n posix_setsid();\n\n if (pcntl_fork() != 0)\n {\n exit();\n }\n }", "function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }", "private function checkValidUser() {\n return;\n if(!($this->getData('key') == $this->sessionId && isset($_SESSION['user']) && isset($_SESSION['valid']) && $_SESSION['valid'] === true)) {\n $this->output = array(\n 'success' => false,\n 'key' => 'kMIvl'\n );\n\n // Terminate the call now, user isn't allowed to perform this action\n $this->renderOutput(true);\n }\n }", "public function canBeCut() {}", "function force() { \n if (is_array($this->force_this)) { \n for($i=0 ; $i< count($this->force_this) ; $i++) { \n if ($this->force_this[$i][1] == \"SIMPLE\" && !$this->passed($this->force_this[$i][0])) {\n die(\"\\n\\nMissing \" . $this->force_this[$i][0] . \"\\n\\n\"); \n }\n\n if ($this->force_this[$i][1] == \"FULL\" && !$this->full_passed($this->force_this[$i][0])) {\n die(\"\\n\\nMissing \" . $this->force_this[$i][0] .\" <arg>\\n\\n\"); \n } \n } \n } \n }", "private function sanityChecksPass()\n {\n // Make sure our storage path exists.\n if ( ! is_dir($this->taskStatusStoragePath))\n {\n // No? Create it.\n mkdir($this->taskStatusStoragePath);\n }\n\n // Make sure we can write to our directory.\n $testFilename = rand(1, 1000);\n $testFilepath = $this->taskStatusStoragePath . $testFilename;\n try\n {\n file_put_contents($testFilepath, 'Testing');\n } catch (Exception $e)\n {\n return false;\n }\n\n // Ok, we're good. Delete the dummy lock file (if we can write, there's no reason to suspect we can't unlink also).\n unlink($testFilepath);\n\n // Announce sanity checks passed.\n return true;\n }", "public function tryresetAction() {\n return true;\n }", "public function check_afford_banner()\n {\n $after_deduction = available_points(get_member()) - intval(get_option('banner_setup'));\n\n if (($after_deduction < 0) && (!has_privilege(get_member(), 'give_points_self'))) {\n warn_exit(do_lang_tempcode('CANT_AFFORD'));\n }\n }", "function check_admin() {\n\t\t// check session exists\n\t\tif(!$this->Session->check('Admin')) {\n\t\t\t$this->Session->setFlash(__('ERROR: You must be logged in for that action.', true));\n\t\t\t$this->redirect(array('controller'=>'contenders', 'action'=>'index', 'admin'=>false));\n\t\t}\n\t}", "public function command() {\n\n\n $this->bot->log(\"Fetching joke.\");\n\n $data = $this->fetch(\"http://api.icndb.com/jokes/random\");\n\n // ICNDB has escaped slashes in JSON response.\n $data = stripslashes($data);\n\n $joke = json_decode($data);\n\n if ($joke) {\n if (isset($joke->value->joke)) {\n $this->say(html_entity_decode($joke->value->joke));\n return;\n }\n }\n\n $this->say(\"I don't feel like laughing today. :(\");\n }", "public function failNoisily() :bool{\n\t\treturn !$this->failSilently;\n\t}", "function process_unlock_super_booster($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->super_booster = true;\n }\n $socket->write('ok`');\n }\n}", "public function ability() {\n\n $this->startMove(3, 0.2);\n echo \"THE ENGINE IS OVERHEATED!\\n\";\n $this->switchEngine();\n\n\n\n\n }" ]
[ "0.6991278", "0.62694955", "0.6166438", "0.569332", "0.5669721", "0.56419355", "0.55808455", "0.55148077", "0.5514137", "0.5499427", "0.54472655", "0.5446986", "0.54001576", "0.5393819", "0.5324072", "0.525964", "0.52108175", "0.520291", "0.51139", "0.5081888", "0.5005252", "0.4988035", "0.49875012", "0.49837396", "0.49745712", "0.49674755", "0.49605682", "0.495146", "0.4949321", "0.49355102", "0.49327737", "0.4930467", "0.4927353", "0.48973748", "0.48788956", "0.48755792", "0.4869302", "0.48564503", "0.485063", "0.48382273", "0.4825081", "0.4822029", "0.482163", "0.4814712", "0.48047146", "0.48047146", "0.47985324", "0.4795104", "0.47900093", "0.47890666", "0.478481", "0.47843483", "0.47826278", "0.47826278", "0.47826278", "0.47826278", "0.47826278", "0.47808093", "0.47516435", "0.4747277", "0.47426194", "0.4741599", "0.4736249", "0.47344464", "0.47258016", "0.47189415", "0.47110897", "0.47056565", "0.47019368", "0.46967438", "0.4695806", "0.46943027", "0.46922013", "0.46900436", "0.46808323", "0.46773902", "0.4675889", "0.46684375", "0.46664605", "0.46661824", "0.46619436", "0.46583098", "0.46562588", "0.465541", "0.46537882", "0.46472368", "0.46444565", "0.4638226", "0.46367103", "0.4634905", "0.46315488", "0.46162337", "0.46121222", "0.4612035", "0.46034768", "0.4600972", "0.4600162", "0.45993397", "0.45992586", "0.45972076" ]
0.70317525
0
Verifies the kick by id command does work properly
public function test_admin_kick_by_id() { $this->assertTrue($this->postScriptumServer->adminKickById(1, 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->btwServer->adminKickById(1, 'Test'));\n }", "public function adminKickById(int $id, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKickById', $id . ' ' . $reason, 'Kicked player ');\n }", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminBanById(1, '1h', 'Test'));\n }", "public function test_admin_kick()\n {\n $this->assertTrue($this->postScriptumServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_kick()\n {\n $this->assertTrue($this->btwServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->btwServer->adminBanById(1, '1h', 'Test'));\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminWarnById(0, 'Hello World!'));\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->btwServer->adminWarnById(0, 'Hello World!'));\n }", "public function check($id);", "public function adminKick(string $nameOrSteamId, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKick', $nameOrSteamId . ' ' . $reason, 'Kicked player ');\n }", "function checkAction($id)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('username' => session_get('username'), 'uid' => $id), 1);\n\t\treturn ($check != 0);\n\t}", "function chk_teach_id(){\n\n\t\t$Q = $this->teach_lgn->chk_teach_id();\n\n\t\tif ($Q) {\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t}", "function ts3client_requestClientKickFromServer($serverConnectionHandlerID, $clientID, $kickReason) {}", "function ts3client_requestClientKickFromChannel($serverConnectionHandlerID, $clientID, $kickReason) {}", "private function checkID($id)\n {\n if ($id == 0) {\n $response = array(\"status\" => false, \"message\" => 'Invalid ID');\n $this->send(400, $response);\n }\n }", "public function testQuarantineExistsHeadQuarantinesid()\n {\n\n }", "public function testQuarantineExistsGetQuarantinesidExists()\n {\n\n }", "public function testActivateBySuperAdminWithWrongId(): void\n {\n // Login via tenant-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/1111111?token=' . $token);\n\n // Check response status\n $response->assertStatus(460);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(460, $code);\n $this->assertEquals('Wrong ID.', $message);\n }", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n # Check the Unbound ACLs array for ID\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"acls\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2074);\n }\n } else {\n $this->errors[] = APIResponse\\get(2072);\n }\n }", "public function canSetId();", "function Del_Mess_One($name, $command)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n if (count(explode($command, $mess)) > 1) {\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n }\n}", "function check_ownership($id){\n\n $id = (int)$id;\n\n $sql = \"SELECT * FROM recipes WHERE id = '$id'\";\n\n $recipe = $this->select($sql)[0];\n\n if ( $recipe['user_id'] == $_SESSION['user_logged_in'] ) {\n return true;\n }else {\n header(\"Location: /\");\n exit();\n }\n\n }", "public function checkAlternativeIdMethods() {}", "public function isChecking($id) {\n return ($id==11201);\n }", "function screamUno($userId) {\n\tif (count(getDeck($userId)) == 1) {\n\t\tSQLUpdate(\"update users set uno = 1 where id = $userId\");\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "private function check_ID($id){\r\n\r\n $query = \"SELECT FROM users WHERE oauth_uid = ?\";\r\n $data = $this->_db->get_Row($query, $id);\r\n\r\n return ($this->_db->count_Rows($data) > 0) ? true : false;\r\n }", "public function checkFakes($id)\n {\n $this->db->query('SELECT * FROM fakes where userid = :userid');\n $this->db->bind(':userid', $id);\n $row = $this->db->singleResult();\n\n // Check if anything is returned\n if ($this->db->rowCount() == 0) {\n return true;\n }\n }", "public function kick_user($params) {\n return array('status' => false, 'message' => 'KICK_USER_FAIL');\n }", "public function testFailureWrongIDSCondition()\n {\n $user = User::find(1);\n $this->actingAs($user);\n\n $response = $this->postJson('/v1/collection/book/remove', [\n 'collection_id' => 'collection_5fac21047eb21',\n 'book_id' => 'wrong_id',\n ]);\n\n $response->assertSessionMissing('success');\n }", "public function actionCheckId() {\n $id = $_POST['id'];\n $row = 0;\n $object = Yii::app()->db->createCommand(\"select * from hobby_new where id=\" . $id)->queryRow();\n if (!empty($object['id'])) {\n $row = 1;\n }\n echo $row;\n }", "private function validateForumId(){\n \t\tif (!is_null($this->_id) && is_numeric($this->_id)) return;\n \t\t\n \t\t$id = $this->_id =0;\n \t\tif (!$this->isOptionSet('id')){\n \t\t\tif ($this->isOptionSet('name')){\n\t\t\t\t$name = strtolower($this->getOption('name'));\n\t\t\t\tif ($this->doesNameExists($name,$this->isDebug())) \n\t\t\t\t\t$id = $this->_id = $this->retrieveForumId($name,$this->isDebug());\n \t\t\t}else{\n \t\t\t\t$this->setError('noId');\n \t\t\t\treturn;\t\n \t\t\t} \t\t\t\n \t\t}else $this->_id = $id = $this->getOption('id');\n\t\t\n \t\tif (!$this->doesForumExists($id,false)){\n \t\t\tthrow new ForumMException('supplied forum id ('.$id.') is invalid');\n \t\t}\n \t\t$this->_id = $id;\n \t}", "private function _identifyYourself()\n {\n // If there is a nickserv password and it's us joining\n if ($this->_identifyPassword AND ($this->_data->nick == $this->_irc->_nick))\n {\n $this->_privMessage('identify '. $this->_identifyPassword, 'NickServ');\n }\n }", "public function deletedbhaircutman($id){\n \n global $connect_bdd; \n \n $sql_delete = \"DELETE FROM `haircut_man` WHERE id=\".$id;\n\n $connect_bdd->query($sql_delete);\n\n }", "public function memberIdCheck ()\r\n {\r\n $member_id = $this->getMember_id(true);\r\n return $this->getMapper()->memberIdCheck($member_id);\r\n }", "function tflash_id_exits($id) {\n return TFLASH::id_exists($id);\n}", "function postCheckformTeamMemberValidation($data, $id) {\n if ($id === null) {\n $check = nkDB_totalNumRows(\n 'FROM '. TEAM_MEMBERS_TABLE .'\n WHERE userId = '. nkDB_quote($data['userId']) .'\n AND team = '. (int) $data['team']\n );\n\n if ($check >= 1) {\n printNotification(__('MEMBER_ALREADY_REGISTRED_IN_TEAM'), 'error');\n return false;\n }\n }\n\n return true;\n}", "public function testRejectEmptyIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function event_kick($who, $message, $victim)\r\n\t{\r\n\t\r\n\t}", "function report_check($id)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$id = mysql_clean($id);\r\n\t\t$results = $db->select(tbl($this->flag_tbl),\"flag_id\",\" id='\".$id.\"' AND type='\".$this->type.\"' AND userid='\".userid().\"'\");\r\n\t\tif(count($results)>0)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public function checkCLIuser() {}", "public function checkCompletion($id) {\r\n\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n $sql = \"\r\n SELECT *\r\n FROM users\r\n WHERE id = :id and specialization IS NOT NULL\";\r\n \r\n $stmt = $pdo->prepare($sql);\r\n $stmt->bindParam(':id', $id, PDO::PARAM_STR);\r\n $stmt->execute();\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n if ($stmt->fetch()){\r\n \r\n $stmt = null;\r\n $pdo = null;\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "private function hasValidIdentifier($input) {\n\t\t$post = $this->getPostByJobId($input);\t\n\n\t\tif($this->isAddCommand($input)) {\n\t\t\tif($post) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if($this->isUpdateCommand($input) || $this->isDeleteCommand($input)) {\n\t\t\tif($post) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function kick($b_id){\n\n //get authcode from b_id\n $this->db->from('booth')->where('b_id',$b_id);\n $query = $this->db->get();\n if (!isset($query->row(1)->{'authcode'})) {\n log_message('error','kick booth not found');\n return 0;\n }\n $authcode = $query->row(1)->{'authcode'};\n\n //get step from authcode\n $this->db->from('authcode')->where('hash',sha1($authcode));\n $query = $this->db->get();\n if (!isset($query->row(1)->{'step'})) {\n log_message('error','kick booth not found');\n return 0;\n }\n $step = $query->row(1)->{'step'};\n\n //set step+=100\n $data = array(\"step\"=>$step+100);\n $this->db->where('hash',sha1($authcode));\n $this->db->update('authcode',$data);\n\n //reset booth with free/authcode=null\n $data = array(\"status\"=>\"free\" , \"authcode\"=>\"\");\n $this->db->where('b_id',$b_id);\n $this->db->update('booth',$data);\n log_message('debug' , 'kick authcode='.$authcode.' b_id='.$b_id);\n\n \n }", "private function validateId()\n {\n return is_numeric($this->id) && (int)$this->id >= 1;\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function testGetInvalidKidByKidId(): void\n {\n // grab a Kid id that exceeds the maximum allowable Kid id\n $fakeKidId = generateUuidV4();\n $Kid = Kid::getKidByKidId($this->getPDO(), $fakeKidId);\n $this->assertNull($Kid);\n }", "public function kick_user($nick, $message)\r\n\t{\r\n\t\t$this->server->send_line(\"KICK {$this->channel} {$nick} :{$message}\");\r\n\t}", "function meld($card_id) {\n self::checkAction('meld');\n $player_id = self::getActivePlayerId();\n\n // Check if the player has this card really in his hand\n $card = self::getCardInfo($card_id);\n \n if ($card['owner'] != $player_id || $card['location'] != \"hand\") {\n // The player is cheating...\n throw new BgaUserException(self::_(\"You do not have this card in hand [Press F5 in case of troubles]\"));\n }\n \n // No cheating here\n \n // Stats\n if (self::getGameStateValue('has_second_action') || self::getGameStateValue('first_player_with_only_one_action') || self::getGameStateValue('second_player_with_only_one_action')) {\n self::incStat(1, 'turns_number');\n self::incStat(1, 'turns_number', $player_id);\n }\n self::incStat(1, 'actions_number');\n self::incStat(1, 'actions_number', $player_id);\n self::incStat(1, 'meld_actions_number', $player_id);\n \n // Execute the meld\n try {\n self::transferCardFromTo($card, $card['owner'], 'board');\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::meld');\n self::trace('playerTurn->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n \n // End of player action\n self::trace('playerTurn->interPlayerTurn (meld)');\n $this->gamestate->nextState('interPlayerTurn');\n }", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "public function testViewInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testDeleteClientWithInvalidId() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->get('/clients/' . str_shuffle('ab12') . '/delete')\n ->seeJson(['success' => false]);\n\n }", "public function hasRaidID(){\n return $this->_has(1);\n }", "function checkedituser()\n\t{\n\t\t$query1 = $this->db->query('select * from admin where username = \"'.$this->input->post('username').'\" AND id != \"'.$this->input->post('id').'\" ') or die(mysql_error());\n\t\t\n\t\t//echo 'Coint:'.$query1->num_rows();\texit;\n\t\tif($query1->num_rows() == 0)\n\t\t {\t\t\t\n\t\t\t\techo '0';\t\n\t\t }\n\t\t else\t\t \n\t\t {\n\t\t\t\techo '1';\n\t\t\t}\n\t\t \n\t\t\n\t}", "public function isRequiresQuestionId();", "public function adminBanById(int $id, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBanById', $id . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "public function testGetID() {\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getID (), 'control ID was incorrectly identified' );\r\n\t}", "public function getKick()\n {\n return $this->get(self::_KICK);\n }", "function checkStart(){\r\n\tif (!$this->Eq['A']['id']) $this->sendError(\"你沒有裝備武器,不能出擊。\");\r\n\telseif ($this->Player['en'] < $this->RequireEN) $this->sendError(\"EN不足,無法出擊。\");\r\n\telseif ($this->Player['sp'] < $this->SP_Cost) $this->sendError(\"SP不足,無法以 $Pl->Tactics[name] 出擊。\");\r\n}", "public function hakAkses($id) {\r\n $sql = $this->db->query(\"SELECT * FROM ms_user_role LEFT JOIN ms_role_det ON\"\r\n . \" userro_roleid = roledet_roleid LEFT JOIN ms_menu ON menuid = roledet_menuid\"\r\n . \" WHERE userro_krid = '\" . ses_krid . \"' AND menuid = '$id'\");\r\n if ($sql->num_rows() > 0) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function validateId($id) {\n // check blacklist\n if (in_array($id,$this->blackList)) {\n $this->isBlackListed = true;\n $this->valid = false;\n\n return false;\n }\n\n // check string length\n // GLN Numbers are 14 characters long\n // FN Numbers (with or without FN prefix) are at least 5 characters long\n // GKZ Numbers are 5 characters long\n $this->valid = strlen($id) > 4;\n\n return $this->valid;\n }", "public function doKick($nick, $channel, $reason = null)\n {\n $args = array($nick, $channel);\n\n if (!empty($reason)) {\n $args[] = $reason;\n }\n\n $this->send('KICK', $args);\n }", "function oinkmaster_run($id, $if_real, $iface_uuid)\n{\n\tglobal $config, $g, $snortdir_wan, $snortdir, $snort_md5_check_ok, $emerg_md5_check_ok, $pfsense_md5_check_ok;\n\n\tif ($snort_md5_check_ok != 'on' || $emerg_md5_check_ok != 'on' || $pfsense_md5_check_ok != 'on') {\n\t\tif (empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_on']) && empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_off'])) { \n\t\t\tupdate_status(gettext(\"Your first set of rules are being copied...\"));\n\t\t\tupdate_output_window(gettext(\"May take a while...\"));\n\t\t\texec(\"/bin/cp {$snortdir}/rules/* {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}/rules/\");\n\t\t\texec(\"/bin/cp {$snortdir}/classification.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/gen-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/generators {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/reference.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/sid {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/sid-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/unicode.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t} else {\n\t\t\tupdate_status(gettext(\"Your enable and disable changes are being applied to your fresh set of rules...\"));\n\t\t\tupdate_output_window(gettext(\"May take a while...\"));\n\t\t\texec(\"/bin/cp {$snortdir}/rules/* {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}/rules/\");\n\t\t\texec(\"/bin/cp {$snortdir}/classification.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/gen-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/generators {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/reference.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/sid {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/sid-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\t\t\texec(\"/bin/cp {$snortdir}/unicode.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}\");\n\n\t\t\t/* might have to add a sleep for 3sec for flash drives or old drives */\n\t\t\texec(\"/usr/local/bin/perl /usr/local/bin/oinkmaster.pl -C /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/oinkmaster_{$iface_uuid}_{$if_real}.conf -o /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules > /usr/local/etc/snort/oinkmaster_{$iface_uuid}_{$if_real}.log\");\n\n\t\t}\n\t}\n}", "public function test_squad_server_admin_force_team_change_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange(0));\n }", "function confirmmemberId($memberName, $memberId){\r\n /* Add slashes if necessary (for query) */\r\n if(!get_magic_quotes_gpc()) {\r\n\t $memberName = addslashes($memberName);\r\n }\r\n\r\n /* Verify that user is in database */\r\n $q = \"SELECT memberId FROM \".TBL_USERS.\" WHERE memberName = '$memberName'\";\r\n $result = mysql_query($q, $this->connection);\r\n if(!$result || (mysql_numrows($result) < 1)){\r\n return 1; //Indicates memberName failure\r\n }\r\n\r\n /* Retrieve memberId from result, strip slashes */\r\n $dbarray = mysql_fetch_array($result);\r\n $dbarray['memberId'] = stripslashes($dbarray['memberId']);\r\n $memberId = stripslashes($memberId);\r\n\r\n /* Validate that memberId is correct */\r\n if($memberId == $dbarray['memberId']){\r\n return 0; //Success! memberName and memberId confirmed\r\n }\r\n else{\r\n return 2; //Indicates memberId invalid\r\n }\r\n }", "public function subok($id)\n {\n }", "public function isValidId($id);", "function Del_Mess_Nick($nick)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n $count_mess = 0;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $name = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n $count_mess++;\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n return $count_mess;\n}", "static public function kick_user($user_id, $access_token = '') {\n\t\t$sessions = self::zRange($user_id, 0, -1);\n\t\t//$sessions = array('1:48468b0ef9ae71c32797e50c90e5bd1a');\n\t\tif (empty($sessions)) {\n\t\t\treturn false;\n\t\t}\n\t\t$hash = array();\n\t\tforeach ($sessions as $session) {\n\t\t\t$s = explode(\":\",$session);\n\t\t\tif ($s[1] == $access_token) {\n\t\t\t\tcontinue; \n\t\t\t}\n\t\t\tif (count($s) == 2 ) {\n\t\t\t\tif ($s[0] == 0) {\n RedisSessionWeb::loadConfig();\n\t\t\t\t\t$hash[$session] = RedisSessionWeb::del($s[1]);\n\t\t\t\t\tMemcache::instance()->delete($s[1]);\n\t\t\t\t} else {\n\t\t\t\t\t$a = DBPassportHelper::del_session($s[1]);\n\n $config = \\Frame\\ConfigFilter::instance()->getConfig('idc_check');\n if ( !empty($config['idc']) && $config['idc'] == 'yz' ) {\n $b = DBSwanHelper::del_session($s[1]);\n }\n\n\t\t\t\t\tRedisSession::loadConfig();\n\t\t\t\t\t$hash[$session] = RedisSession::del($s[1]);\n\n\t\t\t\t\t$b= Memcache::instance()->delete(\"Mob:Session:AccessToken:\".$s[1]);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($hash[$session])) {\n\t\t\t\t\tSessionRelation::loadConfig();\n\t\t\t\t\tSessionRelation::zRem($user_id, $session);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//禁止自动登陆\n\t\t//$data = User::update(array('user_id' => $user_id), array('level' => 50));\n\t\t$res = array('user_id' => $user_id, 'hash' => $hash);\n\t\tU::log('passport.kick', json_encode(array($res)));\n\t\treturn $res;\n\n\t}", "public function amIAdminOfKameti($kameti_id, $admin_id) {\n\t\t// Get a MySQL DB connection\n\t\t$this->conn = $this->dbConnect->connect();\n\n\n\t\t// insert query\n $stmt = mysqli_prepare($this->conn, \"SELECT COUNT(*) AS COUNT FROM $this->tablename WHERE (id=? AND admin_id=?)\");\n $this->throwExceptionOnError();\n\n mysqli_stmt_bind_param($stmt,'ii', $kameti_id, $admin_id);\n $this->throwExceptionOnError();\n\n mysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_result($stmt, $count);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_fetch($stmt);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_free_result($stmt);\n\t\tmysqli_close($this->conn);\n\n // Check for successful count\n if ($count > 0) {\n return TRUE;\n }else{\n return FALSE;\n }\n\t}", "private function check($name, $id) {\n if ($name=='' || $id=='') return 0;\n $this->assertTrue($this->isTextPresent(\"$name\"),\"\\\"$name\\\" not found on the page\\n \");\n $this->waitForElementPresent(\"$id\"); \n }", "function process_unlock_set_king($socket, $data)\n{\n if ($socket->process === true) {\n $user_id = $data;\n $player = id_to_player($user_id, false);\n if (isset($player)) {\n $player->gainPart('head', 28, true);\n $player->gainPart('body', 26, true);\n $player->gainPart('feet', 24, true);\n $player->gainPart('eHead', 28);\n $player->gainPart('eBody', 26);\n $player->gainPart('eFeet', 24);\n $player->sendCustomizeInfo();\n }\n $socket->write('{\"status\":\"ok\"}');\n }\n}", "public function testEditInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testGetValidKidByKidId(): void\n {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"kid\");\n\n $kidId = generateUuidV4();\n $kid = new Kid($kidId, $this->adult->getAdultId(), $this->VALID_AVATAR_URL, $this->VALID_CLOUDINARY_TOKEN, $this->VALID_HASH, $this->VALID_NAME, $this->VALID_USERNAME);\n $kid->insert($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoKid = Kid::getKidByKidId($this->getPDO(), $kid->getKidId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"kid\"));\n $this->assertEquals($pdoKid->getKidId(), $kidId);\n $this->assertEquals($pdoKid->getKidAdultId(), $this->adult->getAdultId());\n $this->assertEquals($pdoKid->getKidAvatarUrl(), $this->VALID_AVATAR_URL);\n $this->assertEquals($pdoKid->getKidCloudinaryToken(), $this->VALID_CLOUDINARY_TOKEN);\n $this->assertEquals($pdoKid->getKidHash(), $this->VALID_HASH);\n $this->assertEquals($pdoKid->getKidName(), $this->VALID_NAME);\n $this->assertEquals($pdoKid->getKidUsername(), $this->VALID_USERNAME);\n }", "public function test_squad_server_admin_force_team_change_by_id()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange(0));\n }", "function nick_checker($newnick)\n{\n$conn_nick_checker=mysqli_connect($_SERVER['HTTP_HOST'],$sqlusername,$sqlpassword,$databasename);\n$request_nick=$newnick;\n$query_nick_checker=\"select * from guest_logged where nick='$request_nick'\";\n//one might need to change the table name\n$res_nick_checker=mysqli_query($conn_nick_checker,$query_nick_checker);\n$row_nick_checker=mysqli_fetch_row($res_nick_checker);\nif(!($row_nick_checker==NULL)){ return true;}\nelse {return false;}\n\n}", "function candelbl($uid,$bid)\n{\n $minfo = mysql_fetch_array(mysql_query(\"SELECT bowner FROM ibwf_blogs WHERE id='\".$bid.\"'\"));\n if(ismod($uid))\n {\n return true;\n }\n if($minfo[0]==$uid)\n {\n return true;\n }\n \n return false;\n}", "public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }", "private function isGod() : bool\n {\n return $this->user->id === 1;\n }", "private function checkUserId() {\n\t\tif(!$this->userId || gettype($this->userId) != 'integer') {\n\t\t\tthrow new ErrorException($this->idErrorMessage);\n\t\t}\n\t\treturn true;\n\t}", "public function testDeleteInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'delete',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testRejectInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function getStatus($kickid) {\n\n\t $kick = KICK::find($kickid);\n\n if(empty($kick)){\n return array(\n\t\t\t \"result\"=>self::RESULT_ERR,\n\t\t\t \"status\"=>self::RESULT_ERR\n );\n\t }\n\n\t return array(\n\t\t \"result\"=>self::RESULT_SUCCESS,\n\t\t \"status\"=>$kick->status\n\t );\n }", "public function id_test($id) {\r\n\r\n $error_msg = \"\";\r\n $errors = 0;\r\n\r\n if(isset($id)) {\r\n $identifiant = trim($id);\r\n $identifiant = htmlentities($identifiant, ENT_NOQUOTES, 'utf-8');\r\n $identifiant = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $identifiant);\r\n $identifiant = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $identifiant); // pour les ligatures e.g. '&oelig;'\r\n $identifiant = preg_replace('#&[^;]+;#', '', $identifiant);\r\n $identifiant = str_replace(';', '', $identifiant);\r\n $identifiant = str_replace(' ', '', $identifiant);\r\n $identifiant = str_replace('php', '', $identifiant);\r\n\r\n if($identifiant == '') {\r\n $error_msg .= \"Vous devez spécifier un identifiant. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) < 3) {\r\n $error_msg .= \"Votre identifiant est trop court. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) > 24) {\r\n $error_msg .= \"Votre identifiant est trop long. <br/>\";\r\n $errors++;\r\n } else {\r\n\r\n if(Model::getModel(\"Session\\\\User\")->exists($identifiant)) {\r\n $error_msg .= \"Cet identifiant est déjà utilisé. <br/>\";\r\n $errors++;\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return array(\r\n \"value\" => $identifiant,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "function whois_check(&$irc, &$data)\n\t{\n\t\tglobal $pickupchannel;\n\t\tglobal $pickup;\n\t\tglobal $queue;\n\t\tglobal $users;\n\n\t\t//Check for commands on queue\n\t\tif($data->rawmessageex[1] == \"330\")\n\t\t{\n\t\t\tif($queue[$data->rawmessageex[3]][0][\"nick\"] == $data->rawmessageex[3])\n\t\t\t{\n\t\t\t\t//Get qauth and nick\n\t\t\t\t$nick = $data->rawmessageex[3];\n\t\t\t\t$qauth = $data->rawmessageex[4];\n\n\t\t\t\t//Check the queue\n\t\t\t\tif($users->is_banned($qauth))\n\t\t\t\t{\n\t\t\t\t\tif($queue[$data->rawmessageex[3]][0][\"command\"] == \"check\")\n\t\t\t\t\t{\n\t\t\t\t\t\t//Check if the user is in the database\n\t\t\t\t\t\tif($users->is_added($qauth) == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$irc->message(SMARTIRC_TYPE_QUERY, \"Q\", \"TEMPBAN \".$pickupchannel.\" *!*@\".$qauth.\".users.quakenet.org 1m This is an invite-only pickup.\");\n\t\t\t\t\t\t\t//$irc->kick($pickupchannel, $nick, \"This is an invite-only pickup.\");\n\t\t\t\t\t\t\t//Remove command\n\t\t\t\t\t\t\tarray_shift($queue[$nick]);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($users->is_banned($qauth) === false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users->nick_change_join($qauth, $nick);\n\t\t\t\t\t\t\t\t$users->mark_inchannel($qauth);\n\t\t\t\t\t\t\t\tarray_shift($queue[$nick]);\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$irc->message(SMARTIRC_TYPE_QUERY, \"Q\", \"TEMPBAN \".$pickupchannel.\" *!*@\".$qauth.\".users.quakenet.org 1m This is an invite-only pickup.\");\n\t\t\t\t\t\t\t\tarray_shift($queue[$nick]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function isUnsigned($id)\n {\n $participant = Participant::where('id',$id)->first();\n return (count ($participant->teams) < 2);\n }", "function check_id($id) {\n\tif ( !preg_match( '/^[A-z0-9]+$/', $id ) ) {\n\t\treturn false;\n\t}\n\t# Check\tif the directory actually exists\n\tglobal $basedir;\n\tif ( !file_exists( $basedir . \"/\" . $id . \"/\" ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "public static function block($id, $blocking_id){\n if(!Auth::check() || !(Auth::user()->id == $id)) return 1;\n if($id === $blocking_id) return 2;\n return 0;\n }", "public function hasId() : bool;", "public function command() {\n\n\n $this->bot->log(\"Fetching joke.\");\n\n $data = $this->fetch(\"http://api.icndb.com/jokes/random\");\n\n // ICNDB has escaped slashes in JSON response.\n $data = stripslashes($data);\n\n $joke = json_decode($data);\n\n if ($joke) {\n if (isset($joke->value->joke)) {\n $this->say(html_entity_decode($joke->value->joke));\n return;\n }\n }\n\n $this->say(\"I don't feel like laughing today. :(\");\n }", "public function event_kicked($who, $why)\r\n\t{\r\n\r\n\t}", "public function get_check() {\n\t\tif($id = Input::get('rel_id')) {\n\t\t\tif($id_list = Cookie::get('divec_cart')) {\n\t\t\t\tif(in_array($id, explode('-', $id_list))) {\n\t\t\t\t\t$this->response(array('success' => 'true'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->response(array('success' => 'false'));\n\t}", "function check_by_admin_user_id($admin_user_id, $game_id)\n {\n $this->db->where('game_id', $game_id);\n $this->db->where('admin_user_id', $admin_user_id);\n $c = $this->db->count_all_results('player_admin_swap') == 1;\n if ($c)\n return TRUE;\n else\n return FALSE;\n }", "private function check_kaitou_id($kaitou_id) {\n $sql = 'SELECT count(id) as cnt FROM kaitou WHERE id = ?';\n $res = $this->db->select($sql, array('id' => (int)$kaitou_id));\n return $res[0]['cnt']>0?true:0;\n }", "function verify_user($conn, $id, $hash){\n\t$sql = \"SELECT id from Session\n\tWHERE id=$id and hash='$hash'\";\n\n\t$result = $conn->query($sql);\n\n\treturn ($result->num_rows > 0);\n}", "public function verifyLogdinCro($id) {\n\t$currentUser = $this->getCurrentUser();\n\t$query = $this->getEntityManager()->createQueryBuilder();\n\t$query->select(array(\"sp.id\"))\n ->from($this->getTableName(), \"sp\")\n\t\t->where($query->expr()->eq('sp.cro_id', intval($currentUser->getCompany()->getId())))\n\t\t->andWhere($query->expr()->eq('sp.study_id', intval($id)));\n\t$result = $this->getEntityManager()->getConnection()->executeQuery($query)->fetchAll();\n\treturn count($result);\n\t\t\t\n }", "public function testProfilePrototypeUpdateByIdQuarantines()\n {\n\n }", "private function validateCommandNumber (\n int $command\n ): bool\n {\n return in_array($command, [\n self::COMMAND_ADD,\n self::COMMAND_MULTIPLY,\n self::COMMAND_HALT\n ]);\n }", "function checkMethod($id)\n {\n $token= 'Authorization: Bearer '.$_SESSION['usertoken'];\n\n $curl = new curl\\Curl();\n $curl->setOption(CURLOPT_HTTPHEADER, ['Content-Type: application/json' , $token]);\n $curl->setOption(CURLOPT_CONNECTTIMEOUT, 120);\n $curl->setOption(CURLOPT_TIMEOUT, 120);\n $curl->setOption(CURLOPT_SSL_VERIFYPEER, false);\n $response = $curl->setGetParams(['id' => Yii::$app->user->identity->profile->rstl_id.'-'.$id,])->get($this->source.\"checkmethod\");\n \n if($curl->errorCode != null){\n $response = 'Please try again later.';\n }\n return $response;\n }", "public function adminWarnById(int $playerId, string $warnReason) : bool\n {\n return $this->_consoleCommand('AdminWarnById', $playerId . ' ' . $warnReason, 'Remote admin has warned player ');\n }", "public function testApproveInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}" ]
[ "0.7142423", "0.6444565", "0.59535444", "0.59183806", "0.5911984", "0.59015626", "0.5898159", "0.58456606", "0.56715405", "0.56634456", "0.5462734", "0.5407593", "0.5350294", "0.527448", "0.52650887", "0.5239024", "0.5181409", "0.51670814", "0.5155887", "0.5153842", "0.510887", "0.50683", "0.5064635", "0.50553435", "0.502908", "0.5002825", "0.49869674", "0.497524", "0.49663913", "0.49648756", "0.49643648", "0.496369", "0.49225906", "0.49124056", "0.49100193", "0.49004582", "0.48801795", "0.48797393", "0.48784947", "0.48698452", "0.4865545", "0.4845976", "0.48402584", "0.48254386", "0.48198628", "0.48167616", "0.48142025", "0.48135796", "0.48071766", "0.48026526", "0.48007005", "0.47966602", "0.47964785", "0.47959748", "0.479364", "0.47928542", "0.4791576", "0.47838172", "0.47812626", "0.4780469", "0.47786984", "0.47777382", "0.47742513", "0.477141", "0.4767078", "0.47659862", "0.47634903", "0.47611266", "0.47575283", "0.47561362", "0.47559988", "0.47544944", "0.4753186", "0.47519493", "0.47481796", "0.47478816", "0.47468126", "0.47335166", "0.47308296", "0.47303888", "0.47298813", "0.4726148", "0.4725235", "0.47199613", "0.47076887", "0.47075543", "0.47065258", "0.47040942", "0.47029075", "0.47000757", "0.4698912", "0.46917254", "0.46914193", "0.4686395", "0.4686113", "0.46845967", "0.46818095", "0.46777633", "0.4677341", "0.46736205" ]
0.71932113
0
Verifies the ban command does work properly
public function test_admin_ban() { $this->assertTrue($this->postScriptumServer->adminBan('Marcel', '1h', 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ban();", "public function test_admin_ban()\n {\n $this->assertTrue($this->btwServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "function ban_loginOk($args) {\n $ip = $_SERVER['REMOTE_ADDR']; \n $this->load_ipban();\n \n unset($this->data_ban['FAILURES'][$ip]); \n unset($this->data_ban['BANS'][$ip]);\n \n $this->write_ipban();\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Login ok for %s.\\n\", $ip));\n return $args;\n }", "function checkBan(){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\r\n\t#see if user is suspended.\r\n\tif($ci->suspend_length > 0){\r\n\t\t#see if user is still suspended.\r\n\t\t$math = 3600 * $ci->suspend_length;\r\n\t\t$suspend_date = $ci->suspend_time + $math;\r\n\t\t$today = time() - $math;\r\n\r\n\t\tif($suspend_date > $today){\r\n\t\t\texit(show_error($ci->lang->line('suspended')));\r\n\t\t}\r\n\t}\r\n\t#see if the IP of the user is banned.\r\n\t$uip = detectProxy();\r\n\r\n\t$ci->db->distinct('ban_item')->from('ebb_banlist')->where('ban_type', 'IP')->like('ban_item', $uip)->limit(1);\r\n\t$banChk = $ci->db->count_all_results();\r\n\r\n\t#output an error msg.\r\n\tif($banChk == 1){\r\n\t\texit(show_error($ci->lang->line('banned')));\r\n\t}\r\n}", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->btwServer->adminBanById(1, '1h', 'Test'));\n }", "public function ban($expression) {\n $this->execute('ban ' . $expression);\n }", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminBanById(1, '1h', 'Test'));\n }", "function ban($db, $pseudo, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE pseudo = \\\"$pseudo\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE pseudo = \\\"$pseudo\\\"\"); \n }\n return true;\n}", "function ban_canLogin($args) {\n $ip=$_SERVER[\"REMOTE_ADDR\"]; \n if ( $this->isWhitelisted($ip) )\n return $args;\n \n $this->load_ipban();\n\n if (!empty($this->data_ban['BANS'][$ip]) ) {\n if( $this->data_ban['BANS'][$ip]<=time()) { \n unset($this->data_ban['FAILURES'][$ip]); \n unset($this->data_ban['BANS'][$ip]);\n \n $this->write_ipban();\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Ban lifted for %s.\\n\", $ip));\n }\n else $args['pass'] = '';\n } \n \n return $args; \n }", "function procBanUser(){\r\n\t\t\tglobal $session, $database, $form;\r\n\t\t\t/* Username error checking */\r\n\t\t\t$subuser = $this->checkUsername(\"banuser\");\r\n\t\t\t\r\n\t\t\t/* Errors exist, have user correct them */\r\n\t\t\tif($form->num_errors > 0){\r\n\t\t\t\t$_SESSION['value_array'] = $_POST;\r\n\t\t\t\t$_SESSION['error_array'] = $form->getErrorArray();\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t\t/* Ban user from member system */\r\n\t\t\telse{\r\n\t\t\t\t$q = \"DELETE FROM \".TBL_USERS.\" WHERE username = '$subuser'\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\t\r\n\t\t\t\t$q = \"INSERT INTO \".TBL_BANNED_USERS.\" VALUES ('$subuser', $session->time)\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t}", "function check_ban ($database, $mpre, $spre, $email, $ip, $type)\n{\n\t// Expire old bans fist\n\t$time = time();\n\t$qry = \"SELECT id FROM {$spre}banlist WHERE expire<'$time' AND expire!='0' AND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n while (list($bid) = mysql_fetch_array($result))\n {\n \t$qry2 = \"UPDATE {$spre}banlist SET active='0' WHERE id='$bid' OR alias='$bid'\";\n \t$database->openConnectionNoReturn($qry2);\n\t}\n\n\t$qry = \"SELECT date, auth, reason, alias, level\n \t\tFROM {$spre}banlist\n WHERE ( (email='$email' AND email!='') OR (ip='$ip' AND ip!='') )\n \tAND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n\n if (!mysql_num_rows($result))\n {\n\t // Check wildcard IPs\n\t $qry2 = \"SELECT ip FROM {$spre}banlist WHERE ip LIKE '%*%' AND active='1'\";\n\t $result2 = $database->openConnectionWithReturn($qry2);\n\t list($banip) = mysql_fetch_array($result2);\n while ($banip && !$wildcard)\n\t {\n\t $wildcard = check_wild_IP($ip, $banip);\n\t if ($wildcard)\n {\n\t $qry = \"SELECT date, auth, reason, alias, level\n\t FROM {$spre}banlist WHERE ip='$banip'\";\n\t $result = $database->openConnectionWithReturn($qry);\n }\n list($banip) = mysql_fetch_array($result2);\n\t }\n }\n\n // If a result was returned, then this person's banned!\n if (mysql_num_rows($result))\n {\n \tlist ($date, $auth, $reason, $alias, $level) = mysql_fetch_array($result);\n\n // {$alias != \"0\"} indicates that the matched ban actually\n // links to a different ban (ie, multiple email/IPs)\n if ($alias != \"0\")\n {\n $qry = \"SELECT date, auth, reason FROM {$spre}banlist WHERE id='$alias'\";\n $result = $database->openConnectionWithReturn($qry);\n list ($date, $auth, $reason) = mysql_fetch_array($result);\n }\n\n\t\t// If it's a command ban, then we need to make sure it's a command app\n if ( ($level == \"command\" && ($type == \"ship\" || $type == \"command\")) ||\n\t\t\t $level != \"command\")\n {\n \t $reason = date(\"F j, Y\", $date) . \"<br /><br />\" . $reason . \"\\n\";\n\t\t\t$reason = \"Authorized by: \" . $auth . \"<br /><br />\" . $reason . \"\\n\";\n\t return $reason;\t\t\t// Returns positive\n }\n }\n // No results - person's not banned\n return;\n}", "public function ban(Request $request)\n {\n $user = User::role('admin')->where('id', $request->id)->first();\n if ($request->ban == 'true') {\n $user->removeRole('ban');\n return true;\n } else {\n $user->assignRole('ban');\n return false;\n }\n }", "public function testBanAndUnbanEloquentUser()\n {\n $dbUser = DB::table('users')->find(1);\n\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 0);\n\n $user = $this->getTestUser();\n\n $user->ban();\n //\n $dbUser = DB::table('users')->find(1);\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 1);\n\n $user->unban();\n //\n $dbUser = DB::table('users')->find(1);\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 0);\n\n }", "function is_baned($ip)\r\n{\r\n\tglobal $db_url;\r\n\t$all_baned_ips=array();\r\n\t$db=YDB::factory($db_url);\r\n\t$result=$db->queryAll(sprintf(parse_tbprefix(\"SELECT * FROM <badip> WHERE ip='%s'\"),$db->escape_string($ip)));\r\n\tif($result)\r\n\t\treturn true;\r\n\treturn false;\r\n}", "public function isBanned(){\n return $this->banned;\n }", "public function actionBanned()\n\t{\n\t\t$model = CoreSettings::findOne(1);\n if ($model === null) {\n $model = new CoreSettings();\n }\n\t\t$model->scenario = CoreSettings::SCENARIO_BANNED;\n\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n // $postData = Yii::$app->request->post();\n // $model->load($postData);\n // $model->order = $postData['order'] ? $postData['order'] : 0;\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Spam & banning setting success updated.'));\n return $this->redirect(['banned']);\n\n } else {\n if (Yii::$app->request->isAjax) {\n return \\yii\\helpers\\Json::encode(\\app\\components\\widgets\\ActiveForm::validate($model));\n }\n }\n }\n\t\t\n\t\t$this->view->title = Yii::t('app', 'Spam & Banning Tools');\n\t\t$this->view->description = Yii::t('app', '{app-name} platform are often the target of aggressive spam tactics. This most often comes in the form of fake user accounts and spam in comments. On this page, you can manage various anti-spam and censorship features. Note: To turn on the signup image verification feature (a popular anti-spam tool), see the {setting} page.', ['app-name' => Yii::$app->name, 'setting' => Html::a(Yii::t('app', 'Signup Setting'), Url::to(['signup']))]);\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_banned', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "function check_IP_ban_list(){\r\n\r\n\t\t#OPEN BAN IP LIST\r\n\t\t//$fp = fopen(DIR_SERVER_ROOT.'ilcfg/ban_list.inc.php', 'r');\r\n\t\t//$_deny_ip = explode(\"\\n\", fread($fp, filesize(DIR_SERVER_ROOT.'ban_list.inc.php')));\r\n\r\n\t\t$_ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t$_allowed = false;\r\n\t\tforeach($this->_allow_ip as $_a_ip){\r\n\t\t\t$_a_ip = str_replace('.','\\.',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('*','[0-9]{1,3}',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('?','[0-9]{1}',$_a_ip);\r\n\t\t\tif(ereg(\"^{$_a_ip}$\", $_ip)) $_allowed = true;\r\n\t\t}\r\n\t\tif(!$_allowed) die($_error_message);\r\n\t\t$_allowed = true;\r\n\t\tforeach($this->_deny_ip as $_d_ip){\r\n\t\t\t$_d_ip = str_replace('.','\\.',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('*','[0-9]{1,3}',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('?','[0-9]{1}',$_d_ip);\r\n\t\t\tif(ereg(\"^{$_d_ip}$\", $_ip)) $_allowed = false;\r\n\t\t}\r\n\t\tif(!$_allowed)\r\n\t\t{\r\n\t\t\t$this->ip_detect_mail();\r\n\t\t\tinclude(DIR_SERVER_ROOT.BAN_IP_PAGE);\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function baned()\n {\n\t\t$source = $this->render('baned.html', array());\n\t\t$this->_view($source);\n\t}", "public function isBanned()\n {\n return (bool) $this->ban;\n }", "public function banWord( $bannedWord ){ return $this->APICall( array( 'banWord' => $bannedWord ), \"Could not insert banned autogenerated word \" . $bannedWord ); }", "protected function validateBan() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canBanUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\t$userIDs = [];\r\n\t\tforeach ($this->objects as $user) {\r\n\t\t\tif (!$user->banned) {\r\n\t\t\t\t$userIDs[] = $user->userID;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups($userIDs);\r\n\t}", "public function procBanUser() {//IF time permits, re-implement using new User classes\r\n global $session;\r\n\n /* Username error checking */\n $field = \"banuser\"; //Use the field for username\r\n $subuser = $this->_checkUsername($field);\r\n\n if($subuser == $session->user->username) { /* Make sure no one tries and ban themselves */\n $session->form->setError($field, \"* You can't ban yourself!<br />\");\n }\n\r\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Ban user from member system */\r\n \t$uid = $session->database->getUID($subuser);\n $session->database->removeUser($uid, DB_TBL_ADMINS);\r\n $session->database->removeUser($uid, DB_TBL_TELLERS);\r\n $session->database->removeUser($uid, DB_TBL_CUSTOMERS);\r\n\r\n $q = \"INSERT INTO \".DB_TBL_BANNED_USERS.\" VALUES ('$subuser', $session->time)\";\r\n $session->database->query($q);\n }\n header(\"Location: \".$session->referrer);\r\n }", "function ban_user($reason, $duration, $user_id) {\n\tif(!set_user_role(ROLE_BANNED, $user_id)) {\n\t\treturn false;\n\t}\n\tadd_ban_details($reason, $duration, $user_id);\n\n\treturn true;\n}", "public function isBanned()\n {\n return $this->is_banned;\n }", "public function isBanned() {\n return !! $this->is_banned;\n }", "function check_if_banned($pdo, $user_id, $ip, $scope = 'b', $throw_exception = true)\n{\n if ($scope === 'n') {\n return;\n }\n\n $bans = query_if_banned($pdo, $user_id, $ip);\n if ($bans !== false) {\n foreach ($bans as $ban) {\n if ($ban !== false && ($scope === $ban->scope || $scope === 'b')) { // g will supercede s if scope is b\n if ($throw_exception) {\n $output = make_banned_notice($ban);\n throw new Exception($output);\n }\n return $ban;\n }\n }\n }\n return false;\n}", "function errorlog_is_fail2ban() {\n return true; //exec() ps ef | grep python.*fail2ban-server;\n}", "public function isBanned() {\n return $this->getStatus() === Status::BANNED;\n }", "public function testValidation()\n {\n $req = new Request\\Ban('', []);\n self::assertFalse($req->isValid());\n\n $req = new Request\\Ban('', 'value');\n self::assertTrue($req->isValid());\n\n $req = new Request\\Ban('', ['value']);\n self::assertTrue($req->isValid());\n\n $req = new Request\\Ban('host', []);\n self::assertFalse($req->isValid());\n\n $req = new Request\\Ban('host', ['value']);\n self::assertTrue($req->isValid());\n }", "public function banORunBan($id)\n {\n try {\n $instance = $this->find($id);\n if ($instance->banned === 0) {\n \\Toastr::warning(trans('bans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = true;\n } else {\n \\Toastr::info(trans('unbans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = false;\n }\n $instance->update();\n } catch (\\Exception $e) {\n return response(\"Error appeared. Maybe model doesn't have banned field\" . $e->getMessage(), $e->getCode());\n }\n }", "public function ban(Request $request, $id)\n {\n //\n \n $data = customer::where('Customer_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Ban_Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n //if($validatedPass == $data1){\n \n \n DB::select(\"UPDATE customers set Ban_Reason = '$reason' , Customer_Status = 'BANNED' where Customer_ID = ?\",[$id]);\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerInformationInterface', compact(\"data\"));\n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationInterface', compact(\"data\"));\n }\n }", "function banId($db, $id, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE id = \\\"$id\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE id = \\\"$id\\\"\"); \n }\n return true;\n}", "function check_banlist($banlist, $email) {\n if (count($banlist)) {\n $allow = true;\n foreach($banlist as $banned) {\n $temp = explode(\"@\", $banned);\n if ($temp[0] == \"*\") {\n $temp2 = explode(\"@\", $email);\n if (trim(strtolower($temp2[1])) == trim(strtolower($temp[1])))\n $allow = false;\n } \n\t\telse {\n if (trim(strtolower($email)) == trim(strtolower($banned)))\n $allow = false;\n }\n }\n }\n if (!$allow) {\n print_error(\"You are using from a <b>banned email address.</b>\");\n }\n}", "function banNickName($nickName){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getBanFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setBanFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->banNickName($nickName);\n\t\t\t\n\t\t}", "public function isBanned() {\n return $this->vacBanned;\n }", "public function adminBan(string $nameOrSteamId, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBan', $nameOrSteamId . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "public function isBanned()\n\t{\n\t\treturn !is_null($this->banned_at);\n\t}", "function is_banned()\n\t{\n\t\treturn $this->_banned;\n\t}", "public function banR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'BANNED' where Rider_ID = ?\",[$id]);\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RiderInformationInterface', compact(\"data\"));\n } \n else {\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationRInterface', compact(\"data\"));\n }\n }", "function ban_loginFailed($args) {\n $ip = $_SERVER['REMOTE_ADDR']; \n if ( $this->isWhitelisted($ip) ) {\n rcube::write_log('bruteforcebreaker', sprintf(\"Whitelist login for %s.\", $ip));\n return $args;\n }\n \n $this->load_ipban();\n \n if (!isset($this->data_ban['FAILURES'][$ip])) \n $this->data_ban['FAILURES'][$ip] = 0;\n $this->data_ban['FAILURES'][$ip]++;\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Login failed for %s. Number of attemps: %d.\", $ip, $this->data_ban['FAILURES'][$ip]));\n \n if ($this->data_ban['FAILURES'][$ip] > ($this->rc->config->get('bruteforcebreaker_nb_attemps', 5) -1 )) {\n $this->data_ban['BANS'][$ip] = time() + $this->rc->config->get('bruteforcebreaker_duration', 1800);\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"IP address banned from login - too many attemps (%s).\", $ip));\n }\n\n $this->write_ipban();\n return $args;\n }", "function validateMember($member, $shareId, $balance) {\n\t\t$status = 1; // se inicializa el status y luego cambia si entra en las condiciones de bloqueo\n\t\t$message = '';\n\n\t\tif($balance < 0) {\n\t\t\t$balanceStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_SALDO_DEUDOR'); // Archivo config\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($balanceStatus,$status);\n\t\t\t$status = $status - $balanceStatus;\n\t\t}\n\n\t\t$records = $this->recordRepository->getBlockedRecord($member);\n\t\tif(count($records)) {\n\t\t\tforeach ($records as $key => $value) {\n\t\t\t\t$recordStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_BLOQUEO_EXPEDIENTE');\n\t\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($recordStatus,$status);\n\t\t\t\t$status = $status - $recordStatus;\n\t\t\t\t$message .= 'Bloqueo activo por expediente :'.$value->id.', hasta la fecha '.$value->expiration_date.'<br>';\n\t\t\t}\n\t\t}\n\n\t\t$share = $this->shareRepository->find($shareId);\n\n\t\tif($share && $share->shareType && $share->shareType()->first()->access == 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La Accion no posee acceso <br>';\n\t\t}\n\n\n\t\tif($share && $share->permit == 1) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La accion '.$share->share_number.' tiene un permiso activo y no puede ingresar <br>';\n\t\t}\n\t\tif($share->status === 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($shareStatus,$status);\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* Accion Inactiva <br>';\n\t\t}\n\n\t\t$personStatus = $this->checkPersonStatus($member);\n\t\tif($personStatus === \"Inactivo\"){\n\t\t\t$personStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_INACTIVO');\n\t\t\t// $status = $this->getAccesControlStatus($personStatus,$status);\n\t\t\t$status = $status - $personStatus;\n\t\t\t$message .= '* Socio Inactivo <br>';\n\t\t}\n\t\tif($message !== '') {\n\t\t\t$currentPerson = $this->personModel->query(['name', 'last_name', 'rif_ci', 'card_number'])->where('id', $member)->first();\n\t\t\t$name = '<strong>'.$currentPerson->name.' '.$currentPerson->last_name.'</strong> Carnet: '.$currentPerson->card_number;\n\t\t\t$message = '<br><div><div>'.$name.'</div><div>'.$message.'</div></div>';\n\t\t}\n\t\t// se retorna el mensaje de error y el estatus , estos valores son usados para el registro final de cada miembro\n\t\treturn (object)[ 'message' => $message, 'status' => $status ];\n\t}", "function ban_user($id_auteur)\n{\n\t$user_ip = (isset($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR');\n\n\tif (empty($id_auteur)) return;\n\n\t// On le recherche\n\t$is_spammer = sql_fetsel('id_auteur', 'spip_auteurs_spipbb', \"id_auteur=$id_auteur\");\n\t$infos = sql_fetsel('login, email', 'spip_auteurs', \"id_auteur=$id_auteur\");\n\n\tif (is_array($is_spammer) and !empty($is_spammer['id_auteur']) and $is_spammer['user_spam_warnings'] > $GLOBALS['spipbb']['sw_nb_spam_ban'] ) // parametrage\n\t{\n\t\t@sql_updateq('spip_auteurs_spipbb', array(\n\t\t\t\t\t'ip_auteur' => $user_ip,\n\t\t\t\t\t'ban' => 'oui'\n\t\t\t\t\t\t\t),\n\t\t\t\t\"id_auteur=$id_auteur\");\n\t\t$login = $infos['login'];\n\t\t$email = $infos['email'];\n\t\t@sql_insertq('spip_ban_liste', array(\n\t\t\t\t\t'ban_ip' => $user_ip,\n\t\t\t\t\t'ban_login' => $login,\n\t\t\t\t\t'ban_email' => $email,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t}\n}", "public function ban($id=null){\n if($this->request->is('get')){\n throw new MethodNotAllowedException();\n }\n\n $this->request->data['User']['id']=$id;\n $this->request->data['User']['banned']=1;\n if($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('User have been banned'));\n $this->redirect(array('controller'=>'users','action'=>'index'));\n }\n }", "function get_ban_reason()\n\t{\n\t\treturn $this->_ban_reason;\n\t}", "public function ban(User $mod, User $user) {\n return $mod->getLastStatus()->status == 'moderator' && \n $user->getLastStatus()->status != 'moderator' && \n $user->getLastStatus()->status != 'banned';\n }", "public function ban(Request $request)\n {\n $user = User::find($request->id);\n if (\\Auth::user()->type === 'admin'){\n $user->update(['status' => 13]);\n alert()->success('کاربر با موفقیت مسدود شد', 'مسدود شد');\n return redirect()->back();\n }else{\n alert()->warning('عدم دسترسی');\n return redirect()->route('panel.index');\n }\n\n }", "public function testBlacklistFromShowPage(): void {\n // go to the show page of the second item.\n $crawler = $this->logInSuperAdmin();\n $client = $this->getClient();\n $crawler = $client->click($crawler->filter(\"#navbar\")->selectLink(\"Gestion des contacts\")->link());\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $crawler = $client->click($tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\")->selectLink(\"Voir les détails\")->link());\n\n // Verify if the blacklist button is displayed and submit the form.\n $actionButtons = $crawler->filter(\"#admin-container .card .actions\")->children();\n $this->count(3, $actionButtons, \"1.1. Two action buttons are expected.\");\n $this->assertContains(\"Ip sur liste noire\", $actionButtons->eq(2)->text(), \"1.2. The label of the third button is not ok.\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $actionButtons->eq(2)->html(), \"1.3. The icon of the third button is not ok.\");\n\n // blacklist the message ip and verify the result\n $client->submit($actionButtons->eq(2)->selectButton('Ip sur liste noire')->form());\n $crawler = $client->followRedirect();\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"2.1 The status code expected is not ok.\");\n $this->assertEquals(\"/sadmin/contact\", $client->getRequest()->getRequestUri(), \"2.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"2.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"2.4 One success message is expected\");\n $this->assertRegExp(\"~L'ip \\\"[0-9\\.]+\\\" a été blacklistée avec succès !~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"2.5 The success message is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(1)->children()->eq(3)->html(), \"2.6 The blacklisted icon is not expected\");\n $this->assertCount(2, $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\"), \"2.7 Two actions button are expected\");\n }", "function eth_check_burn($addr, $txid) {\n\n\treturn -1;\n}", "function isBanned()\n {\n if ( $this->getVar( 'level' ) == 6 ) {\n return true;\n }\n return false;\n }", "public function is_banned($member)\n {\n $rows = $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'banned WHERE uid=' . strval($member));\n if (empty($rows[0])) {\n return false; //the member is never banned\n } else {\n $ban_till = $rows[0]['lifted']; //the user is banned till this date/time\n }\n\n if ($ban_till === 0) {\n return true; //the member is permanently banned\n } elseif ($ban_till < time()) {\n return false; //the ban time is over\n } else {\n return true; //the member is still banned (not permanently banned)\n }\n }", "public static function ipAllowed($allows, $bans) {\n\t\t$return = TRUE;\n\t\t$match = FALSE;\n\t\t$currentIp = '';\n\t\tif (isset($_SERVER[\"REMOTE_ADDR\"])) {\n\t\t\t$currentIp = $_SERVER[\"REMOTE_ADDR\"];\n\t\t} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$currentIp = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t\tif (trim($currentIp)) {\n\t\t\tif (trim($allows)) {\n\t\t\t\t$allows = makeArray($allows);\n\t\t\t\tfor ($i = 0, $c = count($allows); $i < $c; $i++) {\n\t\t\t\t\tif (trim($allows[$i]) != '') {\n\t\t\t\t\t\t$allows[$i] = substr($allows[$i], 0, strpos($allows[$i], '*') - 1);\n\t\t\t\t\t\tif (strlen($allows[$i]) > 0) {\n\t\t\t\t\t\t\tif ($allows[$i] == substr($currentIp, 0, strlen($allows[$i]))) {\n\t\t\t\t\t\t\t\t$match = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$match) {\n\t\t\t\t\t// Current IP address not in whitelist.\n\t\t\t\t\t$return = FALSE;\n\t\t\t\t}\n\t\t\t} else if (trim($bans)) {\n\t\t\t\t$bans = makeArray($bans);\n\t\t\t\tfor ($i = 0, $c = count($bans); $i < $c; $i++) {\n\t\t\t\t\tif (trim($bans[$i]) != '') {\n\t\t\t\t\t\t$bans[$i] = substr($bans[$i], 0, strpos($bans[$i], '*') - 1);\n\t\t\t\t\t\tif (strlen($bans[$i]) > 0) {\n\t\t\t\t\t\t\tif ($bans[$i] == substr($currentIp, 0, strlen($bans[$i]))) {\n\t\t\t\t\t\t\t\t$match = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($match) {\n\t\t\t\t\t// Current IP address found in blacklist.\n\t\t\t\t\t$return = FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public function banned()\n {\n $userId = request()->user;\n $user = User::find($userId);\n if ($user->isNotBanned()) {\n $user->ban();\n } else {\n $user->unban();\n }\n return redirect()->route('users.index', [\n 'user' => $user\n ]);\n }", "public function testBlacklistActionErrorInEn(): void {\n // get the entity to blacklist\n /* @var $contactMessage NSEntity\\ContactMessage */\n $contactMessage = $this->getEntityManager()->getRepository(NSEntity\\ContactMessage::class)->findOneByIp(\"127.0.0.1\");\n\n // prepare the datas to post\n $client = $this->getClient();\n $csrfToken = $client->getContainer()->get('security.csrf.token_manager')->getToken('contact_message_form');\n $parameters = [\n \"form\" => [\n \"_token\" => $csrfToken,\n ]\n ];\n\n // launch the test\n $this->logInSuperAdmin(\"en\");\n $client->request(\"POST\", sprintf(\"/en/sadmin/contact/%d/blacklist\", $contactMessage->getId()), $parameters);\n $crawler = $client->followRedirect();\n\n // verify the test\n $this->assertEquals(200, $client->getResponse()->getStatusCode(), \"1. The http status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"2. The request uri expected is not ok\");\n $this->assertEquals(1, $crawler->filter(\".message-container .alert-danger\")->count(), \"3. The error message is missing\");\n $this->assertContains(sprintf(\"The \\\"%s\\\" ip has been blacklisted already!\", $contactMessage->getIp()),\n $crawler->filter(\".message-container .alert-danger\")->text(), \"4. The error message expected is not ok.\");\n }", "public function check_balance()\n {\n $data = array(\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->paybill,\n 'IdentifierType' => '4',\n 'Remarks' => 'Remarks or short description',\n 'Initiator' => $this->initiator_username,\n 'SecurityCredential' => $this->get_credential(),\n 'QueueTimeOutURL' => $this->balance_check_result_url,\n 'ResultURL' => $this->balance_check_result_url\n );\n $data = json_encode($data);\n $url = $this->base_url . 'accountbalance/v1/query';\n $response = $this->submit_request($url, $data);\n return $response;\n }", "public function isUserBannedxxx()\n {\n $db = $this->_db;\n $sql = sprintf(\"SELECT ban_id FROM %s\n WHERE banned_ip = %s LIMIT 1;\"\n , S_TABLE_BANS\n , $this->getUserIp()\n );\n\n $result = $db->sql_query($sql);\n $row = $db->sql_fetchrow($result);\n\n return ($row)\n ? true\n : false;\n }", "function spam_karma_blacklist_ban() {\r\n\t// blacklist those IPs who haven't spammed in 60 days.\r\n\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t$ip = apply_filters( 'spam_karma_blacklist_ban_get_ip', $ip );\r\n\tif( empty( $ip ) ) \r\n\t\treturn;\r\n\t\r\n\tglobal $wpdb;\r\n\trequire_wp_db(); // in the off case that the database isn't loaded yet.\r\n\r\n\t$blacklist_count = $wpdb->get_var( $wpdb->prepare( \"SELECT `used_count` FROM `sk2_blacklist` WHERE `type` = 'ip_black' AND `value` = '%s' LIMIT 1\", $ip ) );\r\n\tapply_filters( 'spam_karma_blacklist_ban_count', $blacklist_count );\r\n\tif ( $blacklist_count - SPAM_KARMA_BLACKLIST_COUNT_TO_BAN > 0 ) {\r\n\t\tdo_action( 'spam_karma_blacklist_ban_do_ban' );\r\n\t\theader(\"HTTP/1.0 403 Forbidden\", true, 403);\r\n\t\tdie();\r\n\t}\r\n}", "function cicleinscription_verify_username_blacklist($username){\n\tglobal $DB;\n\t\n\t$result = $DB->get_record('ci_blacklist', array('username'=>$username, 'statusblacklist' => 's'));\n\t\n\treturn $result ? $result : false;\n}", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $ban = isset($user_id) && $user_id != 0 ? ban_select_active_by_user_id($pdo, $user_id) : false; // user_id\n $ban = !$ban && isset($ip) ? ban_select_active_by_ip($pdo, $ip) : $ban; // ip if user_id isn't found\n return $ban;\n}", "function usernameBanned($username){\r\n if(!get_magic_quotes_gpc()){ $username = addslashes($username); }\r\n $query = \"SELECT username FROM \".TBL_BANNED_USERS.\" WHERE username = :username\";\r\n\t $stmt = $this->connection->prepare($query);\r\n\t $stmt->execute(array(':username' => $username));\r\n\t $count = $stmt->rowCount(); \r\n return ($count > 0);\r\n }", "public function ban(User $user, User $model)\n {\n return $user->isAllowedTo(\"update.user.{$model->id}\");\n }", "public function _route()\n\t{\n\t\tif(self::lock('ban'))\n\t\t{\n\t\t\tself::error_page('ban');\n\t\t\treturn;\n\t\t}\n\t}", "public function blockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_MEMBID_.\" = ?\", array(1, $this->_userid));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_USERNM_.\" = ?\", array(1, $this->_username));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_EMAIL_.\" = ?\", array(1, $this->_email));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public static function banned()\n {\n // Set the \"forbidden\" status code\n Http::setHeadersByCode(403);\n\n // Inclusion of the HTML IP Banned page\n include PH7_PATH_SYS . 'global/views/' . PH7_DEFAULT_THEME . '/other/banned.html.php';\n\n // Stop script\n exit;\n }", "function canBidBuddy($bidbutler) {\n\tglobal $config;\n\t\n\tif ($bidbutler['reverse']) {\n\t\t//reverse auctions work differently\n\t\tif ($bidbutler['price'] <= $bidbutler['minimum_price'] ||\n\t\t\t\t $config['App']['bidButlerType'] == 'simple' ||\n\t\t\t\t $bidbutler['fixed'] == 1) {\n\t\t\tlogIt($bidbutler['auction_id']. '; canBidBuddy: true');\n\t\t\treturn true;\n\t\t}\n\t\t\t\t \n\t} else {\n\t\t//standard auction\n\t\t\n\t\tif ($bidbutler['price'] >= $bidbutler['minimum_price'] &&\n\t\t\t ($bidbutler['price'] < $bidbutler['maximum_price']) ||\n\t\t\t $config['App']['bidButlerType'] == 'simple' ||\n\t\t\t $bidbutler['fixed'] == 1) {\n\t\t\tlogIt($bidbutler['auction_id']. '; canBidBuddy: true');\n\t\t\treturn true;\n\t\t}\n\t}\n}", "public function checkBannedIp()\n {\n if (defined('IN_ADMIN') || (isset($this->ipIsChecked) && $this->ipIsChecked)) {\n //do not run multiple times, and do not run if not enterprise,\n //and do not run if in admin, so that admin can remove themselves\n //from the ban list.\n return true;\n }\n //code to check the current ip against a banned list in the database\n $ip_to_check = $_SERVER['REMOTE_ADDR'];\n\n $sql = \"SELECT `ip` FROM \" . $this->geoTables->ip_ban_table;\n //skip checking query, ip banning is all levels\n $this->init();\n $ip_result = $this->db->Execute($sql);\n if (!$ip_result) {\n trigger_error('ERROR SQL: SQL query failed for retrieving banned ips. Query:' . $sql . ' Error: '\n . $this->ErrorMsg());\n return false;\n }\n if ($ip_result->RecordCount() > 0) {\n $ban_me = false;\n while (!$ban_me && $ip_banned = $ip_result->FetchRow()) {\n //turn the banned ip into a regular expression\n $ip_banned = str_replace('.', '\\.', $ip_banned['ip']);\n //convert * to regular expression\n $ip_banned = '/^' . str_replace('*', '[0-9.]*', $ip_banned) . '$/';\n\n if (preg_match($ip_banned, $ip_to_check) == 1) {\n $ban_me = true;\n }\n }\n if (isset($_GET['check_ban_ip']) && $_GET['check_ban_ip']) {\n //If there is a get ver check_ban_ip and it is true, display whether or not the ip is banned or not.\n //this will only happen if there are IPs to ban in the ip table.\n die($ip_to_check . ' - IP BANNED? ' . (($ban_me)\n ? 'YES, this IP will only see front page of site.' : 'NO, this ip not banned.'));\n }\n if ($ban_me) {\n //this ip exists in the ip ban list\n //do not allow to view any pages, besides front page.\n\n //Do this by unsetting all user input values.\n //Note: using unset($_REQUEST,$_POST,$_GET,$_COOKIE) does not work\n // in PHP 4, so use following method instead, since it works on either PHP\n $_REQUEST = array();\n $_POST = array();\n $_GET = array();\n $_COOKIE = array();\n\n //also, make the user be treated like a robot, that is no sessions,\n //no cookies for sessions, and no redirecting.\n if (!defined('IS_ROBOT')) {\n define('IS_ROBOT', 1);\n }\n }\n }\n $this->ipIsChecked = true;\n return true;\n }", "function log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_b = '', $silent = false, $instant_ban = false)\n{\n require_code('failure');\n _log_hack_attack_and_exit($reason, $reason_param_a, $reason_param_b, $silent, $instant_ban);\n}", "public function fire()\n {\n $bot_id = $this->input->getArgument('bot-id');\n $destination = $this->input->getArgument('destination');\n if (!AddressValidator::isValid($destination)) {\n $this->error(\"Destination $destination is not a valid bitcoin address\");\n return;\n }\n $is_dry_run = !!$this->input->getOption('dry-run');\n if ($is_dry_run) { $this->comment(\"[Dry Run]\"); }\n\n // payment or public\n $do_payment = !!$this->input->getOption('payment');\n $do_public = !!$this->input->getOption('public');\n if (!$do_payment AND !$do_public) {\n $do_payment = true;\n $do_public = true;\n }\n\n // load the bot\n $bot_repository = app('Swapbot\\Repositories\\BotRepository');\n $bot = $bot_repository->findByUuid($bot_id);\n if (!$bot) { $bot = $bot_repository->findByID($bot_id); }\n if (!$bot) {\n $this->error(\"Unable to find bot with id $bot_id\");\n return;\n }\n\n // get the bot balances\n $xchain_client = app('Tokenly\\XChainClient\\Client');\n $this->comment(\"Loading Bot Balances\");\n\n try {\n if ($do_payment) {\n $payment_address_uuid = $bot['payment_address_id'];\n $payment_balances = $xchain_client->getBalances($bot['payment_address']);\n $this->info(\"payment address balances: \".json_encode($payment_balances, 192));\n }\n\n if ($do_public) {\n $public_address_uuid = $bot['public_address_id'];\n $public_balances = $xchain_client->getBalances($bot['address']);\n $this->info(\"public address balances: \".json_encode($public_balances, 192));\n }\n } catch (Exception $e) {\n $this->error($e->getMessage());\n if (!$is_dry_run) { return; }\n }\n\n // do sweeps\n if ($is_dry_run) {\n if ($do_payment) {\n $this->comment(\"[Dry Run] Would sweep all assets for payment address {$bot['payment_address']}\");\n }\n if ($do_public) {\n $this->comment(\"[Dry Run] Would sweep all assets for public address {$bot['address']}\");\n }\n } else {\n if ($do_payment) {\n $this->comment(\"Sweeping all assets for payment address {$bot['payment_address']}\");\n $result = $xchain_client->sweepAllAssets($payment_address_uuid, $destination);\n $this->info(\"sweep payment address result: \".json_encode($result, 192));\n }\n\n if ($do_public) {\n $this->comment(\"Sweeping all assets for public address {$bot['address']}\");\n $result = $xchain_client->sweepAllAssets($public_address_uuid, $destination);\n $this->info(\"sweep public address result: \".json_encode($result, 192));\n }\n }\n\n // $update_vars = ['state' => BotState::BRAND_NEW, 'balances' => $new_balances];\n // $bot_repository->update($bot, $update_vars);\n\n $this->info(\"done\");\n\n\n }", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $bans = !empty($user_id) && !empty($ip) ? bans_select_active($pdo, $user_id, $ip) : false; // both\n $bans = !$bans && !empty($user_id) ? bans_select_active_by_user_id($pdo, $user_id) : $bans; // user_id\n $bans = !$bans && !empty($ip) ? bans_select_active_by_ip($pdo, $ip) : $bans; // ip if user_id isn't found\n return $bans;\n}", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function test_validate_withdraw_balance()\n {\n $amount = 5000;\n $balance = $this->obj->get_balance();\n $withdraw = $this->obj->validate_withdraw_balance($amount);\n if($amount < $balance){\n $this->assertTrue($withdraw);\n }else{\n $this->assertFalse($withdraw);\n }\n \n }", "function banIpAddress($ipaddress){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getBanFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setBanFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->banIpAddress($ipaddress);\n\t\t\t\n\t\t}", "public function adminBanById(int $id, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBanById', $id . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "function balanceCheck($data) {\n \tif(isset($this->data['Bidbutler']['balance'])) {\n\t \tif(!empty($this->data['Bidbutler']['balance'])) {\n\t\t \tif($this->data['Bidbutler']['balance'] < $data['bids']) {\n\t\t \t\treturn false;\n\t\t \t}\n\t \t} else {\n\t \t\treturn false;\n\t \t}\n \t}\n\n \treturn true;\n }", "public function userIsBanned($user)\n {\n return \\App::abort(404);\n //dd($user);\n }", "public static function createBan($guild_id, $user_id)\r\n {\r\n $result = Api::put(\r\n '/guilds/' . $guild_id . '/bans/' . $user_id,\r\n [\r\n // delete-message-days\tinteger\tnumber of days to delete messages for (0-7)\r\n ]\r\n );\r\n\r\n\r\n return $result->getStatus() === 204;\r\n }", "public function checkBalance()\n {\n echo \"Check Balance of Dhanmondi Branch<br>\";\n }", "function memberNameBanned($memberName){\r\n if(!get_magic_quotes_gpc()){\r\n $memberName = addslashes($memberName);\r\n }\r\n $q = \"SELECT memberName FROM \".TBL_BANNED_USERS.\" WHERE memberName = '$memberName'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "public function eat($ban){ // must include parameter here\n return \"Bangla kola\";\n }", "function ipban()\n\t{\n\t\tglobal $ilance, $ilcrumbs, $navcrumb, $phrase, $ilconfig, $ilpage, $show, $maintenancemessage, $login_include;\n\t\n\t\t($apihook = $ilance->api('ipban_constructor_start')) ? eval($apihook) : false;\n\t\n\t\t// #### IP BLOCKER #############################################\n\t\t$ipaddress = IPADDRESS;\n\t\tif ($this->ip_address_banned($ipaddress))\n\t\t{\n\t\t\tdie($phrase['_you_have_been_banned_from_the_marketplace']);\n\t\t}\n\t\t// #### MAINTENANCE MODE #######################################\n\t\tif ($ilconfig['maintenance_mode'] AND (empty($_SESSION['ilancedata']['user']['userid']) OR !empty($_SESSION['ilancedata']['user']['userid']) AND $_SESSION['ilancedata']['user']['isadmin'] == '0'))\n\t\t{\n\t\t\t// supress maintenance mode if we're viewing admin cp, logging into site or payment notifications are being called\n\t\t\tif (defined('LOCATION') AND (LOCATION == 'admin' OR LOCATION == 'login' OR LOCATION == 'ipn'))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ip_address_excluded($ipaddress))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (strrchr($ilconfig['maintenance_excludeurls'], ', '))\n\t\t\t{\n\t\t\t\t$scripts = explode(', ', $ilconfig['maintenance_excludeurls']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$scripts = preg_split('#\\s+#', $ilconfig['maintenance_excludeurls'], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\t}\n\t\t\tif (count($scripts) > 0)\n\t\t\t{\n\t\t\t\t$currentscript = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '';\n\t\t\t\tforeach ($scripts AS $script)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match(\"/$script/i\", $currentscript))\n\t\t\t\t\t{\n\t\t\t\t\t\t// found a script that should be excluded while we're still in maintenance mode...\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$area_title = '{_maintenance_mode_temporarily_unavailable}';\n\t\t\t$page_title = '{_template_metatitle} | ' . SITE_NAME;\n\t\t\t$navcrumb = array (\"$ilpage[main]\" => '{_maintenance_mode_temporarily_unavailable}');\n\t\t\tprint_notice('{_maintenance_mode}', '{' . $ilconfig['maintenance_message'] . '}', HTTP_SERVER . $ilpage['main'], '{_main_menu}');\n\t\t\texit();\n\t\t}\n\t\t// #### PUBLIC OR PRIVATE FACING MARKETPLACE ###################\n\t\tif ($ilconfig['publicfacing'] == 0 AND (empty($_SESSION['ilancedata']['user']['userid']) OR $_SESSION['ilancedata']['user']['userid'] == 0) AND (empty($_SESSION['ilancedata']['user']['isadmin']) OR $_SESSION['ilancedata']['user']['isadmin'] == '0'))\n\t\t{\n\t\t\tif (defined('LOCATION') AND (LOCATION == 'admin' OR LOCATION == 'login' OR LOCATION == 'ipn' OR LOCATION == 'registration' OR LOCATION == 'ajax' OR LOCATION == 'attachment'))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ip_address_excluded($ipaddress))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$area_title = SITE_NAME;\n\t\t\t$page_title = '{_template_metatitle} | ' . SITE_NAME;\n\t\t\t$navcrumb = array (\"$ilpage[main]\" => '{_private_marketplace}');\n\t\t\tprint_notice('{_private_marketplace}', \"{_please} <span class=\\\"blue\\\"><a href=\\\"\" . HTTPS_SERVER . $ilpage['login'] . \"\\\">{_sign_in}</a></span> {_or} <span class=\\\"blue\\\"><a href=\\\"\" . HTTPS_SERVER . $ilpage['registration'] . \"\\\">{_register}</a></span>. {_this_is_a_private_marketplace}.\", HTTPS_SERVER . $ilpage['login'], '{_sign_in}');\n\t\t\texit();\n\t\t}\n\t}", "public function banlanmalogu(Request $request)\n {\n $bannedItem = BannedList::all();\n foreach ($bannedItem as $key => $value) {\n echo $value->id . \"--\" . $value->domain_id . \"---\" . $value->how_many_times . \"---\" . $value->banned_time . \"<br>\";\n }\n }", "public function block(BanUserValidator $input, $userId): RedirectResponse\n {\n $user = $this->usersRepository->find($userId);\n\n if (auth()->user()->id === $user->id) { // The given user is the currently authencated user.\n flash('Je kan jezelf helaas niet blokkeren.')->warning();\n return redirect()->route('users.index');\n\t\t}\n\n // TODO: Implementatie voor de blokkering van alle api keys in het systeem.\n // Omdat wanneer een gebruiker geblokkeerd word mag hij zijn sleutels ook niet gebruiken.\n\n $user->ban(['comment' => $input->reason, 'expired_at' => Carbon::parse($input->eind_datum)]);\n flash(\"{$user->name} is geblokkeerd tot {$input->end_date}.\")->success();\n\n return redirect()->route('users.index');\n }", "public function testBlacklistActionErrorInFr(): void {\n // get the entity to blacklist\n /* @var $contactMessage NSEntity\\ContactMessage */\n $contactMessage = $this->getEntityManager()->getRepository(NSEntity\\ContactMessage::class)->findOneByIp(\"127.0.0.1\");\n\n // prepare the datas to post\n $client = $this->getClient();\n $csrfToken = $client->getContainer()->get('security.csrf.token_manager')->getToken('contact_message_form');\n $parameters = [\n \"form\" => [\n \"_token\" => $csrfToken,\n ]\n ];\n\n // launch the test\n $this->logInSuperAdmin();\n $client->request(\"POST\", sprintf(\"/sadmin/contact/%d/blacklist\", $contactMessage->getId()), $parameters);\n $crawler = $client->followRedirect();\n\n // verify the test\n $this->assertEquals(200, $client->getResponse()->getStatusCode(), \"1. The http status code expected is not ok.\");\n $this->assertEquals(\"/sadmin/contact\", $client->getRequest()->getRequestUri(), \"2. The request uri expected is not ok\");\n $this->assertEquals(1, $crawler->filter(\".message-container .alert-danger\")->count(), \"3. The error message is missing\");\n $this->assertContains(sprintf(\"L'ip \\\"%s\\\" a déjà été blacklistée !\", $contactMessage->getIp()),\n $crawler->filter(\".message-container .alert-danger\")->text(), \"4. The error message expected is not ok.\");\n }", "private function _inBlacklist()\n\t {\n\t\t$result = $this->_db->exec(\"SELECT COUNT(`phone`) as count FROM `blacklist` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\t$row = $result->getRow();\n\t\t$count = $row['count'];\n\n\t\tif($count > 0)\n\t\t {\n\t\t\treturn true;\n\t\t }\n\t\telse\n\t\t {\n\t\t\treturn false;\n\t\t } //end if\n\n\t }", "function bloqueosCambiar(){\n global $tsCore, $tsUser;\n //\n $auser = $tsCore->setSecure($_POST['user']);\n $bloquear = empty($_POST['bloquear']) ? 0 : 1;\n // EXISTE?\n $exists = $tsUser->getUserName($auser);\n // SI EXISTE Y NO SOY YO\n if($exists && $tsUser->uid != $auser){\n if($bloquear == 1){\n // YA BLOQUEADO?\n $query = $this->select(\"u_bloqueos\",\"bid\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\",\"\",1);\n $noexists = $this->num_rows($query);\n $this->free($query);\n // NO HA SIDO BLOQUEADO\n if(empty($noexists)) {\n if($this->insert(\"u_bloqueos\",\"b_user, b_auser\",\"{$tsUser->uid}, {$auser}\"))\n return \"1: El usuario fue bloqueado satisfactoriamente.\"; \n } else return '0: Ya has bloqueado a este usuario.';\n // \n } else{\n if($this->delete(\"u_bloqueos\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\"))\n return \"1: El usuario fue desbloqueado satisfactoriamente.\";\n } \n } else return '0: El usuario seleccionado no existe.';\n }", "abstract function checkBalance();", "public function testBlocking()\n {\n $this->module->enableBlockingEmail = true;\n\n $this->specify(\"we have block user\", function () {\n /** @var User $user */\n //$user = $this->getFixture('user')->getModel('active');\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have block already blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can't block already blocked user\", $user->block())->false();\n });\n\n $this->specify(\"we have block unconfirmed user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't block unconfirmed user\", $user->block())->false();\n });\n\n $this->module->enableUnblockingEmail = true;\n $this->specify(\"we have unblock blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can unblock blocked user\", $user->unblock())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have unblock not blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't unblock not blocked user\", $user->unblock())->false();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have unblock user override mail setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can unblock user\", $user->unblock(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have block user override global email setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n }", "function _ban($chatId, $userId){\n $data = [\n 'chat_id' => $chatId,\n 'user_id' => $userId\n ];\n \n return Request('kickChatMember', $data);\n}", "function validateBlacklistId( $id ) {\n $rowcount = $this->SHARED_DB->get_var($this->SHARED_DB->prepare(\n \"SELECT COUNT(1)\n FROM hbo_blacklist\n WHERE id = %d\", $id));\n\n if($this->SHARED_DB->last_error) {\n throw new DatabaseException($this->SHARED_DB->last_error);\n }\n\n if ($rowcount == 0) {\n throw new DatabaseException( \"Unable to find blacklist id $id\" );\n }\n }", "function usernameBanned($username){\n\t\tif(!get_magic_quotes_gpc()){\n\t\t\t$username = addslashes($username);\n\t\t}\n\t\t$q = \"SELECT username FROM \".TBL_BANNED_USERS.\" WHERE username= '$username'\";\n\t\t$result = mysql_query($q, $this->connection);\n\t\treturn (mysql_numrows($result) > 0);\n\t}", "function usernameBanned($username){\r\n if(!get_magic_quotes_gpc()){\r\n $username = addslashes($username);\r\n }\r\n $q = \"SELECT username FROM \".TBL_BANNED_USERS.\" WHERE username = '$username'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "function block($ip_address, $filter, $event) {\n\t\t//define the global variables\n\t\tglobal $firewall_path, $firewall_name;\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//run the block command for iptables\n\t\tif ($firewall_name == 'iptables') {\n\t\t\t//example: iptables -I INPUT -s 127.0.0.1 -j DROP\n\t\t\t$command = $firewall_path.'/./iptables -I '.$filter.' -s '.$ip_address.' -j DROP';\n\t\t\t$result = shell($command);\n\t\t}\n\n\t\t//run the block command for pf\n\t\tif ($firewall_name == 'pf') {\n\t\t\t//example: pfctl -t sip-auth-ip -T add 127.0.0.5/32\n\t\t\t$command = $firewall_path.'/pfctl -t '.$filter.' -T add '.$ip_address.'/32';\n\t\t\t$result = shell($command);\n\t\t}\n\n\t\t//log the blocked ip address to the syslog\n\t\topenlog(\"fusionpbx\", LOG_PID | LOG_PERROR, LOG_AUTH);\n\t\tsyslog(LOG_WARNING, \"fusionpbx: blocked: [ip_address: \".$ip_address.\", filter: \".$filter.\", to-user: \".$event['to-user'].\", to-host: \".$event['to-host'].\", line: \".__line__.\"]\");\n\t\tcloselog();\n\n\t\t//log the blocked ip address to the database\n\t\t$array['event_guard_logs'][0]['event_guard_log_uuid'] = uuid();\n\t\t$array['event_guard_logs'][0]['hostname'] = gethostname();\n\t\t$array['event_guard_logs'][0]['log_date'] = 'now()';\n\t\t$array['event_guard_logs'][0]['filter'] = $filter;\n\t\t$array['event_guard_logs'][0]['ip_address'] = $ip_address;\n\t\t$array['event_guard_logs'][0]['extension'] = $event['to-user'].'@'.$event['to-host'];\n\t\t$array['event_guard_logs'][0]['user_agent'] = $event['user-agent'];\n\t\t$array['event_guard_logs'][0]['log_status'] = 'blocked';\n\t\t$p = new permissions;\n\t\t$p->add('event_guard_log_add', 'temp');\n\t\t$database = new database;\n\t\t$database->app_name = 'event guard';\n\t\t$database->app_uuid = 'c5b86612-1514-40cb-8e2c-3f01a8f6f637';\n\t\t$database->save($array);\n\t\t$p->delete('event_guard_log_add', 'temp');\n\t\tunset($database, $array);\n\n\t\t//send debug information to the console\n\t\tif ($debug) {\n\t\t\techo \"blocked address \".$ip_address .\", line \".__line__.\"\\n\";\n\t\t}\n\n\t\t//unset the array\n\t\tunset($event);\n\t}", "function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent)\n {\n }", "function cansigngb($uid, $who)\n{\n if(arebuds($uid, $who))\n {\n return true;\n }\n if($uid==$who)\n {\n return false; //imagine if someone signed his own gbook o.O\n }\n if(getplusses($uid)>=75)\n {\n return true;\n }\n return false;\n}", "private function registerBlacklistCommand()\n {\n $this->app->singleton('firewall.blacklist.command', function () {\n return new BlacklistCommand();\n });\n\n $this->commands('firewall.blacklist.command');\n }", "public function sqlInjectionBlock(bool $ban = true) {\n foreach ($_GET as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$flattened = self::arrayFlatten($value);\n\t\t\t\tforeach ($flattened as $sub_key => $sub_value) {\n\t\t\t\t\t$this->sqlCheck($sub_value, \"_GET\", $sub_key, $ban);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->sqlCheck($value, \"_GET\", $key, $ban);\n\t\t\t}\n }\n foreach ($_POST as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$flattened = self::arrayFlatten($value);\n\t\t\t\tforeach ($flattened as $sub_key => $sub_value) {\n\t\t\t\t\t$this->sqlCheck($sub_value, \"_POST\", $sub_key, $ban);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->sqlCheck($value, \"_POST\", $key, $ban);\n\t\t\t}\n }\n foreach ($_COOKIE as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$flattened = self::arrayFlatten($value);\n\t\t\t\tforeach ($flattened as $sub_key => $sub_value) {\n\t\t\t\t\t$this->sqlCheck($sub_value, \"_COOKIE\", $sub_key, $ban);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->sqlCheck($value, \"_COOKIE\", $key, $ban);\n\t\t\t}\n\t\t}\n }", "function procDeleteBannedUser(){\r\n\t\t\tglobal $session, $database, $form;\r\n\t\t\t/* Username error checking */\r\n\t\t\t$subuser = $this->checkUsername(\"delbanuser\", true);\r\n\t\t\t\r\n\t\t\t/* Errors exist, have user correct them */\r\n\t\t\tif($form->num_errors > 0){\r\n\t\t\t\t$_SESSION['value_array'] = $_POST;\r\n\t\t\t\t$_SESSION['error_array'] = $form->getErrorArray();\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t\t/* Delete user from database */\r\n\t\t\telse{\r\n\t\t\t\t$q = \"DELETE FROM \".TBL_BANNED_USERS.\" WHERE username = '$subuser'\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t}", "public function userBanned(User $user):bool\n {\n // SQL request\n $sql = \" SELECT COUNT(*) AS banned FROM user WHERE email = :email AND status = 'banned'\";\n\n // Preparing the sql query\n $requete = $this->DB->prepare($sql);\n\n // Associates a value with the email parameter\n $requete->bindValue(':email', $user->getEmail(), \\PDO::PARAM_STR);\n\n // Execute the sql query\n $requete->execute();\n\n // Retrieves information\n $reponse = $requete->fetch();\n\n // If there is a record, we return true\n if ($reponse['banned'] == 1) {\n return true;\n }\n // else\n return false;\n }", "public function show(BanCanSu $banCanSu)\n {\n //\n }", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}" ]
[ "0.7686278", "0.7418485", "0.71322197", "0.6647474", "0.66345525", "0.6633356", "0.6596229", "0.6592005", "0.6493093", "0.6405045", "0.63256747", "0.6246675", "0.6063491", "0.60567814", "0.60476315", "0.60313886", "0.59893954", "0.5979146", "0.59675825", "0.5947278", "0.5939069", "0.59073067", "0.58928365", "0.5873285", "0.5859983", "0.5843066", "0.583017", "0.58216804", "0.5814682", "0.5807249", "0.5798775", "0.57985497", "0.57265306", "0.5705654", "0.56831074", "0.5632704", "0.5588464", "0.55660737", "0.5564809", "0.5529028", "0.552351", "0.55036664", "0.5495645", "0.54778934", "0.5470296", "0.5464936", "0.54626507", "0.5459202", "0.54323995", "0.5415864", "0.5400963", "0.5399902", "0.5396531", "0.53857434", "0.53831685", "0.53631157", "0.53562593", "0.5349757", "0.53329223", "0.53293777", "0.53248096", "0.53242576", "0.5322538", "0.5321017", "0.5318556", "0.5303902", "0.53004295", "0.5299663", "0.52986705", "0.5285858", "0.5249571", "0.5220702", "0.521422", "0.5195394", "0.5191217", "0.51908904", "0.51906776", "0.518702", "0.5186978", "0.5159626", "0.5158568", "0.51583636", "0.51493156", "0.5149281", "0.5146281", "0.51430863", "0.51216495", "0.511741", "0.5117329", "0.5112839", "0.5102917", "0.5099401", "0.50967705", "0.50919056", "0.50911117", "0.5087868", "0.508498", "0.507772", "0.50763327", "0.5074123" ]
0.7303545
2
Verifies the ban by id command does work properly
public function test_admin_ban_by_id() { $this->assertTrue($this->postScriptumServer->adminBanById(1, '1h', 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->btwServer->adminBanById(1, '1h', 'Test'));\n }", "public function banORunBan($id)\n {\n try {\n $instance = $this->find($id);\n if ($instance->banned === 0) {\n \\Toastr::warning(trans('bans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = true;\n } else {\n \\Toastr::info(trans('unbans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = false;\n }\n $instance->update();\n } catch (\\Exception $e) {\n return response(\"Error appeared. Maybe model doesn't have banned field\" . $e->getMessage(), $e->getCode());\n }\n }", "public function ban();", "function banId($db, $id, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE id = \\\"$id\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE id = \\\"$id\\\"\"); \n }\n return true;\n}", "function validateBlacklistId( $id ) {\n $rowcount = $this->SHARED_DB->get_var($this->SHARED_DB->prepare(\n \"SELECT COUNT(1)\n FROM hbo_blacklist\n WHERE id = %d\", $id));\n\n if($this->SHARED_DB->last_error) {\n throw new DatabaseException($this->SHARED_DB->last_error);\n }\n\n if ($rowcount == 0) {\n throw new DatabaseException( \"Unable to find blacklist id $id\" );\n }\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->btwServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->postScriptumServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "public function ban($id=null){\n if($this->request->is('get')){\n throw new MethodNotAllowedException();\n }\n\n $this->request->data['User']['id']=$id;\n $this->request->data['User']['banned']=1;\n if($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('User have been banned'));\n $this->redirect(array('controller'=>'users','action'=>'index'));\n }\n }", "public function ban(Request $request, $id)\n {\n //\n \n $data = customer::where('Customer_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Ban_Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n //if($validatedPass == $data1){\n \n \n DB::select(\"UPDATE customers set Ban_Reason = '$reason' , Customer_Status = 'BANNED' where Customer_ID = ?\",[$id]);\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerInformationInterface', compact(\"data\"));\n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationInterface', compact(\"data\"));\n }\n }", "public function update($id)\n {\n if(!Entrust::can('issuetban') && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@index', [])->withErrors(['You do not have permission to issue bans']);\n }\n\n $ban = Ban::find($id);\n\n if(!$ban)\n {\n return View::make('error.generror')->with('code', 404)->with('errmsg', 'PAGE NOT FOUND')\n ->with('errdescription', 'No ban exists with ID ' . $id)\n ->with('title', 'Page Not Found');\n }\n\n $record = Record::find($ban->latest_record_id);\n\n $preferences = Auth::user()->preferences;\n\n $tz = $preferences->timezone;\n\n switch(Input::get('_gameName'))\n {\n case \"BF3\":\n if(is_null($preferences->bf3_playerid))\n {\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n }\n else\n {\n $sourcePlayerQuery = Player::where('GameID', Input::get('_gameID'))->where('PlayerID', $preferences->bf3_playerid)->first();\n $source_player_name = $sourcePlayerQuery->SoldierName;\n $source_player_id = $sourcePlayerQuery->PlayerID;\n }\n break;\n\n case \"BF4\":\n if(is_null($preferences->bf4_playerid))\n {\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n }\n else\n {\n $sourcePlayerQuery = Player::where('GameID', Input::get('_gameID'))->where('PlayerID', $preferences->bf4_playerid)->first();\n $source_player_name = $sourcePlayerQuery->SoldierName;\n $source_player_id = $sourcePlayerQuery->PlayerID;\n }\n break;\n\n default:\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n break;\n }\n\n $ban_reason = trim(Input::get('ban_reason'));\n $ban_notes = trim(Input::get('ban_notes'));\n $ban_server = Input::get('ban_server');\n $ban_status = Input::get('ban_status');\n $ban_type = Input::get('ban_type');\n $ban_start_date = trim(Input::get('ban_start_date'));\n $ban_end_date = trim(Input::get('ban_end_date'));\n $ban_start_time = trim(Input::get('ban_start_time'));\n $ban_end_time = trim(Input::get('ban_end_time'));\n\n $ban_start_date_time = Carbon::createFromFormat('m/d/Y g:i A', sprintf(\"%s %s\", $ban_start_date, $ban_start_time), $tz)->toDateTimeString();\n $ban_end_date_time = Carbon::createFromFormat('m/d/Y g:i A', sprintf(\"%s %s\", $ban_end_date, $ban_end_time), $tz)->toDateTimeString();\n\n if($ban_type == 8)\n {\n $ban_start_convert = Carbon::now();\n $ban_end_convert = Carbon::now()->addYears(20);\n }\n else\n {\n $ban_start_convert = Helper::LocalToUTC($ban_start_date_time);\n $ban_end_convert = Helper::LocalToUTC($ban_end_date_time);\n }\n\n if($ban_end_convert->lte($ban_start_convert))\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['Ban end date/time can\\'t be before the start date/time.']);\n\n if($ban_type == 7 && !Entrust::can('issuetban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['You do not have permission to temp ban the player'])->withInput();\n }\n\n if($ban_type == 8 && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['You do not have permission to perma ban the player'])->withInput();\n }\n\n if($source_player_name != $record->source_name || $ban_reason != $record->record_message || $ban_type != $record->command_action)\n {\n $newRecord = new Record;\n $newRecord->server_id = $ban_server;\n $newRecord->command_type = $ban_type;\n $newRecord->command_action = $ban_type;\n $newRecord->command_numeric = $ban_start_convert->diffInMinutes($ban_end_convert);\n $newRecord->target_name = $record->target_name;\n $newRecord->target_id = $record->target_id;\n $newRecord->source_name = $source_player_name;\n $newRecord->source_id = $source_player_id;\n $newRecord->record_message = $ban_reason;\n $newRecord->record_time = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $newRecord->adkats_read = 'Y';\n $newRecord->adkats_web = TRUE;\n $newRecord->save();\n\n $record->command_action = ($record->command_action == 8 ? 73 : 72);\n $record->save();\n\n $ban->latest_record_id = $newRecord->record_id;\n $ban->ban_notes = $ban_notes;\n $ban->ban_status = $ban_status;\n $ban->ban_startTime = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $ban->ban_endTime = $ban_end_convert->toDateTimeString();\n $ban->ban_enforceName = Input::get('ban_enforceName');\n $ban->ban_enforceGUID = Input::get('ban_enforceGUID');\n $ban->ban_enforceIP = Input::get('ban_enforceIP');\n $ban->save();\n }\n else\n {\n if($ban_notes != $ban->ban_notes)\n {\n $ban->ban_notes = $ban_notes;\n }\n\n if($ban_status != $ban->ban_status)\n {\n $ban->ban_status = $ban_status;\n }\n\n if(Input::get('ban_enforceName') != $ban->ban_enforceName)\n {\n $ban->ban_enforceName = Input::get('ban_enforceName');\n }\n\n if(Input::get('ban_enforceGUID') != $ban->ban_enforceGUID)\n {\n $ban->ban_enforceGUID = Input::get('ban_enforceGUID');\n }\n\n if(Input::get('ban_enforceIP') != $ban->ban_enforceIP)\n {\n $ban->ban_enforceIP = Input::get('ban_enforceIP');\n }\n\n if($ban_type != 8)\n {\n $ban->ban_startTime = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $ban->ban_endTime = $ban_end_convert->toDateTimeString();\n }\n\n $ban->save();\n }\n\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->with('message', sprintf(\"Ban #%u has been updated.\", $id));\n }", "function checkBan(){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\r\n\t#see if user is suspended.\r\n\tif($ci->suspend_length > 0){\r\n\t\t#see if user is still suspended.\r\n\t\t$math = 3600 * $ci->suspend_length;\r\n\t\t$suspend_date = $ci->suspend_time + $math;\r\n\t\t$today = time() - $math;\r\n\r\n\t\tif($suspend_date > $today){\r\n\t\t\texit(show_error($ci->lang->line('suspended')));\r\n\t\t}\r\n\t}\r\n\t#see if the IP of the user is banned.\r\n\t$uip = detectProxy();\r\n\r\n\t$ci->db->distinct('ban_item')->from('ebb_banlist')->where('ban_type', 'IP')->like('ban_item', $uip)->limit(1);\r\n\t$banChk = $ci->db->count_all_results();\r\n\r\n\t#output an error msg.\r\n\tif($banChk == 1){\r\n\t\texit(show_error($ci->lang->line('banned')));\r\n\t}\r\n}", "public function edit($id)\n {\n if(!Entrust::can('issuetban') && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@index', [])->withErrors(['You do not have permission to issue bans']);\n }\n\n $ban = Ban::join('adkats_records_main', 'adkats_bans.latest_record_id', '=', 'adkats_records_main.record_id')\n ->join('tbl_server', 'adkats_records_main.server_id', '=', 'tbl_server.ServerID')\n ->join('tbl_games', 'tbl_server.GameID', '=', 'tbl_games.GameID')\n ->where('ban_id', $id)->first();\n\n if(!$ban)\n {\n return View::make('error.generror')->with('code', 404)->with('errmsg', 'PAGE NOT FOUND')\n ->with('errdescription', 'No ban exists with ID ' . $id)\n ->with('title', 'Page Not Found');\n }\n\n if($ban->Name == 'BF3')\n {\n foreach(Server::bf3()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n elseif($ban->Name == 'BF4')\n {\n foreach(Server::bf4()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n\n $title = sprintf(\"Editing Ban #%u\", $ban->ban_id);\n\n View::share('title', $title);\n\n $this->layout->content = View::make('admin.adkats.bans.edit')->with('ban', $ban)->with('_servers', $_servers);\n }", "public function banR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'BANNED' where Rider_ID = ?\",[$id]);\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RiderInformationInterface', compact(\"data\"));\n } \n else {\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationRInterface', compact(\"data\"));\n }\n }", "function ban($db, $pseudo, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE pseudo = \\\"$pseudo\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE pseudo = \\\"$pseudo\\\"\"); \n }\n return true;\n}", "public function adminBanById(int $id, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBanById', $id . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->btwServer->adminWarnById(0, 'Hello World!'));\n }", "function ban_user($id_auteur)\n{\n\t$user_ip = (isset($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR');\n\n\tif (empty($id_auteur)) return;\n\n\t// On le recherche\n\t$is_spammer = sql_fetsel('id_auteur', 'spip_auteurs_spipbb', \"id_auteur=$id_auteur\");\n\t$infos = sql_fetsel('login, email', 'spip_auteurs', \"id_auteur=$id_auteur\");\n\n\tif (is_array($is_spammer) and !empty($is_spammer['id_auteur']) and $is_spammer['user_spam_warnings'] > $GLOBALS['spipbb']['sw_nb_spam_ban'] ) // parametrage\n\t{\n\t\t@sql_updateq('spip_auteurs_spipbb', array(\n\t\t\t\t\t'ip_auteur' => $user_ip,\n\t\t\t\t\t'ban' => 'oui'\n\t\t\t\t\t\t\t),\n\t\t\t\t\"id_auteur=$id_auteur\");\n\t\t$login = $infos['login'];\n\t\t$email = $infos['email'];\n\t\t@sql_insertq('spip_ban_liste', array(\n\t\t\t\t\t'ban_ip' => $user_ip,\n\t\t\t\t\t'ban_login' => $login,\n\t\t\t\t\t'ban_email' => $email,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t}\n}", "public function ban($expression) {\n $this->execute('ban ' . $expression);\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminWarnById(0, 'Hello World!'));\n }", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $ban = isset($user_id) && $user_id != 0 ? ban_select_active_by_user_id($pdo, $user_id) : false; // user_id\n $ban = !$ban && isset($ip) ? ban_select_active_by_ip($pdo, $ip) : $ban; // ip if user_id isn't found\n return $ban;\n}", "function ban_user($reason, $duration, $user_id) {\n\tif(!set_user_role(ROLE_BANNED, $user_id)) {\n\t\treturn false;\n\t}\n\tadd_ban_details($reason, $duration, $user_id);\n\n\treturn true;\n}", "function is_baned($ip)\r\n{\r\n\tglobal $db_url;\r\n\t$all_baned_ips=array();\r\n\t$db=YDB::factory($db_url);\r\n\t$result=$db->queryAll(sprintf(parse_tbprefix(\"SELECT * FROM <badip> WHERE ip='%s'\"),$db->escape_string($ip)));\r\n\tif($result)\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function check_ban ($database, $mpre, $spre, $email, $ip, $type)\n{\n\t// Expire old bans fist\n\t$time = time();\n\t$qry = \"SELECT id FROM {$spre}banlist WHERE expire<'$time' AND expire!='0' AND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n while (list($bid) = mysql_fetch_array($result))\n {\n \t$qry2 = \"UPDATE {$spre}banlist SET active='0' WHERE id='$bid' OR alias='$bid'\";\n \t$database->openConnectionNoReturn($qry2);\n\t}\n\n\t$qry = \"SELECT date, auth, reason, alias, level\n \t\tFROM {$spre}banlist\n WHERE ( (email='$email' AND email!='') OR (ip='$ip' AND ip!='') )\n \tAND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n\n if (!mysql_num_rows($result))\n {\n\t // Check wildcard IPs\n\t $qry2 = \"SELECT ip FROM {$spre}banlist WHERE ip LIKE '%*%' AND active='1'\";\n\t $result2 = $database->openConnectionWithReturn($qry2);\n\t list($banip) = mysql_fetch_array($result2);\n while ($banip && !$wildcard)\n\t {\n\t $wildcard = check_wild_IP($ip, $banip);\n\t if ($wildcard)\n {\n\t $qry = \"SELECT date, auth, reason, alias, level\n\t FROM {$spre}banlist WHERE ip='$banip'\";\n\t $result = $database->openConnectionWithReturn($qry);\n }\n list($banip) = mysql_fetch_array($result2);\n\t }\n }\n\n // If a result was returned, then this person's banned!\n if (mysql_num_rows($result))\n {\n \tlist ($date, $auth, $reason, $alias, $level) = mysql_fetch_array($result);\n\n // {$alias != \"0\"} indicates that the matched ban actually\n // links to a different ban (ie, multiple email/IPs)\n if ($alias != \"0\")\n {\n $qry = \"SELECT date, auth, reason FROM {$spre}banlist WHERE id='$alias'\";\n $result = $database->openConnectionWithReturn($qry);\n list ($date, $auth, $reason) = mysql_fetch_array($result);\n }\n\n\t\t// If it's a command ban, then we need to make sure it's a command app\n if ( ($level == \"command\" && ($type == \"ship\" || $type == \"command\")) ||\n\t\t\t $level != \"command\")\n {\n \t $reason = date(\"F j, Y\", $date) . \"<br /><br />\" . $reason . \"\\n\";\n\t\t\t$reason = \"Authorized by: \" . $auth . \"<br /><br />\" . $reason . \"\\n\";\n\t return $reason;\t\t\t// Returns positive\n }\n }\n // No results - person's not banned\n return;\n}", "public function banUser($id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n return view('ManageAccount.BanInformationInterface', compact(\"data\"));\n }", "function ban_loginOk($args) {\n $ip = $_SERVER['REMOTE_ADDR']; \n $this->load_ipban();\n \n unset($this->data_ban['FAILURES'][$ip]); \n unset($this->data_ban['BANS'][$ip]);\n \n $this->write_ipban();\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Login ok for %s.\\n\", $ip));\n return $args;\n }", "public function banUserR($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.BanInformationRInterface', compact(\"data\"));\n }", "public function unban($id=null){\n if($this->request->is('get')){\n throw new MethodNotAllowedException();\n }\n\n $this->request->data['User']['id']=$id;\n $this->request->data['User']['banned']=0;\n if($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('User have been un banned'));\n $this->redirect(array('controller'=>'users','action'=>'index'));\n }\n }", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $bans = !empty($user_id) && !empty($ip) ? bans_select_active($pdo, $user_id, $ip) : false; // both\n $bans = !$bans && !empty($user_id) ? bans_select_active_by_user_id($pdo, $user_id) : $bans; // user_id\n $bans = !$bans && !empty($ip) ? bans_select_active_by_ip($pdo, $ip) : $bans; // ip if user_id isn't found\n return $bans;\n}", "public function baned()\n {\n\t\t$source = $this->render('baned.html', array());\n\t\t$this->_view($source);\n\t}", "function procBanUser(){\r\n\t\t\tglobal $session, $database, $form;\r\n\t\t\t/* Username error checking */\r\n\t\t\t$subuser = $this->checkUsername(\"banuser\");\r\n\t\t\t\r\n\t\t\t/* Errors exist, have user correct them */\r\n\t\t\tif($form->num_errors > 0){\r\n\t\t\t\t$_SESSION['value_array'] = $_POST;\r\n\t\t\t\t$_SESSION['error_array'] = $form->getErrorArray();\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t\t/* Ban user from member system */\r\n\t\t\telse{\r\n\t\t\t\t$q = \"DELETE FROM \".TBL_USERS.\" WHERE username = '$subuser'\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\t\r\n\t\t\t\t$q = \"INSERT INTO \".TBL_BANNED_USERS.\" VALUES ('$subuser', $session->time)\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t}", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->btwServer->adminKickById(1, 'Test'));\n }", "protected function validateBan() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canBanUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\t$userIDs = [];\r\n\t\tforeach ($this->objects as $user) {\r\n\t\t\tif (!$user->banned) {\r\n\t\t\t\t$userIDs[] = $user->userID;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups($userIDs);\r\n\t}", "public function banWord( $bannedWord ){ return $this->APICall( array( 'banWord' => $bannedWord ), \"Could not insert banned autogenerated word \" . $bannedWord ); }", "function check_if_banned($pdo, $user_id, $ip, $scope = 'b', $throw_exception = true)\n{\n if ($scope === 'n') {\n return;\n }\n\n $bans = query_if_banned($pdo, $user_id, $ip);\n if ($bans !== false) {\n foreach ($bans as $ban) {\n if ($ban !== false && ($scope === $ban->scope || $scope === 'b')) { // g will supercede s if scope is b\n if ($throw_exception) {\n $output = make_banned_notice($ban);\n throw new Exception($output);\n }\n return $ban;\n }\n }\n }\n return false;\n}", "function validateMember($member, $shareId, $balance) {\n\t\t$status = 1; // se inicializa el status y luego cambia si entra en las condiciones de bloqueo\n\t\t$message = '';\n\n\t\tif($balance < 0) {\n\t\t\t$balanceStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_SALDO_DEUDOR'); // Archivo config\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($balanceStatus,$status);\n\t\t\t$status = $status - $balanceStatus;\n\t\t}\n\n\t\t$records = $this->recordRepository->getBlockedRecord($member);\n\t\tif(count($records)) {\n\t\t\tforeach ($records as $key => $value) {\n\t\t\t\t$recordStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_BLOQUEO_EXPEDIENTE');\n\t\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($recordStatus,$status);\n\t\t\t\t$status = $status - $recordStatus;\n\t\t\t\t$message .= 'Bloqueo activo por expediente :'.$value->id.', hasta la fecha '.$value->expiration_date.'<br>';\n\t\t\t}\n\t\t}\n\n\t\t$share = $this->shareRepository->find($shareId);\n\n\t\tif($share && $share->shareType && $share->shareType()->first()->access == 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La Accion no posee acceso <br>';\n\t\t}\n\n\n\t\tif($share && $share->permit == 1) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La accion '.$share->share_number.' tiene un permiso activo y no puede ingresar <br>';\n\t\t}\n\t\tif($share->status === 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($shareStatus,$status);\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* Accion Inactiva <br>';\n\t\t}\n\n\t\t$personStatus = $this->checkPersonStatus($member);\n\t\tif($personStatus === \"Inactivo\"){\n\t\t\t$personStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_INACTIVO');\n\t\t\t// $status = $this->getAccesControlStatus($personStatus,$status);\n\t\t\t$status = $status - $personStatus;\n\t\t\t$message .= '* Socio Inactivo <br>';\n\t\t}\n\t\tif($message !== '') {\n\t\t\t$currentPerson = $this->personModel->query(['name', 'last_name', 'rif_ci', 'card_number'])->where('id', $member)->first();\n\t\t\t$name = '<strong>'.$currentPerson->name.' '.$currentPerson->last_name.'</strong> Carnet: '.$currentPerson->card_number;\n\t\t\t$message = '<br><div><div>'.$name.'</div><div>'.$message.'</div></div>';\n\t\t}\n\t\t// se retorna el mensaje de error y el estatus , estos valores son usados para el registro final de cada miembro\n\t\treturn (object)[ 'message' => $message, 'status' => $status ];\n\t}", "function _ban($chatId, $userId){\n $data = [\n 'chat_id' => $chatId,\n 'user_id' => $userId\n ];\n \n return Request('kickChatMember', $data);\n}", "function ban_canLogin($args) {\n $ip=$_SERVER[\"REMOTE_ADDR\"]; \n if ( $this->isWhitelisted($ip) )\n return $args;\n \n $this->load_ipban();\n\n if (!empty($this->data_ban['BANS'][$ip]) ) {\n if( $this->data_ban['BANS'][$ip]<=time()) { \n unset($this->data_ban['FAILURES'][$ip]); \n unset($this->data_ban['BANS'][$ip]);\n \n $this->write_ipban();\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Ban lifted for %s.\\n\", $ip));\n }\n else $args['pass'] = '';\n } \n \n return $args; \n }", "public function check($id);", "function check_IP_ban_list(){\r\n\r\n\t\t#OPEN BAN IP LIST\r\n\t\t//$fp = fopen(DIR_SERVER_ROOT.'ilcfg/ban_list.inc.php', 'r');\r\n\t\t//$_deny_ip = explode(\"\\n\", fread($fp, filesize(DIR_SERVER_ROOT.'ban_list.inc.php')));\r\n\r\n\t\t$_ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t$_allowed = false;\r\n\t\tforeach($this->_allow_ip as $_a_ip){\r\n\t\t\t$_a_ip = str_replace('.','\\.',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('*','[0-9]{1,3}',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('?','[0-9]{1}',$_a_ip);\r\n\t\t\tif(ereg(\"^{$_a_ip}$\", $_ip)) $_allowed = true;\r\n\t\t}\r\n\t\tif(!$_allowed) die($_error_message);\r\n\t\t$_allowed = true;\r\n\t\tforeach($this->_deny_ip as $_d_ip){\r\n\t\t\t$_d_ip = str_replace('.','\\.',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('*','[0-9]{1,3}',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('?','[0-9]{1}',$_d_ip);\r\n\t\t\tif(ereg(\"^{$_d_ip}$\", $_ip)) $_allowed = false;\r\n\t\t}\r\n\t\tif(!$_allowed)\r\n\t\t{\r\n\t\t\t$this->ip_detect_mail();\r\n\t\t\tinclude(DIR_SERVER_ROOT.BAN_IP_PAGE);\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public static function block($id, $blocking_id){\n if(!Auth::check() || !(Auth::user()->id == $id)) return 1;\n if($id === $blocking_id) return 2;\n return 0;\n }", "public function adminBan(string $nameOrSteamId, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBan', $nameOrSteamId . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminKickById(1, 'Test'));\n }", "public function actionCheckId() {\n $id = $_POST['id'];\n $row = 0;\n $object = Yii::app()->db->createCommand(\"select * from hobby_new where id=\" . $id)->queryRow();\n if (!empty($object['id'])) {\n $row = 1;\n }\n echo $row;\n }", "function Del_Mess_One($name, $command)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n if (count(explode($command, $mess)) > 1) {\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n }\n}", "public function testBanAndUnbanEloquentUser()\n {\n $dbUser = DB::table('users')->find(1);\n\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 0);\n\n $user = $this->getTestUser();\n\n $user->ban();\n //\n $dbUser = DB::table('users')->find(1);\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 1);\n\n $user->unban();\n //\n $dbUser = DB::table('users')->find(1);\n //By default the banned value is 0 once seeded.\n $this->assertEquals($dbUser->banned, 0);\n\n }", "public function ban(Request $request)\n {\n $user = User::role('admin')->where('id', $request->id)->first();\n if ($request->ban == 'true') {\n $user->removeRole('ban');\n return true;\n } else {\n $user->assignRole('ban');\n return false;\n }\n }", "public function actionBanned()\n\t{\n\t\t$model = CoreSettings::findOne(1);\n if ($model === null) {\n $model = new CoreSettings();\n }\n\t\t$model->scenario = CoreSettings::SCENARIO_BANNED;\n\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n // $postData = Yii::$app->request->post();\n // $model->load($postData);\n // $model->order = $postData['order'] ? $postData['order'] : 0;\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Spam & banning setting success updated.'));\n return $this->redirect(['banned']);\n\n } else {\n if (Yii::$app->request->isAjax) {\n return \\yii\\helpers\\Json::encode(\\app\\components\\widgets\\ActiveForm::validate($model));\n }\n }\n }\n\t\t\n\t\t$this->view->title = Yii::t('app', 'Spam & Banning Tools');\n\t\t$this->view->description = Yii::t('app', '{app-name} platform are often the target of aggressive spam tactics. This most often comes in the form of fake user accounts and spam in comments. On this page, you can manage various anti-spam and censorship features. Note: To turn on the signup image verification feature (a popular anti-spam tool), see the {setting} page.', ['app-name' => Yii::$app->name, 'setting' => Html::a(Yii::t('app', 'Signup Setting'), Url::to(['signup']))]);\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_banned', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function isBanned(){\n return $this->banned;\n }", "public function procBanUser() {//IF time permits, re-implement using new User classes\r\n global $session;\r\n\n /* Username error checking */\n $field = \"banuser\"; //Use the field for username\r\n $subuser = $this->_checkUsername($field);\r\n\n if($subuser == $session->user->username) { /* Make sure no one tries and ban themselves */\n $session->form->setError($field, \"* You can't ban yourself!<br />\");\n }\n\r\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Ban user from member system */\r\n \t$uid = $session->database->getUID($subuser);\n $session->database->removeUser($uid, DB_TBL_ADMINS);\r\n $session->database->removeUser($uid, DB_TBL_TELLERS);\r\n $session->database->removeUser($uid, DB_TBL_CUSTOMERS);\r\n\r\n $q = \"INSERT INTO \".DB_TBL_BANNED_USERS.\" VALUES ('$subuser', $session->time)\";\r\n $session->database->query($q);\n }\n header(\"Location: \".$session->referrer);\r\n }", "public static function createBan($guild_id, $user_id)\r\n {\r\n $result = Api::put(\r\n '/guilds/' . $guild_id . '/bans/' . $user_id,\r\n [\r\n // delete-message-days\tinteger\tnumber of days to delete messages for (0-7)\r\n ]\r\n );\r\n\r\n\r\n return $result->getStatus() === 204;\r\n }", "public function actionRejectByBaak($id, $id_baak)\n {\n $model = $this->findModel($id);\n $pegawai = Pegawai::find()->where('deleted!=1')->all();\n\n foreach ($pegawai as $p) {\n if ($p->pegawai_id == $id_baak) {\n if ($model->status_request_id = 1) {\n $model->status_request_id = 3;\n $model->baak_id = $id_baak;\n $model->save();\n\n \\Yii::$app->messenger->addSuccessFlash(\"Izin telah ditolak\");\n return $this->redirect(['index-baak']);\n } else {\n return $this->render('IndexBaak', [\n 'model'=>$model\n ]);\n }\n }\n }\n\n \\Yii::$app->messenger->addWarningFlash(\"Anda belum terdaftar di data kepegawaian IT Del, hubungi HRD untuk memasukkan data Pegawai anda\");\n return $this->redirect(['izin-by-admin-index']);\n\n }", "private function isUserBanned($conn, $site_id)\n {\n $banned = Ban::where('ip', $conn->remoteAddress)->where('active', 'yes')->where('site_id', $site_id)->first();\n if ($banned) {\n throw new UserIsBannedException('This IP address has been banned for '.$banned->duration.' days.');\n }\n }", "function Del_Mess_Blacklist($name)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n //Del\n //\t$cbox_url.'&sec=delban&n='.$Bot_Name.'&k='.$Bot_Key.'&del='.$id_user.'<br>';\n //\t_Get($cbox_url.'&sec=delban&n='.$Bot_Name.'&k='.$Bot_Key.'&del='.$id_user);\n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n}", "function candelbl($uid,$bid)\n{\n $minfo = mysql_fetch_array(mysql_query(\"SELECT bowner FROM ibwf_blogs WHERE id='\".$bid.\"'\"));\n if(ismod($uid))\n {\n return true;\n }\n if($minfo[0]==$uid)\n {\n return true;\n }\n \n return false;\n}", "function set_session_ban_id($session_id, $ban_champ_id, $teamban, $ban_number) {\n $session_id = $this->conn->real_escape_string($session_id);\n $ban_champ_id = $this->conn->real_escape_string($ban_champ_id);\n $teamban = $this->conn->real_escape_string($teamban);\n $ban_number = $this->conn->real_escape_string($ban_number);\n $sql = \"UPDATE cb_session_bans SET ban_\" . $ban_number . \"_id = \" . $ban_champ_id . \" WHERE session_id = \" . $session_id . \" AND teamban = \" . $teamban;\n $this->query($sql);\n }", "public function isUserBannedxxx()\n {\n $db = $this->_db;\n $sql = sprintf(\"SELECT ban_id FROM %s\n WHERE banned_ip = %s LIMIT 1;\"\n , S_TABLE_BANS\n , $this->getUserIp()\n );\n\n $result = $db->sql_query($sql);\n $row = $db->sql_fetchrow($result);\n\n return ($row)\n ? true\n : false;\n }", "public function block(BanUserValidator $input, $userId): RedirectResponse\n {\n $user = $this->usersRepository->find($userId);\n\n if (auth()->user()->id === $user->id) { // The given user is the currently authencated user.\n flash('Je kan jezelf helaas niet blokkeren.')->warning();\n return redirect()->route('users.index');\n\t\t}\n\n // TODO: Implementatie voor de blokkering van alle api keys in het systeem.\n // Omdat wanneer een gebruiker geblokkeerd word mag hij zijn sleutels ook niet gebruiken.\n\n $user->ban(['comment' => $input->reason, 'expired_at' => Carbon::parse($input->eind_datum)]);\n flash(\"{$user->name} is geblokkeerd tot {$input->end_date}.\")->success();\n\n return redirect()->route('users.index');\n }", "function eth_check_burn($addr, $txid) {\n\n\treturn -1;\n}", "public static function UpdateVanBan($id,$request)\n {\n $ret = VanBanTable::UpdateVanBan($id,$request);\n\n if(($ret != 'fail')&&($request->filevanban != null)){\n\n $ret = VanBanTable::StoreFileVanBan($id);\n }\n\n return $ret;\n }", "public static function getBans($guild_id)\r\n {\r\n $result = Api::get(\r\n '/guilds/' . $guild_id . '/bans'\r\n );\r\n\r\n return array_map([UserFactory::class, 'instatiate'], $result->getBody());\r\n }", "function check_if_ban_is_in_order($id, $max = 3)\r\n\t{\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT COUNT(id) AS bad_logins FROM login_attempts WHERE student_id = ? AND time > SUBDATE(NOW(), INTERVAL 5 MINUTE) AND login_success = 0;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('i', $id);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($bad_logins); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($bad_logins >= $max)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "public function check_balance()\n {\n $data = array(\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->paybill,\n 'IdentifierType' => '4',\n 'Remarks' => 'Remarks or short description',\n 'Initiator' => $this->initiator_username,\n 'SecurityCredential' => $this->get_credential(),\n 'QueueTimeOutURL' => $this->balance_check_result_url,\n 'ResultURL' => $this->balance_check_result_url\n );\n $data = json_encode($data);\n $url = $this->base_url . 'accountbalance/v1/query';\n $response = $this->submit_request($url, $data);\n return $response;\n }", "public function bloquear(Request $request, $id)// validando os valores e pegando o ID\n\t{\n\t\tWP_Users::where('ID', $id)->update(array('user_status' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")));\n\t\t\n\t\t//registrando a ocorrencia na tabela acao:\n\t\t$acao = new Acoes;\n\t\t$acao->id_usuario = \\Request::session()->get('id_usuario');\n\t\t$acao->acao = 'Bloqueio de Usuário';\n\t\t$acao->link = 'medicos/detalhes/'.$id;\n\t\t$acao->save();\n\t\t//redirecionando de acordo com o resultado do update\n\t\treturn redirect('/medicos/cadastrados'); //redireciona para a listagem\n }", "public function isBanned()\n {\n return (bool) $this->ban;\n }", "protected function checkPendingBill()\n {\n // $pendingIds = [];\n // foreach ($pendingStatusIDs as $one) {\n // $pendingIds[] = $one->id;\n // }\n // $this->billing = \\OlaHub\\UserPortal\\Models\\UserBill::where('temp_cart_id', $this->cart->id)->where('country_id', $this->cart->country_id)->where('pay_for', 0)->whereIn('pay_status', $pendingIds)->first();\n \\OlaHub\\UserPortal\\Models\\UserBill::where('temp_cart_id', $this->cart->id)->where('user_id', app('session')->get('tempID'))->delete();\n }", "public function getBannedUids() {}", "private function checkID($id)\n {\n if ($id == 0) {\n $response = array(\"status\" => false, \"message\" => 'Invalid ID');\n $this->send(400, $response);\n }\n }", "public function banUser($userId, $bans) {\n $user = $this->get($userId, false);\n if (empty($user)) return 'Invalid user id.';\n \n $this->db->update(array('_id' => $this->_toMongoId($userId)),\n array('$set' => array('bans' => $bans)));\n $this->clearCache($userId);\n \n // We need to permeate an active session!\n $key = 'hts_user_' . $user['username'];\n if (apc_exists($key)) {\n Session::setExternalVars(apc_fetch($key), array('bans' => $bans));\n }\n return $user;\n }", "public function block($id)\n {\n $block = $this->selectuser($id,'block');\n if($block[0]['block'] == 1)\n {\n $this->updateuser($id,'block',0);\n }\n else\n {\n $this->updateuser($id,'block',1);\n }\n }", "public function isBanned() {\n return $this->getStatus() === Status::BANNED;\n }", "function get_ban_details() {\n\tglobal $db;\n\tglobal $attempted_user_id;\n\n\t$prepared = $db->prepare(\"\n\t\t\tSELECT date_time, until_date_time, reason\n\t\t\tFROM user_bans\n\t\t\tWHERE user_id = ? AND\n\t\t\t\tdate_time >= ALL (\n\t\t\t\t\t\tSELECT date_time\n\t\t\t\t\t\tFROM user_bans\n\t\t\t\t\t\tWHERE user_id = ?\n\t\t\t\t\t\t)\n\t\t\");\n\n\t$prepared->bind_param('ii', $attempted_user_id, $attempted_user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\t$prepared->bind_result(\n\t\t$date_time,\n\t\t$until_date_time,\n\t\t$reason\n\t);\n\n\t$prepared->fetch();\n\n\t$prepared->free_result();\n\n\treturn (object) array(\n\t\t\t'date_time'\t\t\t=> $date_time,\n\t\t\t'until_date_time'\t=> $until_date_time,\n\t\t\t'reason'\t\t\t=> $reason\n\t\t);\n}", "function add_ban_details($reason, $duration, $user_id) {\n\tglobal $db;\n\n\t$prepared = $db->prepare(\"\n INSERT INTO user_bans (user_id, until_date_time, reason)\n VALUES (\n ?,\n if(? IS NOT NULL, NOW() + INTERVAL ? DAY, NULL),\n ?\n )\n \");\n\n\t$prepared->bind_param('iiis', $user_id, $duration, $duration, $reason);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function balanceCheck($data) {\n \tif(isset($this->data['Bidbutler']['balance'])) {\n\t \tif(!empty($this->data['Bidbutler']['balance'])) {\n\t\t \tif($this->data['Bidbutler']['balance'] < $data['bids']) {\n\t\t \t\treturn false;\n\t\t \t}\n\t \t} else {\n\t \t\treturn false;\n\t \t}\n \t}\n\n \treturn true;\n }", "public function unlock(int $id): bool\n {\n // Execute query.\n $result = $this->wpdb->update(\n $this->blacklist_table,\n ['release_time' => \\date(self::MYSQL_DATETIME_FORMAT, current_time('timestamp'))],\n ['id' => $id],\n ['%s'],\n ['%d']\n );\n // Return status.\n return $result !== false;\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 deleteBlacklistContact($id)\n {\n $appStage = app_config('AppStage');\n if ($appStage == 'Demo') {\n return redirect('user/sms/blacklist-contacts')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important' => true\n ]);\n }\n\n $blacklist = BlackListContact::where('user_id', Auth::guard('client')->user()->id)->find($id);\n if ($blacklist) {\n $blacklist->delete();\n return redirect('user/sms/blacklist-contacts')->with([\n 'message' => language_data('Number deleted from blacklist', Auth::guard('client')->user()->lan_id),\n ]);\n } else {\n return redirect('user/sms/blacklist-contacts')->with([\n 'message' => language_data('Number not found on blacklist', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }", "public function blockUser($id)\n {\n $this->db->set('status_id', '1');\n $this->db->where('id', $id);\n $this->db->update('inm_user');\n return true;\n }", "public function getIdBangunan()\n {\n return $this->id_bangunan;\n }", "function canBidBuddy($bidbutler) {\n\tglobal $config;\n\t\n\tif ($bidbutler['reverse']) {\n\t\t//reverse auctions work differently\n\t\tif ($bidbutler['price'] <= $bidbutler['minimum_price'] ||\n\t\t\t\t $config['App']['bidButlerType'] == 'simple' ||\n\t\t\t\t $bidbutler['fixed'] == 1) {\n\t\t\tlogIt($bidbutler['auction_id']. '; canBidBuddy: true');\n\t\t\treturn true;\n\t\t}\n\t\t\t\t \n\t} else {\n\t\t//standard auction\n\t\t\n\t\tif ($bidbutler['price'] >= $bidbutler['minimum_price'] &&\n\t\t\t ($bidbutler['price'] < $bidbutler['maximum_price']) ||\n\t\t\t $config['App']['bidButlerType'] == 'simple' ||\n\t\t\t $bidbutler['fixed'] == 1) {\n\t\t\tlogIt($bidbutler['auction_id']. '; canBidBuddy: true');\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function confirm($id=\"\"){\r\n \t\t\t//$bitcoin_isvalid = $bitcoin->listtransactions();\r\n\r\n \t\t\t/*$bal=$bitcoin->getbalance();*/\r\n\r\n \r\n\r\n\t\t$id=insep_decode($id);\r\n\t\t$condition=array(\"transactionId\"=>$id,\"status\"=>\"Pending\");\r\n\t\t$transdata=$this->CommonModel->getTableData(\"tansation\",$condition);\r\n\t\tif($transdata->num_rows() >0){\t\t\r\n\r\n\r\n if($this->input->post(\"witdraw_submit\")){ \r\n\r\n\r\n \t\t$currecncy=$transdata->row()->currency;\r\n \t \t$currency=$transdata->row()->currency;\r\n \r\n\r\n \tif($currency==\"BTC\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTC\",$transdata);\r\n\r\n\r\n \t}else if($currency==\"LTC\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"LTC\",$transdata);\r\n\r\n \t}else if($currency==\"DGB\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DGB\",$transdata);\r\n\r\n \t}else if($currency==\"DASH\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DASH\",$transdata);\r\n\r\n \t}else if($currency==\"ETH\"){\r\n \t\t$txn_id=$this->transfer_eth(\"ETH\",$transdata);\r\n\r\n \t}else if($currency==\"XRP\"){\r\n\r\n \t\t$txn_id=$this->transfer_xrp($transdata);\r\n\r\n \t} else if($currency==\"BTG\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTG\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"BCH\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BCH\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"ETC\"){\r\n\r\n \t\t$txn_id=$this->transfer_etc(\"ETC\",$transdata);\r\n\r\n \t}else if($currency==\"XMR\"){\r\n\r\n \t \t$txn_id=$this->transfer_xmr($transdata);\r\n\r\n \t}\r\n\t\t \t\r\n \t\t$status=\"Success\";\r\n\r\n \t\tif($status==\"Success\"){\r\n\r\n\t\t\t\t$transdata=$transdata->row();\r\n\t\t\t\t$currecncy=$transdata->currency;\r\n\t\t\t\t$amount=$transdata->total_amount;\r\n\t\t\t\t$update[\"status\"]=\"Completed\";\r\n\t\t\t\t$update[\"transation_hash\"]=$txn_id;\r\n\t\t\t\t$this->CommonModel->updateTableData(\"tansation\",$update,$condition);\r\n\t\t\t\t$email_data=getEmailTeamplete(10);\r\n\t\t\t\t$subject=$email_data->subject;\r\n\t\t\t\t$template=$email_data->template;\r\n\t\t\t\t$site_data=site_settings();\r\n\t\t\t\t$sitename=$site_data->site_name;\r\n\t\t\t\t$trans_data=$transdata;\r\n\t\t \t $trans_data->total_amount;\t\t\t\t\t\r\n\t\t\t\t\t$data=array(\r\n\t\t\t\t\t\t\"###TRANSID###\"=>$trans_data->transactionId,\t\t\t\r\n\t\t\t\t\t\t\"###AMOUNT###\"=>$trans_data->total_amount.$trans_data->currency,\r\n\t\t\t\t\t\t\"###LOGOIMG###\"=> base_url().\"assets/frontend/images/mail_logo.png\",\r\n\t\t\t\t\t\t\"###FBIMG###\"=> base_url().\"assets/frontend/images/facebook.png\",\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\"###STATUS###\"=> \"Completed\",\t\t\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$data[\"###LOGOIMG###\"]=getSiteLogo();\r\n\t\t\t\t\t$data[\"###EMAILIMG###\"]= base_url().\"assets/frontend/images/email_send.png\";\r\n\t\t\t\t\t$data[\"###FBIMG###\"]= base_url().\"assets/frontend/images/facebook.png\";\t\t\t\r\n\t\t\t\t\t$data[\"###TWIMG###\"]= base_url().\"assets/frontend/images/twitter.png\";\r\n\t\t\t\t\t$data[\"###GPIMG###\"]= base_url().\"assets/frontend/images/gplus.png\";\r\n\t\t\t\t\t$data[\"###LEIMG###\"]= base_url().\"assets/frontend/images/linkedin.png\";\t\r\n\t\t\t\t\t$data[\"###HDIMG###\"]= base_url().\"assets/frontend/images/email.png\";\r\n\t\t\t\t\t$data[\"###FBLINK###\"]= $site_data->facebooklink;\t\t\t\t\r\n\t\t\t\t\t$data[\"###TWLINK###\"]= $site_data->twitterlink;\t\r\n\t\t\t\t\t$data[\"###GPLINK###\"]= $site_data->googlelink;\r\n\t\t\t\t\t$data[\"###LELINK###\"]= $site_data->linkedinlink;\r\n\t\t\t\t$email=get_user_email($trans_data->user_id);\r\n\t\t\t\t $message=strtr($template,$data);\t\t\r\n\t\t\t\tsend_mail($email,$subject,$message);\r\n\t\t\t\t$this->session->set_flashdata(\"success\",\"Withdraw request Completed successfully\");\t\t\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}else{\r\n\r\n\r\n\t\t\t\t$this->session->set_flashdata(\"error\",\"Withdraw request error, Tray again after some time\");\t\t\r\n\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$transdata=$transdata->row();\r\n\t\t\t$user_id=$transdata->user_id;\r\n\t\t\t$condition=array(\"user_id\"=>$user_id);\r\n\t\t\t$userdata=$this->CommonModel->getTableData(\"userdetails\",$condition)->row();\t\r\n\t\t\t$data['withdraw']=$transdata;\t\r\n\r\n\t\t\t $data['user_name']=$userdata->username;\t\t\r\n\t\t\t\r\n\t\t\t$this->load->view(\"admin/transation/withdaw_request_details\",$data);\t\r\n\r\n\t\t}\r\n\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->session->set_flashdata(\"error\",\"Invalid link or already used link\");\t\t\r\n\t\r\n\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t}", "function report_check($id)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$id = mysql_clean($id);\r\n\t\t$results = $db->select(tbl($this->flag_tbl),\"flag_id\",\" id='\".$id.\"' AND type='\".$this->type.\"' AND userid='\".userid().\"'\");\r\n\t\tif(count($results)>0)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public function is_user_baned($user_id)\n {\n $query = $this->db\n ->where('user_id', $user_id)\n ->get('users');\n $result = $query->row_array();\n return (intval($result['ban']) === 1);\n }", "public function ban(Request $request)\n {\n $user = User::find($request->id);\n if (\\Auth::user()->type === 'admin'){\n $user->update(['status' => 13]);\n alert()->success('کاربر با موفقیت مسدود شد', 'مسدود شد');\n return redirect()->back();\n }else{\n alert()->warning('عدم دسترسی');\n return redirect()->route('panel.index');\n }\n\n }", "public function checkAlternativeIdMethods() {}", "public function abm($id = NULL)\n\t{\n\t\t$vista \t\t\t= '';\n\t\t$db['fields']\t= $this->m_entes->getFields();\n\t\t$id_table\t\t= $this->m_entes->getId_Table();\n\t\t$checkbox\t\t= array(\n\t\t\t'boletas',\n\t\t\t'tarjetas',\n\t\t\t'bloquear'\n\t\t);\n\t\t\n\t\t// DELETE \n\t\t\n\t\tif($this->input->post('eliminar')){\n\t\t\t$boletas = $this->m_boletas->getBoletas($this->input->post($id_table), 0, 1);\n\t\t\t\n\t\t\tif($boletas && $this->_config['delete_ente_boleta'] == 1){\n\t\t\t\t$url = '<p><a href=\"'.base_url().'index.php/'.$this->_subject.'/abm/'.$this->input->post($id_table).'\">'.$this->lang->line('boleta_impaga_cant').count($boletas).'</a></p>';\n\t\t\t\t$this->alerta_banco($url);\n\t\t\t\t\n\t\t\t\t$db['mensaje']\t= $this->lang->line('ente_no_delete');\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$this->m_entes->delete($this->input->post($id_table));\n\t\t\t\t$db['mensaje']\t= 'update_ok';\n\t\t\t\t$vista = 'table';\n \n if($this->usar_noti == 1){\n $this->notificacionSiris($this->input->post($id_table), 'B'); \n }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// UPDATE\n\t\t\n\t\tif($this->input->post('modificar')){\n\t\t\t\n\t\t\tforeach ($db['fields'] as $field) {\n\t\t\t\tif($this->input->post($field) !== NULL){\n\t\t\t\t\t$registro[$field] = $this->input->post($field);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($checkbox as $box) {\n\t\t\t\tif($this->input->post($box) !== null){\n\t\t\t\t\t$registro[$box] = 1;\n\t\t\t\t}else{\n\t\t\t\t\t$registro[$box] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->m_entes->update($registro, $this->input->post($id_table));\n\t\t\t$db['mensaje']\t= 'update_ok';\n\t\t\t$vista = 'table';\n \n if($this->usar_noti == 1){\n $siris = $this->notificacionSiris($this->input->post($id_table), 'M', 'archive');\n \n if($siris['flag'] == 'error')\n {\n $this->m_entes->delete($this->input->post($id_table));\n $db['mensaje'] = $siris['result'] ;\n } \n }\n\t\t}\n\t\t\n\t\tif($id){\n\t\t\t$db['cod_inc']\t= FALSE;\n\t\t\t$db['registro'] = $this->m_entes->getRegistros($id, 'all'); \n\t\t}else{\n\t\t\t$db['cod_inc']\t= $this->m_entes->getMax('codigo');\n\t\t\t$db['registro'] = FALSE;\n\t\t}\n\n\t\t// RESTAURAR \n\n\t\tif($this->input->post('restaurar')){\n\t\t\t$this->m_entes->restore($this->input->post($id_table));\n\t\t\t$db['mensaje']\t= 'update_ok';\n\t\t\t$vista = 'table';\n \n if($this->usar_noti == 1){\n $siris = $this->notificacionSiris($this->input->post($id_table), 'A', 'archive'); \n \n if($siris['flag'] == 'error')\n {\n $this->m_entes->delete($this->input->post($id_table));\n $db['mensaje'] = $siris['result'] ;\n } \n }\n\t\t}\n\t\t\t\t\t\t\n\t\t// INSERT \n\t\t\t\n\t\tif($this->input->post('agregar') || $this->input->post('agregar_per')){\n\t\t\tforeach ($db['fields'] as $field) {\n\t\t\t\tif($this->input->post($field) !== NULL){\n\t\t\t\t\t$registro[$field] = $this->input->post($field);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($checkbox as $box) {\n\t\t\t\tif($this->input->post($box) !== null){\n\t\t\t\t\t$registro[$box] = 1;\n\t\t\t\t}else{\n\t\t\t\t\t$registro[$box] = 0;\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t$id_ente = $this->m_entes->insertEntes($registro);\n\t\t\t\n\t\t\tif($id_ente)\n\t\t\t{\n\t\t\t\t$db['mensaje']\t= 'insert_ok';\n\t\t\t}\n\t\t\t\n\t\t\tif($this->usar_noti == 1)\n\t\t\t{\n\t\t\t\t$siris = $this->notificacionSiris($id_ente, 'A', 'archive');\n \n if($siris['flag'] == 'error')\n {\n $this->m_entes->delete($id_ente);\n $db['mensaje'] = $siris['result'] ;\n } \t\n\t\t\t}\n\t\t\t\n\t\t\tif($this->input->post('agregar')){\n\t\t\t\t$vista = 'table';\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ARMADO DE VISTA\n\t\t\n\t\tif($vista != 'table'){\n\t\t\t$db['leyendas']\t\t= $this->m_leyendas->getRegistros();\n\t\t\t$db['convenios']\t= $this->m_convenios->getRegistros();\n\t\t\t$this->armar_vista('abm', $db);\n\t\t}else{\n\t\t\tif(isset($db['mensaje'])){\n\t\t\t\t$this->table($db['mensaje']);\n\t\t\t}else{\n\t\t\t\t$this->table();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public function isBanned()\n {\n return $this->is_banned;\n }", "function checkAuth($bid){\n\t\tglobal $x7s, $x7c, $db, $prefix, $x7p;\n\t\t\n\t\t$query = $db->DoQuery(\"\n\t\t\tSELECT user_group, offgame\n\t\t\tFROM {$prefix}boards\n\t\t\tWHERE id='{$bid}'\n\t\t\");\n\t\t\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t\n\t\tif(checkIfMaster()){\n\t\t\treturn true;\t\n\t\t}\t\n\t\telse if(in_array($row['user_group'], $x7p->profile['usergroup']) || \n\t\t\t\t$row['user_group'] == $x7p->profile['base_group'] ||\n\t\t\t\t$row['user_group'] == '_all_') {\n\t\t\t$bans = $x7p->bans_on_you;\n\t\t\tif(count($bans) && !$row['offgame'])\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function bans(){\n return $this->hasMany('App\\Ban', 'account_id', 'id');\n }", "public function actionSaveBid(){\n\t\t$question_id = $_GET['question_id'];\n\t\t$option_id = $_GET['option_id'];\n\t\t$bid_amount = $_GET['bid'];\n\t\t$question_max_bid_amount = $_GET['question_max_bid_amount'];\n\t\t//$user_model = getUserBalance($fb_me['id']);\n\t\t$question_model = Questions::model()->findByPk($question_id);\n\t\t$question_max_bid_amount = $question_model->maximum_bid_amount;\n\t\tif (strtotime($question_model->end_time) < time()){\n\t\t\techo \"ERROR: Oops! you are late, Bidding on this question is closed\";\t\n\t\t} else {\n\t\t\t$authentic = new Authentication();\n\t $status = $authentic->authenticate();\n\t\t\tif ($status == 'TRUE')\n\t\t\t{\n\t\t\t\t$fb_me = $authentic->getMe();\t\t\t\n\t\t\t\t$me = $fb_me['id'];\n\t\t\t\t$criteria1 = new CDbCriteria;\n\t\t\t\t$criteria1->condition = 'uid=:u';\n\t\t\t\t$criteria1->params = array('u'=>$fb_me['id']);\n\t\t\t\t$user = UserInfo::model()->find($criteria1);\n\t\t\t\tif($user->invite_money_status == 'invited') {\n\t\t\t\t\t$user->invite_money_status = 'transfer_pending';\n\t\t\t\t\t$user->save();\n\t\t\t\t\tprint_r($user->getErrors());\n\t\t\t\t}\n\t\t\t\t$user_model = $this->getUserBalance($me);\n\t\t\t\tif ($user_model !== NULL){\n\t\t\t\t\tforeach ($user_model as $key => $value) {\n\t\t\t\t\t\t$id = $value->id;\n\t\t\t\t\t\t$user_balance = $value->closing_balance;\n\t\t\t\t\t}\n\t\t\t\t\t$user_question_pot = $this->getUserPot($id, $question_id);\t\n\t\t\t\t\tif($user_question_pot === NULL){\n\t\t\t\t\t\t$user_question_pot = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (($user_question_pot + $bid_amount) > $question_max_bid_amount){\n\t\t\t\t\t\techo \"ERROR: Maximum bid amount is \".$question_max_bid_amount.\" for this question. You have already bid: \".$bid_amount;\n\t\t\t\t\t} else if ($bid_amount > $question_max_bid_amount){\n\t\t\t\t\t\techo \"ERROR: Maximum bid amount is \".$question_max_bid_amount.\" for this question.\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$question_model = Questions::model()->findAllByPk($question_id);\n\t\t\t\t\t\tforeach ($question_model as $key => $value) {\n\t\t\t\t\t\t\t$event_id = $value->event_id;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$bid_amount = abs($bid_amount);\n\t\t\t\t\t\tif ($this->saveBidInfo($id, $bid_amount, $question_id, $option_id, $event_id)){\n\t\t\t\t\t\t\t/* We need to pass $id rather than $me to update user closing balance */\n\t\t\t\t\t\t\t$user_balance = $this->updateUserProfileInfo($id, $bid_amount);\t\n\t\t\t\t\t\t\t$trans_create_time = $this->saveTransactionInfo($id, $bid_amount, $question_id, $option_id, $event_id);\n\t\t\t\t\t\t\t$this->saveBankReconInfo($id, $bid_amount, $trans_create_time);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Send updated Balance information to the View */\n\t\t\t\t\t\t\t$user_info['question_pot_user'] = $user_question_pot + $bid_amount;\n\t\t\t\t\t\t\t$user_info['user_balance'] = $user_balance;\n\t\t\t\t\t\t\techo json_encode($user_info);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"ERROR: Sorry We lost your Bid\";\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo \"ERROR: Sorry We Lost You\";\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\t$this->redirect(array('/application/main'));\n\t\t\t}\n\t\t}\t\t\n\t}", "function check_biller_status() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$biller_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($biller_records)) {\n\t\t\t\t$biller_status = $biller_records[0]['biller_status'];\n\t\t\t\t$user_id = $biller_records[0]['user_id'];\n\t\t\t\t$biller_id = $biller_records[0]['biller_id'];\n\t\t\t\t$post = array('status' => \"true\", \"biller_status\" => $biller_status, 'user_id' => $user_id, 'biller_id' => $biller_id);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid user id\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n # Check the Unbound ACLs array for ID\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"acls\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2074);\n }\n } else {\n $this->errors[] = APIResponse\\get(2072);\n }\n }", "function banNickName($nickName){\n\t\t\t//load data from persistence object\n\t\t\t$storageType \t\t= $this->configManager->getStorageType();\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif(strtolower($storageType) == 'file'){\n\t\t\t\t$fileName = $this->configManager->getDataDir().'/'.$this->configManager->getBanFileName();\n\t\t\t\t$this->persistenceManager->setStorageType('file');\n\t\t\t\t$this->persistenceManager->setBanFile($fileName);\n\t\t\t}elseif(strtolower($storageType) == 'mysql'){\n\t\t\t\tdie(\"MySQL storage type, not implemented yet!\");\n\t\t\t}else{\n\t\t\t\tdie(\"Unknown storage type!\");\n\t\t\t}\n\t\t\t\n\t\t\t$this->persistenceManager->banNickName($nickName);\n\t\t\t\n\t\t}", "function bid($data = array(), $autobid = false, $bid_description = null) {\r\n\t\t\t\t\t$canBid = true;\r\n\t\t\t\t\t$message = '';\r\n\t\t\t\t\t$flash = '';\r\n\r\n\t\t\t\t\t// Get the auctions\r\n\t\t\t\t\t$this->contain();\r\n\t\t\t\t\t$fieldList = array('Auction.id', 'Auction.product_id', 'Auction.start_time', 'Auction.end_time', 'Auction.price', 'Auction.peak_only', 'Auction.closed', 'Auction.minimum_price', 'Auction.autobids', 'Auction.max_end', 'Auction.max_end_time', 'Auction.penny');\r\n\r\n\t\t\t\t\t$auction = $this->find('first', array('conditions' => array('Auction.id' => $data['auction_id']), 'fields' => $fieldList));\r\n\r\n\t\t\t\t\tif(!empty($auction)){\r\n\t\t\t\t\t\t// check to see if this is a free auction\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['freeAuctions'])) {\r\n\t\t\t\t\t\t\t$product = $this->Product->find('first', array('conditions' => array('Product.id' => $auction['Auction']['product_id']), 'fields' => 'Product.free', 'contain' => ''));\r\n\t\t\t\t\t\t\tif(!empty($product['Product']['free'])) {\r\n\t\t\t\t\t\t\t\t$data['bid_debit'] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['limits']['active'])) {\r\n\t\t\t\t\t\t\t$limits_exceeded = $this->requestAction('/limits/canbid/'.$data['auction_id'].'/'.$data['user_id']);\r\n\t\t\t\t\t\t\tif($limits_exceeded == false) {\r\n\t\t\t\t\t\t\t\t$message = __('You cannot bid on this auction as your have exceeded your bidding limit.', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction has been end - this only applies to NON autobidders\r\n\t\t\t\t\t\tif((!empty($auction['Auction']['closed']) || strtotime($auction['Auction']['end_time']) <= time()) && $autobid == false) {\r\n\t\t\t\t\t\t\t$message = __('Auction has been closed', true);\r\n\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction has been not started yet\r\n\t\t\t\t\t\tif(!empty($auction['Auction']['start_time'])) {\r\n\t\t\t\t\t\t\tif(strtotime($auction['Auction']['start_time']) > time()){\r\n\t\t\t\t\t\t\t\t$message = __('Auction has not started yet', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if the auction is peak only and if the now is peak time\r\n\t\t\t\t\t\tif(!empty($auction['Auction']['peak_only'])){\r\n\t\t\t\t\t\t\tif(empty($data['isPeakNow'])){\r\n\t\t\t\t\t\t\t\t$message = __('This is a peak auction', true);\r\n\t\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Get user balance\r\n\t\t\t\t\t\tif($autobid == true || $this->appConfigurations['bidButlerDeploy'] == 'group') {\r\n\t\t\t\t\t\t\t$balance = $data['bid_debit'];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$balance = $this->Bid->balance($data['user_id']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// this goes last to prevent the double bid issues\r\n\t\t\t\t\t\t$latest_bid = $this->Bid->lastBid($data['auction_id']);\r\n\t\t\t\t\t\tif(!empty($latest_bid) && $latest_bid['user_id'] == $data['user_id']){\r\n\t\t\t\t\t\t\t$message = __('You cannot bid as you are already the highest bidder', true);\r\n\t\t\t\t\t\t\t$canBid = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($canBid == true) {\r\n\t\t\t\t\t\t\t// Checking if user has enough bid to place\r\n\t\t\t\t\t\t\tif($balance >= $data['bid_debit']) {\r\n\r\n\t\t\t\t\t\t\t\t// Check if it's bidbutler call\r\n\t\t\t\t\t\t\t\tif(!empty($data['bid_butler'])) {\r\n\t\t\t\t\t\t\t\t\t// Find the bidbutler\r\n\t\t\t\t\t\t\t\t\t$this->Bidbutler->contain();\r\n\t\t\t\t\t\t\t\t\t$bidbutler = $this->Bidbutler->find('first', array('conditions' => array('Bidbutler.id' => $data['bid_butler'])));\r\n\r\n\t\t\t\t\t\t\t\t\t// If bidbutler found\r\n\t\t\t\t\t\t\t\t\tif(!empty($bidbutler)){\r\n\t\t\t\t\t\t\t\t\t\tif($bidbutler['Bidbutler']['bids'] >= $data['bid_debit']) {\r\n\t\t\t\t\t\t\t\t\t\t\t// Decrease the bid butler bids\r\n\t\t\t\t\t\t\t\t\t\t\t$bidbutler['Bidbutler']['bids'] -= $data['bid_debit'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Save it\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Bidbutler->save($bidbutler, false);\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t// Get out of here, the bids on bidbutler was empty\r\n\t\t\t\t\t\t\t\t\t\t\treturn $auction;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Formatting auction time and price increment\r\n\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['penny'])) {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['price'] \t+= 0.01;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['price'] \t+= $data['price_increment'];\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = date('Y-m-d H:i:s', strtotime($auction['Auction']['end_time']) + $data['time_increment']);\r\n\r\n\t\t\t\t\t\t\t\t// lets make sure the auction time is now less than now\r\n\t\t\t\t\t\t\t\tif(strtotime($auction['Auction']['end_time']) < time()) {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = date('Y-m-d H:i:s', time() + $data['time_increment']);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets check the max end time to see if the end_time is greater than the max_end_time\r\n\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['max_end'])) {\r\n\t\t\t\t\t\t\t\t\tif(strtotime($auction['Auction']['end_time']) > strtotime($auction['Auction']['max_end_time'])) {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['end_time'] = $auction['Auction']['max_end_time'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets extend the minimum price if its an auto bidder\r\n\t\t\t\t\t\t\t\tif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\tif(!empty($auction['Auction']['penny'])) {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['minimum_price'] += 0.01;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['minimum_price'] += $data['price_increment'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['autobids'] += 1;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['autobids'] = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Formatting user bid transaction\r\n\t\t\t\t\t\t\t\t$bid['Bid']['user_id'] \t = $data['user_id'];\r\n\t\t\t\t\t\t\t\t$bid['Bid']['auction_id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t\t\t$bid['Bid']['credit'] = 0;\r\n\r\n\t\t\t\t\t\t\t\tif(!empty($data['bid_butler']) && Configure::read('App.bidButlerType') == 'advanced') {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['debit'] = 0;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['debit'] = $data['bid_debit'];\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Insert proper description, bid or bidbutler\r\n\t\t\t\t\t\t\t\tif(!empty($bid_description)) {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = $bid_description;\r\n\t\t\t\t\t\t\t\t} elseif(!empty($data['bid_butler'])){\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = __('Bid Butler', true);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$bid['Bid']['description'] = __('Single Bid', true);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// lets check for double bids - 01/03/2008 - Michael - lets only include bids in this check due to error from group deploy for bid butlers\r\n\t\t\t\t\t\t\t\t$auction['Auction']['double_bids_check'] = false;\r\n\t\t\t\t\t\t\t\t$bid['Bid']['double_bids_check'] = true;\r\n\r\n\t\t\t\t\t\t\t\t// Saving bid\r\n\t\t\t\t\t\t\t\tif(is_array($data['user_id'])) {\r\n\t\t\t\t\t\t\t\t\tforeach($data['user_id'] as $user){\r\n\t\t\t\t\t\t\t\t\t\t// 2008-02-27 21:44:20 -- Maulana\r\n\t\t\t\t\t\t\t\t\t\t// Update the leader id, set the leader_id to\r\n\t\t\t\t\t\t\t\t\t\t// latest user_id in array Q\r\n\t\t\t\t\t\t\t\t\t\t$auction['Auction']['leader_id'] = $user;\r\n\t\t\t\t\t\t\t\t\t\t$this->save($auction);\r\n\r\n\t\t\t\t\t\t\t\t\t\t$bid['Bid']['user_id'] = $user;\r\n\t\t\t\t\t\t\t\t\t\t$this->Bid->create();\r\n\t\t\t\t\t\t\t\t\t\t$this->Bid->save($bid);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif($this->appConfigurations['simpleBids'] == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['bid_balance'] -= $bid['Bid']['debit'];\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner);\r\n\t\t\t\t\t\t\t\t\t\t} elseif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t// 18/2/2009 - this has been added for \"grouped\" bids. We need to update the modified date for the autobidders\r\n\t\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// 2008-02-27 21:44:20 -- Maulana\r\n\t\t\t\t\t\t\t\t\t// Update the leader id to $data['user_id']. since\r\n\t\t\t\t\t\t\t\t\t// it's not an array we can put it directly\r\n\t\t\t\t\t\t\t\t\t$auction['Auction']['leader_id'] = $data['user_id'];\r\n\r\n\t\t\t\t\t\t\t\t\t$this->Bid->create();\r\n\t\t\t\t\t\t\t\t\t$this->Bid->save($bid);\r\n\r\n\t\t\t\t\t\t\t\t\tif($this->appConfigurations['simpleBids'] == true) {\r\n\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['bid_balance'] -= $bid['Bid']['debit'];\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t} elseif($autobid == true) {\r\n\t\t\t\t\t\t\t\t\t\t// 18/2/2009 - this has been added for \"grouped\" bids. We need to update the modified date for the autobidders\r\n\t\t\t\t\t\t\t\t\t\t$winner = $this->Winner->find('first', array('conditions' => array('Winner.id' => $data['user_id']), 'contain' => ''));\r\n\t\t\t\t\t\t\t\t\t\t$winner['Winner']['modified'] = date('Y-m-d H:i:s');\r\n\t\t\t\t\t\t\t\t\t\t$this->Winner->save($winner, false);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// Saving auction\r\n\t\t\t\t\t\t\t\t$this->save($auction);\r\n\r\n\t\t\t\t\t\t\t\t$message = __('Your bid was placed', true);\r\n\r\n\t\t\t\t\t\t\t\tif(!empty($this->appConfigurations['flashMessage'])) {\r\n\t\t\t\t\t\t\t\t\tApp::import('Helper', array('Number'));\r\n\t\t\t\t\t\t\t\t\t$number = new NumberHelper();\r\n\r\n\t\t\t\t\t\t\t\t\t// New flash message\r\n\t\t\t\t\t\t\t\t\tif(!empty($data['bid_butler'])){\r\n\t\t\t\t\t\t\t\t\t\tif(!empty($data['bid_butler_count'])){\r\n\t\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('%d Bid Butler + %s + %s seconds', true), $data['bid_butler_count'], $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('1 Bid Butler + %s + %s seconds', true), $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$flash = sprintf(__('1 Single bid + %s + %s seconds', true), $number->currency($data['price_increment'], $this->appConfigurations['currency']), $data['time_increment']);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$auction['Auction']['success'] = true;\r\n\t\t\t\t\t\t\t\t$auction['Bid']['description'] = $bid['Bid']['description'];\r\n\t\t\t\t\t\t\t\t$auction['Bid']['user_id'] = $bid['Bid']['user_id'];\r\n\r\n\t\t\t\t\t\t\t\t// lets add in the bid information for smartBids - we need this\r\n\t\t\t\t\t\t\t\t$result['Bid'] = $bid['Bid'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$message = __('You have no more bids in your account', true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$result['Auction']['id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t$result['Auction']['message'] = $message;\r\n\t\t\t\t\t\t$result['Auction']['element'] = 'auction_'.$auction['Auction']['id'];\r\n\r\n\t\t\t\t\t\tif(!empty($this->appConfigurations['flashMessage'])){\r\n\t\t\t\t\t\t\t$auction['Auction']['flash'] = $flash;\r\n\r\n\t\t\t\t\t\t\t$auctionMessage = $this->Message->findByAuctionId($auction['Auction']['id']);\r\n\t\t\t\t\t\t\t$auctionMessage['Message']['auction_id'] = $auction['Auction']['id'];\r\n\t\t\t\t\t\t\t$auctionMessage['Message']['message'] = $flash;\r\n\r\n\t\t\t\t\t\t\tif(empty($auctionMessage)){\r\n\t\t\t\t\t\t\t\t$this->Message->create();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->Message->save($auctionMessage);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// now lets refund any bid credits not used before returning the data IF advanced mode is on\r\n\t\t\t\t\t\tif($this->appConfigurations['bidButlerType'] == 'advanced') {\r\n\t\t\t\t\t\t\t$this->Bid->refundBidButlers($auction['Auction']['id'], $auction['Auction']['price']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn $result;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public function create()\n {\n $id = Input::get('id', NULL);\n\n if(!Entrust::can('issuetban') && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@index', [])->withErrors(['You do not have permission to issue bans']);\n }\n\n if(is_null($id) || !is_numeric($id))\n {\n return Redirect::back();\n }\n\n $player = Player::find($id);\n\n if(!$player)\n {\n return View::make('error.generror')->with('code', 404)->with('errmsg', 'PAGE NOT FOUND')\n ->with('errdescription', 'No player exists with ID ' . $id)\n ->with('title', 'Page Not Found');\n }\n\n if($player->recentBanExist())\n {\n $ban = $player->recentBan;\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$ban->ban_id]);\n }\n\n $game = $player->gameIdent();\n\n if($game == 'BF3')\n {\n foreach(Server::bf3()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n elseif($game == 'BF4')\n {\n foreach(Server::bf4()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n\n View::share('title', 'Create New Ban');\n\n $this->layout->content = View::make('admin.adkats.bans.createban')->with('player', $player)->with('_gameName', $game)->with('_servers', $_servers);\n }", "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 testBlacklistFromShowPage(): void {\n // go to the show page of the second item.\n $crawler = $this->logInSuperAdmin();\n $client = $this->getClient();\n $crawler = $client->click($crawler->filter(\"#navbar\")->selectLink(\"Gestion des contacts\")->link());\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $crawler = $client->click($tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\")->selectLink(\"Voir les détails\")->link());\n\n // Verify if the blacklist button is displayed and submit the form.\n $actionButtons = $crawler->filter(\"#admin-container .card .actions\")->children();\n $this->count(3, $actionButtons, \"1.1. Two action buttons are expected.\");\n $this->assertContains(\"Ip sur liste noire\", $actionButtons->eq(2)->text(), \"1.2. The label of the third button is not ok.\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $actionButtons->eq(2)->html(), \"1.3. The icon of the third button is not ok.\");\n\n // blacklist the message ip and verify the result\n $client->submit($actionButtons->eq(2)->selectButton('Ip sur liste noire')->form());\n $crawler = $client->followRedirect();\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"2.1 The status code expected is not ok.\");\n $this->assertEquals(\"/sadmin/contact\", $client->getRequest()->getRequestUri(), \"2.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"2.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"2.4 One success message is expected\");\n $this->assertRegExp(\"~L'ip \\\"[0-9\\.]+\\\" a été blacklistée avec succès !~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"2.5 The success message is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(1)->children()->eq(3)->html(), \"2.6 The blacklisted icon is not expected\");\n $this->assertCount(2, $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\"), \"2.7 Two actions button are expected\");\n }", "public function banned()\n {\n $userId = request()->user;\n $user = User::find($userId);\n if ($user->isNotBanned()) {\n $user->ban();\n } else {\n $user->unban();\n }\n return redirect()->route('users.index', [\n 'user' => $user\n ]);\n }", "public function blockUser($id)\n {\n $this->db->set('status_id', '1');\n $this->db->where('id', $id);\n $this->db->update('temp_user');\n return true;\n }", "function show_bid ()\n{\n // Only bid committe members, the bid chair and the GM Liaison may access\n // this page\n\n if ((! user_has_priv (PRIV_BID_COM)) &&\n (! user_has_priv (PRIV_BID_CHAIR)) &&\n (! user_has_priv (PRIV_GM_LIAISON)))\n return display_access_error ();\n\n $BidId = intval (trim ($_REQUEST['BidId']));\n\n $sql = 'SELECT * FROM Bids WHERE BidId=' . $BidId;\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query for BidId $BidId failed\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find bid $BidId\");\n\n $bid_row = mysql_fetch_assoc ($result);\n\n // If the UserId is valid use that to override any user information\n\n $UserId = $bid_row['UserId'];\n if (0 != $UserId)\n {\n $sql = 'SELECT * FROM Users WHERE UserId=' . $UserId;\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query for UserId $UserId failed\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find user $UserId\");\n\n $user_row = mysql_fetch_assoc ($result);\n foreach ($user_row as $key => $value)\n $bid_row[$key] = $value;\n }\n\n // If the EventId is valid, use that to override any game information\n\n $EventId = $bid_row['EventId'];\n if (0 != $EventId)\n {\n $sql = 'SELECT * FROM Events WHERE EventId=' . $EventId;\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query for EventId $EventId failed\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find event $EventId\");\n\n $event_row = mysql_fetch_assoc ($result);\n foreach ($event_row as $key => $value)\n $bid_row[$key] = $value;\n }\n // Bid chair & GM Liaison can edit bids\n $gametype = $bid_row['GameType'];\n\n\n echo \"<TABLE BORDER=0 WIDTH=\\\"100%\\\">\\n\";\n echo \" <TR VALIGN=TOP>\\n\";\n echo \" <TD>\\n\";\n printf (\" <FONT SIZE=\\\"+2\\\"><B>%s</B></FONT>\\n\", $bid_row['Title']);\n echo \" </TD>\\n\";\n\n\n if (user_has_priv (PRIV_BID_CHAIR) || user_has_priv (PRIV_GM_LIAISON))\n {\n echo \" <TD>\\n\";\n printf (' [<A HREF=Bids.php?GameType=%s&action=%d&BidId=%d>Edit Bid</A>]',\n $gametype,\n\t BID_GAME,\n\t $BidId);\n echo \" </TD>\\n\";\n }\n echo \" </tr>\\n\";\n echo \"</TABLE>\\n\";\n\n echo \"<TABLE BORDER=0>\\n\";\n\n show_section ('Submitter Information');\n show_text ('Submitter',\n\t\t $bid_row['DisplayName']);\n $text = $bid_row['Address1'];\n if ('' != $bid_row['Address2'])\n $text .= '<BR>' . $bid_row['Address2'];\n $text .= '<BR>' . $bid_row['City'] . ', ' . $bid_row['State'] . ' ' . $bid_row['Zipcode'];\n if ('' != $bid_row['Country'])\n $text .= '<BR>' . $bid_row['Country'];\n\n show_text ('Address', $text);\n show_text ('EMail', $bid_row['EMail']);\n show_text ('Daytime Phone', $bid_row['DayPhone']);\n show_text ('Evening Phone', $bid_row['EvePhone']);\n show_text ('Best Time To Call', $bid_row['BestTime']);\n show_text ('Preferred Contact', $bid_row['PreferredContact']);\n show_text ('Other Classes/Panels/Acts', $bid_row['OtherGames']);\n\n\n show_section (\"$gametype Information\");\n\n if ($gametype == 'Class')\n {\n show_text ('Teacher(s)', $bid_row['Author']);\n show_text ('Assistant Teachers(s)', $bid_row['GMs']);\n show_text ('Organization', $bid_row['Organization']);\n show_text ('Homepage', $bid_row['Homepage']);\n show_text ('POC EMail', $bid_row['GameEMail']);\n }\n else if ($gametype == 'Panel')\n {\n show_text ('Recommended Panelist(s)', $bid_row['GMs']);\n show_text ('POC EMail', $bid_row['GameEMail']);\n\n }\n else if ($gametype == 'Performance')\n {\n show_text ('Performer(s)', $bid_row['Author']);\n show_text ('Fellow Performer(s)', $bid_row['GMs']);\n show_text ('Organization', $bid_row['Organization']);\n show_text ('Homepage', $bid_row['Homepage']);\n show_text ('POC EMail', $bid_row['GameEMail']);\n }\n else \n {\n show_text ('Author(s)', $bid_row['Author']);\n show_text ('GM(s)', $bid_row['GMs']);\n show_text ('Organization', $bid_row['Organization']);\n show_text ('Homepage', $bid_row['Homepage']);\n show_text ('POC EMail', $bid_row['GameEMail']);\n }\n\n if ($gametype == 'Class')\n show_players ($bid_row, 1);\n\n show_text ('Run Before', $bid_row['RunBefore']);\n if ($gametype=='Class')\n {\n show_text ('Class Type', $bid_row['GameSystem']);\n\n show_section ('Restrictions');\n \n show_text ('Room Specifics', $bid_row['SpaceRequirements']);\n show_text ('Physical Restrictions', $bid_row['PhysicalRestrictions']);\n }\n \n show_section ('Scheduling Information');\n\n // create schedule preference table\n display_schedule_pref ($BidId, $gametype=='Panel'); \n\n echo \" </TD>\\n\";\n echo \" </tr>\\n\";\n \n if ($gametype != 'Panel'){\n show_text ('Hours', $bid_row['Hours']);\n show_text ('Multiple Runs', $bid_row['MultipleRuns']);\n // show_text ('Can Play Concurrently', $bid_row['CanPlayConcurrently']);\n show_text ('Other Constraints', $bid_row['SchedulingConstraints']);\n show_text ('Other Details', $bid_row['OtherDetails']);\n \n \n bid_involve($UserId, $bid_row[BidId]);\n\n\n }\n \n show_section ('Advertising Information');\n\n show_text ('Short Sentence', $bid_row['ShortSentence']);\n show_text ('Short Blurb', $bid_row['ShortBlurb']);\n show_text ('Description', $bid_row['Description']);\n show_text ('Shameless Plugs', $bid_row['ShamelessPlugs']);\n show_text ('GM Advertise Game', $bid_row['GMGameAdvertising']);\n show_text ('GM Advertise Intercon', $bid_row['GMInterconAdvertising']);\n show_text ('Send Flyers', $bid_row['SendFlyers']);\n\n echo \"</TABLE>\\n\";\n echo \"<P>\\n\";\n}" ]
[ "0.7984984", "0.70188737", "0.6972131", "0.68740016", "0.65127015", "0.6477991", "0.6394135", "0.6374035", "0.63722444", "0.6286647", "0.6277863", "0.62589586", "0.624427", "0.6225984", "0.6191506", "0.608635", "0.59782594", "0.59320784", "0.58829206", "0.5880357", "0.5861235", "0.5853971", "0.5853548", "0.58488685", "0.5807275", "0.5805413", "0.57502973", "0.57044655", "0.56826866", "0.56781214", "0.5676259", "0.56358397", "0.563266", "0.56298745", "0.560258", "0.5594475", "0.5566392", "0.5557297", "0.5552065", "0.54735225", "0.5469388", "0.5453048", "0.543427", "0.5432426", "0.54033446", "0.5398681", "0.5391114", "0.5370297", "0.53695005", "0.5345193", "0.5341488", "0.53359", "0.5327155", "0.5323224", "0.530917", "0.52789414", "0.5253198", "0.5241866", "0.52351415", "0.52332246", "0.5231708", "0.52315104", "0.52244925", "0.5205798", "0.5199236", "0.51924604", "0.5191237", "0.5166589", "0.5148672", "0.51454234", "0.5139962", "0.51346993", "0.5128563", "0.5125352", "0.51188856", "0.51123047", "0.51110584", "0.5105622", "0.51017725", "0.5101145", "0.50979996", "0.5095362", "0.5094147", "0.508893", "0.50887924", "0.5088723", "0.5085756", "0.508118", "0.5073121", "0.506642", "0.5063388", "0.50412655", "0.50368744", "0.50335234", "0.50321126", "0.5030455", "0.5030355", "0.5024882", "0.5012976", "0.50090176" ]
0.79278874
1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_force_team_change() { $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_force_team_change_by_id() { $this->assertTrue($this->postScriptumServer->adminForceTeamChange(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_disband_squad() { $this->assertTrue($this->postScriptumServer->adminForceTeamChange(1, 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_remove_player_from_squad() { $this->assertTrue($this->postScriptumServer->adminRemovePlayerFromSquad('Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.7777244", "0.75565845", "0.7416151", "0.72451764", "0.72451764", "0.72451764", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.7135212", "0.6982127", "0.6982127", "0.6947707", "0.69385296", "0.69186467", "0.69078624", "0.6880801", "0.6880031", "0.68587416", "0.67058676", "0.66788965", "0.6638344", "0.66076887", "0.6604514", "0.6577216", "0.6577216", "0.65768886", "0.64957386", "0.64957386", "0.6472659", "0.64429116", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.64256746", "0.6421647", "0.6358728", "0.6345981", "0.6341348", "0.63241994", "0.6319957", "0.62957615", "0.6284706", "0.626472", "0.62602913", "0.62587464", "0.6258611", "0.6258583", "0.6249115", "0.62483215", "0.6208531", "0.6205163", "0.61942965", "0.6187048", "0.6165223", "0.6160734", "0.6156044", "0.6152381", "0.6144285", "0.6133478", "0.6122821", "0.6115429", "0.61024463", "0.6097506", "0.6097414", "0.60874623", "0.60708356", "0.60708356", "0.60708356", "0.6070776", "0.60685366", "0.60634756", "0.60634756", "0.605918", "0.6047604", "0.60379547", "0.6031454", "0.6012481", "0.5999483", "0.5997446", "0.59958345", "0.5987653", "0.59827536", "0.597341", "0.59703106", "0.59662616", "0.5954745", "0.59320456", "0.5931702", "0.59123987", "0.59082747", "0.5899966", "0.58783644" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_remove_player_from_squad_by_id() { $this->assertTrue($this->postScriptumServer->adminRemovePlayerFromSquadById(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_warn() { $this->assertTrue($this->postScriptumServer->adminWarn('Test', 'Hello World!')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_admin_warn_by_id() { $this->assertTrue($this->postScriptumServer->adminWarnById(0, 'Hello World!')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->postScriptumServer->disconnect());\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.777693", "0.7557172", "0.74165106", "0.72449124", "0.72449124", "0.72449124", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.7164282", "0.71351945", "0.6982229", "0.6982229", "0.69474566", "0.69381267", "0.69185024", "0.6908139", "0.68803585", "0.6880062", "0.68585473", "0.6705654", "0.66792667", "0.66388065", "0.6606307", "0.6603796", "0.6578654", "0.6578654", "0.6578314", "0.6496791", "0.6496791", "0.6472244", "0.6442149", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.64368206", "0.6425306", "0.6420862", "0.63588226", "0.63460636", "0.6342389", "0.6323101", "0.63189167", "0.6294921", "0.6284024", "0.62635994", "0.62597054", "0.6258114", "0.62580365", "0.62578946", "0.62479794", "0.6247448", "0.6208457", "0.62048393", "0.6193964", "0.6186833", "0.6165731", "0.6160119", "0.61548704", "0.61518806", "0.61446977", "0.6132771", "0.6122109", "0.611414", "0.61037076", "0.6097085", "0.6096406", "0.60877556", "0.6072017", "0.6072017", "0.6072017", "0.60717297", "0.60672283", "0.6062865", "0.6062865", "0.60597557", "0.6045845", "0.6036914", "0.60308963", "0.6012326", "0.59985346", "0.5997444", "0.5995858", "0.5987469", "0.5982981", "0.5972285", "0.5970335", "0.59654117", "0.5955777", "0.5933165", "0.59307283", "0.59112656", "0.5906275", "0.5899281", "0.5877968" ]
0.0
-1
Verifies the disconnect method works without any exception
public function test_squad_server_disconnect() { $this->assertNull($this->postScriptumServer->disconnect()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disconnectIfConnected() {}", "public function testDisconnect()\n {\n $this->server->disconnect();\n\n # Check a standard disconnection\n $this->server->connect();\n $this->server->disconnect();\n\n # Ensure a second disconnect is cool\n $this->assertTrue($this->server->disconnect());\n }", "public function disconnect() : bool\n {\n return false;\n }", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect(): void;", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "public function test_squad_server_disconnect()\n {\n $this->assertNull($this->btwServer->disconnect());\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "public function disConnect();", "function Disconnect() {}", "public function disconnect()\n\t{\n\t}", "public function disconnect(): void\n {\n }", "public function disconnect()\n {\n $this->execute('exit');\n \n return true;\n }", "public function pdisconnect(): void\n {\n }", "protected function isConnectSuccessful() {}", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function testCheckConnections()\n {\n $result = $this->la->checkConnection();\n $this->assertTrue($result);\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "abstract public function isConnected();", "abstract public function isConnected();", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function DisConnect()\n\t{\n\t\t$this->__connection = null;\n\t\t$this->__connected = false;\n\t}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "protected function checkTimeout()\n {\n $timestamp = time();\n if (($timestamp - $this->connectionTime) > $this->reconnectTimeout) {\n $this->disconnect();\n }\n }", "public function disconnect()\n\t{\n\t\t$this->_con = FALSE;\n\t\t\n\t\treturn TRUE;\n\t}", "abstract function isConnected();", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function closeConnection(): bool;", "protected function disconnectIfConnected()\n {\n if ($this->isConnected) {\n $this->link->close();\n $this->isConnected = false;\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function aim_disconnect()\r\n\t{\r\n\t\tif ($this->aim_connected() === true) {\r\n\t\t\tfclose($this->resource);\r\n\t\t} else {\r\n\t\t\tthrow new TACException('No active connection was found to disconnect');\r\n\t\t}\r\n return false;\r\n\t}", "public static function disconnect() {\n\tself::$instance->disconnect();\n }", "public static function disconnect(){\n\t\tself::$cnx = NULL;\t\n\t\t\n\t}", "protected function disconnect() {\n $this->connection = null;\n echo $this->name . ' disconnected' .\"<br>\";\n }", "function disconnect() {\n\t\tif ($this->con) {\n\t\t\treturn $this->con->close();\n\t\t}\n\t\treturn false;\n\t}", "protected function case_teardown() {\r\n if ($this->service->is_connected()) {\r\n $this->service->disconnect();\r\n }\r\n }", "public function reconnect(): void;", "public function onConnectionClosed();", "public function disconnect()\n {\n if ($this->m_connect) $this->m_connect->Disconnect();\n }", "private function _checkConnection()\n\t{\n\t\tif (is_resource($this->_connection) === false)\n\t\t{\n\t\t\t// no active connection reconnect\n\t\t\t$this->_connect();\n\t\t}\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "function connect(): bool;", "public function testInvalidConnect(): void\n {\n // setup\n $data = $this->getUserData();\n $data['password'] = '1234';\n $url = self::$serverPath . '/connect/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertTrue(isset($result->message));\n $this->assertTrue(isset($result->code));\n $this->assertTrue($result->code == - 1 || $result->code == 4);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function testConnection()\n {\n try {\n $data = Redis::ping();\n if ($data == 'PONG') {\n return true;\n }\n } catch (UnexpectedValueException $e) {\n return false;\n }\n }", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function disconnect() {\r\n\t\t// clean up connection!\r\n\t\t$this->connection->close ();\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function connect(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function testConnectionEstablished()\r\n {\r\n $this->clientHandler->connect();\r\n $this->assertTrue($this->clientHandler->isConnected());\r\n $this->clientHandler->close();\r\n }", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "public function reconnect();", "public function reconnect();", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "abstract protected function dbDisconnect();", "public function reconnect(): void\n {\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function disconnect() {\n if ( $this->tcp ) {\n print \"User: Disconnecting TCP\\n\";\n socket_close($this->tcp);\n\n $this->tcp = null;\n\n return true;\n }\n\n return false;\n }", "public function disconnect()\n {\n $this->connection->close();\n return true;\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "public function disconnect()\n\t{\n\t\tif ($this->_isConnected) {\n\t\t\tunset($this->connection);\n\t\t\t$this->_isConnected = false;\n\t\t}\n\t\treturn true;\n\t}", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "#[@test, @expect('rdbms.SQLStateException')]\n public function noQueryWhenDisConnected() {\n $this->conn->connect();\n $this->conn->close();\n $this->conn->query('select 1');\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function isConnected():bool;", "public function isConnected(): bool\n {\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function disconnect()\n {\n /* Check to see that we are already connected */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Can only disconnect when connected!');\n }\n\n /* Unset user, pass variables; Then remove the core and parser objects */\n unset($this->_USER, $this->_PASS, $this->_query);\n\n return true;\n }" ]
[ "0.7777244", "0.75565845", "0.7416151", "0.72451764", "0.72451764", "0.72451764", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.71648747", "0.7135212", "0.6982127", "0.6982127", "0.6947707", "0.69385296", "0.69186467", "0.69078624", "0.6880801", "0.6880031", "0.67058676", "0.66788965", "0.6638344", "0.66076887", "0.6604514", "0.6577216", "0.6577216", "0.65768886", "0.64957386", "0.64957386", "0.6472659", "0.64429116", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.6435373", "0.64256746", "0.6421647", "0.6358728", "0.6345981", "0.6341348", "0.63241994", "0.6319957", "0.62957615", "0.6284706", "0.626472", "0.62602913", "0.62587464", "0.6258611", "0.6258583", "0.6249115", "0.62483215", "0.6208531", "0.6205163", "0.61942965", "0.6187048", "0.6165223", "0.6160734", "0.6156044", "0.6152381", "0.6144285", "0.6133478", "0.6122821", "0.6115429", "0.61024463", "0.6097506", "0.6097414", "0.60874623", "0.60708356", "0.60708356", "0.60708356", "0.6070776", "0.60685366", "0.60634756", "0.60634756", "0.605918", "0.6047604", "0.60379547", "0.6031454", "0.6012481", "0.5999483", "0.5997446", "0.59958345", "0.5987653", "0.59827536", "0.597341", "0.59703106", "0.59662616", "0.5954745", "0.59320456", "0.5931702", "0.59123987", "0.59082747", "0.5899966", "0.58783644" ]
0.68587416
23
Display user friendly error messages.
public function indexView() { // create custom path to template to avoid complex directory structures $view_file = __DIR__ . DIRECTORY_SEPARATOR .'ErrorView.phtml'; $view = new View($view_file); $code = intval($this->request[0]); list($code, $short, $long) = $this->getErrorDetails($code); $view->error_code = $code; $view->error_short = $short; $view->error_long = $long; $view->hostname = $_SERVER['SERVER_NAME']; $view->mvc_name = 'Mvc'; header(sprintf("HTTP/1.0 %d %s", $code, $short)); $view->render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayError()\n\t\t{\n\t\t\techo \"<div>\" . $this->error_message . \"</div>\";\n\t\t}", "public function showError();", "public function display_error($msg){\n \n }", "function displayError(){\n\t\tprint \"<div class=\\\"validationerror\\\">\";\n\t\tfor ($i=0;$i<count($this->error);$i++){\n\t\t\tprintln($this->error[$i]);\n\t\t}\n\t\tprint \"</div>\";\n\t}", "public static function displayErrors(){\n $ec = new EmailLabsConfig();\n if( $ec->getMode() == true && !empty( self::$errors ) ){\n $message = '';\n foreach( self::$errors as $item )\n $message .= '['.$item['lvl'].']['.$item['date'].']'.$item['msg'].\"\\n\";\n die( $message );\n }\n }", "function display_error_message($message)\r\n {\r\n Display :: error_message($message);\r\n }", "function show__errors ()\n {\n global $_errors;\n global $lang;\n if (0 < count ($_errors))\n {\n $errors = implode ('<br />', $_errors);\n echo '\n\t\t\t<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thead\">\n\t\t\t\t\t' . $lang->global['error'] . '\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<font color=\"red\">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t' . $errors . '\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</font>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<br />\n\t\t';\n }\n\n }", "static function show_error($message) {\n\t\techo '<div class=\"wrap\"><h2></h2><div class=\"error\" id=\"error\"><p>' . $message . '</p></div></div>' . \"\\n\";\n\t}", "function show_error ()\n {\n global $errormessage;\n global $lang;\n global $ts_template;\n if (!empty ($errormessage))\n {\n eval ($ts_template['show_error']);\n }\n\n }", "abstract public function display( $error );", "function showerror() {\r\n if (count($this->error_msgs)>0) {\r\n echo '<p><img src=\"images/eri.gif\"><b>'.lang('Error in form').'</b>:<ul>';\r\n foreach ($this->error_msgs as $errormsg) {\r\n echo '<li>'.$errormsg;\r\n }\r\n echo '</ul></p>';\r\n return True;\r\n }\r\n return False;\r\n }", "public function errorDisplay()\n {\n return \"<div class='error-message'><strong>\".Lang::get('message.error.title').\"</strong><br/>(\".date('Y-m-d H:m:s').\") \".$this->error.\"</div>\";\n }", "function show_error($msg)\n {\n print \"<div class=\\\"PhorumAdminError\\\">\";\n print \"Error: \" . htmlspecialchars($msg);\n print \"</div>\";\n }", "private function displayErrors () {\n echo '<pre>';\n\n foreach ($this->error as $single_error) {\n print_r($single_error);\n }\n\n echo '</pre>';\n }", "public function displayError() : string\n\t{\n\t\tif (!$this->debug)\n\t\t\treturn \"<b>ErrorMessage: </b> [\".$this->getMessage().\"] <br /><br />\";\n\t\t\n\t\t$errorMessage = \"<b>ErrorMessage: </b> [\".$this->getMessage().\"] <br />\";\n\t\t$errorMessage .= \"<b>ErrorLine: </b> [\".$this->getLine().\"] <br />\";\n\t\t$errorMessage .= \"<b>ErrorFile: </b> [\".$this->getFile().\"] <br />\";\n\t\t$errorMessage .= \"<b>ErrorClass: </b> [\".__CLASS__ .\"] <br />\";\n\t\t$errorMessage .= \"<b>ErrorCode: </b> [\".$this->getCode().\"]. <br /><br />\";\n\t\treturn $errorMessage;\n\t}", "function display_error() {\n\tglobal $errors;\n global $errors1;\n\n\tif (count($errors) > 0){\n\t\techo '<div class=\"error\">';\n\t\t\tforeach ($errors as $error){\n\t\t\t\techo $error .'<br>';\n\t\t\t}\n\t\techo '</div>';\n\t}\n}", "function showError($errmsg)\n{\n\techo \"<h2 class='error'>$errmsg</h2>\" . PHP_EOL;\n}", "public function outputFriendlyError()\n {\n //Erase contents of the output buffer\n ob_end_clean();\n view('errors/generic');\n exit;\n }", "public static function customErrorMsg()\n {\n echo \"\\n<p>An error occured, The error has been reported.</p>\";\n exit();\n }", "public function displayErrors() {\n\t\tif(count($this->errors)) {\n\t\t\t$output = \"<ul>\";\n\t\t\tforeach($this->errors as $error) {\n\t\t\t\t$output .= \"<li>\".$error.\"</li>\";\n\t\t\t}\n\t\t\t$output .= \"</ul>\";\n\t\t\treturn $output;\n\t\t}\n\t\treturn \"\";\n\t}", "public static function printErrors() {\n\t\tif (PNApplication::hasErrors()) {\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"<div style='color:#C00000;font-familiy:Tahoma;font-size:10pt'><img src='\".theme::$icons_16[\"error\"].\"' style='vertical-align:bottom'/> \".$e.\"</div>\";\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessageError(null,\".json_encode($e).\",5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"window.page_errors=[\";\n\t\t\t$first = true;\n\t\t\tforeach (PNApplication::$errors as $e) {\n\t\t\t\tif ($first) $first = false; else echo \",\";\n\t\t\t\techo json_encode($e);\n\t\t\t}\n\t\t\techo \"];\";\n\t\t\techo \"</script>\";\n\t\t}\n\t\tif (PNApplication::hasWarnings()) {\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$warnings as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessage(window.top.Status_TYPE_WARNING,\".json_encode($e).\",[{action:'popup'},{action:'close'}],5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"</script>\";\n\t\t}\n\t}", "function show_error ()\n {\n global $errormessage;\n if (!empty ($errormessage))\n {\n echo '\t\n\t\t<table width=\"100%\" border=\"0\" class=\"none\" style=\"clear: both;\" cellpadding=\"4\" cellspacing=\"0\">\n\t\t\t<tr><td class=\"thead\">An error has occcured!</td></tr>\n\t\t\t<tr><td><font color=\"red\"><strong>' . $errormessage . '</strong></font></td></tr>\n\t\t\t</table>\n\t\t<br />';\n }\n\n }", "public function actionError()\n\t{\n\t\treturn $this->render('error');\n\t}", "public static function showError($msg)\n {\n echo \"<div class='error'><p><strong>$msg</strong></p></div>\\n\";\n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has occured and your request could not be completed. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n }", "public function error() \n\t{\n\t\trequire $this->view('error', 'error');\n\t\texit;\n\t}", "function displayErrors($errors, $fixablebyuser=true)\n {\n // Since this function can be called before any ATK stuff has been loaded,\n // we have no rendering enging whatsoever, so we need to display html\n // manually.\n echo '<html>\n <head>\n <title>Achievo error</title>\n </head>\n <body bgcolor=\"#ffffff\">\n <br><b>A problem has occurred</b>\n <br>\n <br>We\\'re very sorry, but this server is unable to run Achievo,\n for the following reason(s):\n <br>\n <ul>';\n for($i=0, $_i=count($errors); $i<$_i; $i++)\n {\n echo '<li>'.$errors[$i].'<br><br>';\n }\n echo ' </ul>';\n if ($fixablebyuser)\n {\n echo ' If you can\\'t get Achievo to work after following the above instructions, please visit the <a href=\"http://www.achievo.org/forum\" target=\"_new\">Achievo forums</a> and we might be able to help you.';\n }\n echo ' </body>\n </html>';\n }", "protected function renderAsError() {}", "public function renderErrors();", "function display_error_page($message)\r\n {\r\n $this->display_header();\r\n $this->display_error_message($message);\r\n $this->display_footer();\r\n }", "function error_and_die($msg) {\n echo ('<p><span style=\"color:#ff0000; font-size:1.5em;\">SubmissionBox Error Encountered</span></p>');\n echo ('<p><span style=\"color:#ff0000;\">Message: ' . $msg . '</span></p></body></html>');\n die;\n }", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "public function index()\n {\n $this->mPageTitle = lang('reparation_errors');\n $this->render('reparation/errors');\n }", "function show_error_page($title, $header, $message)\n {\n $context = generate_context($title);\n $context['header'] = $header;\n $context['message'] = $message;\n\n render(\"error_view.php\", $context);\n }", "function show_errors() {\n\t\t\t$this->show_errors = true;\n\t\t}", "public function showError($message = \"\")\n {\n if(empty($message))\n {\n $this->layout->content = View::make('error')\n ->with('fmId', $this->fmId)\n ->with('serial', $this->serialNumber);\n }\n else\n {\n $this->layout->content = View::make('error')\n ->with('fmId', $this->fmId)\n ->with('serial', $this->serialNumber)\n ->with('message', $message);\n }\n }", "public function showError($error) {\r\n\t\tprint \"<h2 style='color: red'>Error: $error</h2>\";\r\n\t}", "public function actionError()\n\t{\n\t\t$this->layout = '/layouts/error';\n\n\t\tif ($error = Yii::app()->errorHandler->error) {\n\t\t\tif (isset($error['type']) && $error['type'] == 'NoticeException') {\n\t\t\t\t$model = unserialize($error['message']);\n\t\t\t\tswitch ($error['errorCode']) {\n\t\t\t\t\tcase Notice_INFO:\n\n\t\t\t\t\t\t$this->render('pageNoticeInfo', $model);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Notice_SUCCESS:\n\n\t\t\t\t\t\t$this->render('pageNoticeSuccess', $model);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Notice_WARNING:\n\n\t\t\t\t\t\t$this->render('pageNoticeWarning', $model);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$this->render('pageNoticeError', $model);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} elseif ($error['code'] == 403) {\n\t\t\t\t$model['title'] = 'Invalid Access';\n\t\t\t\t$model['message'] = !empty($error['message']) ? $error['message'] : $error;\n\t\t\t\t$this->render('pageAccessError', $model);\n\t\t\t} else {\n\t\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t\techo $error['message'];\n\t\t\t\t} else {\n\t\t\t\t\t$model['title'] = 'Those do not believe in magic will never find it';\n\t\t\t\t\t$model['message'] = !empty($error['message']) ? $error['message'] : $error;\n\t\t\t\t\t$this->render('pageNoticeError', $model);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function print_error() {\n echo '<div class=\"dirlist_error\">';\n echo '<h1>'.dl_error_header.'</h1>';\n echo '<div>['.$this->errorPlace.'] '.$this->error.'</div>';\n echo '</div>';\n }", "public function actionError()\n {\n if(Core::getLoggedUserID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'admin')->send();\n }\n }", "public function showToastForValidationError()\n {\n $errorBag = $this->getErrorBag()->all();\n\n if (count($errorBag) > 0) $this->toast($errorBag[0], 'error');\n }", "private function showExceptionUser()\n {\n \\ShowError(Loc::getMessage('FF_COMPONENT_CATCH_EXCEPTION'));\n }", "protected function enableDisplayErrors() {}", "protected function enableDisplayErrors() {}", "public function showFailed();", "public function actionError()\n\t{\n\t\t$error=Yii::app()->errorHandler->error;\n\t\tif($error)\n\t\t{\n\t\t\t$this->setAutoRender(false);\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "function display_errors($errors = array())\n{\n $output = '';\n if (!empty($errors)) {\n $output .= \"<div class=\\\"errors\\\">\";\n $output .= \"Please fix the following errors:\";\n $output .= \"<ul>\";\n foreach ($errors as $error) {\n $output .= \"<li>\" . h($error) . \"</li>\";\n }\n $output .= \"</ul>\";\n $output .= \"</div>\";\n }\n return $output;\n}", "public function display_error() {\n\n\t\t\tif ( is_null( $this->error ) || ! ( $this->error instanceof WP_Error ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$messages = $this->error->get_error_messages( 'success' );\n\t\t\tif ( $messages ) : ?>\n\t\t\t<div class=\"notice notice-success\" style=\"display: block !important\">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><?php echo join( '</li><li>', $messages ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tendif;\n\n\t\t\t$messages = $this->error->get_error_messages( 'error' );\n\t\t\tif ( $messages ) :\n\t\t\t?>\n\t\t\t<div class=\"error\" style=\"display: block !important\">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><?php echo join( '</li><li>', $messages ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tendif;\n\n\t\t\t$messages = $this->error->get_error_messages( 'info' );\n\t\t\tif ( $messages ) :\n\t\t\t?>\n\t\t\t<div class=\"notice notice-info\" style=\"display: block !important\">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><?php echo join( '</li><li>', $messages ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\tendif;\n\t\t}", "public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }", "function show_faq_errors ()\n {\n global $faq_errors;\n global $lang;\n if (0 < count ($faq_errors))\n {\n $errors = implode ('<br />', $faq_errors);\n echo '\n\t\t\t<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thead\">\n\t\t\t\t\t' . $lang->global['error'] . '\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<font color=\"red\">\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t' . $errors . '\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</font>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<br />\n\t\t';\n }\n\n }", "public function error()\n\t{\n\t\t$data['title'] = \"\";\n\t\t$this->load->view('lib', $data);\n\t\t$this->load->view('header_'.$_SESSION['language']);\n\t\t$this->load->view('error_'.$_SESSION['language']);\n\t\t$this->load->view('footer_'.$_SESSION['language']);\n\t}", "function sysError( $err = NULL, $errHeader = NULL, $errTitle = NULL ){\n\t\n\tglobal $output, $sys;\n\t\n\t$err = ( $err === NULL ) ? \"We apologize for the trouble! Please try again later.\" : $err;\n\t\n\tif( defined( \"NO_STYLING\" ) && NO_STYLING == true )\n\t\t// Ajax generated error - do not return HTML\n\t\tdie( $err );\n\t\n\t$errHeader = ( $errHeader === NULL ) ? \"We've hit an error\" : $errHeader;\n\t$errTitle = ( $errTitle === NULL ) ? \"Oops!\" : $errTitle;\n\t\n\t$output['message']['title'] = $errHeader;\n\t$output['message']['text'] = $err;\n\t\n\t$screen = new Screen();\n\t$screen->show( 'master/error_message.tpl', $errTitle );\n\t\n\texit();\n\t\n}", "abstract protected function _getErrorString();", "function showError($errorMsg = NULL)\n\t{\n\t\tif ($errorMsg)\n\t\t\tprint \"$errorMsg\\n\";\n\t\tdie(\"Error \" . mysql_errno() . \" : \" . mysql_error( ));\n\t}", "public function actionError()\n\t{\n\t\t$this->layout = '//layouts/error';\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif ( empty($error['message']) && isset(Config::$errors[ $error['code'] ]) ) {\n\t\t\t\t$error['message'] = Config::$errors[$error['code']];\n\t\t\t}\n\n\t\t\tif(Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\t\tYii::app()->end( json_encode( array('error'=>$error['code'], 'message'=>$error['message']), JSON_NUMERIC_CHECK ) );\n\t\t\t} else\n\t\t\t\t$this->render('error',array('error' => $error));\n\t\t}\n\t}", "function ErrorMsg()\n\t{\n\t\t\treturn '';\n\t}", "public function error()\n {\n require_once('views/pages/error.php');\n }", "function basic_error($pagetitle, $heading, $body)\n{\n\tglobal $output, $home_url;\n\t$output->title = $pagetitle;\n\t$output->subtitle = '';\n\t$output->use_header = 0;\n\t$output->addl(\"<div id=\\\"error\\\">\",1);\n\t$output->addl(\"<h2 class=\\\"error\\\">$heading</h2>\",2);\n\t$output->addl($body,2);\n\t$output->addl(\"<p><b><a href=\\\"$home_url/\\\">Senseless Political Ramblings home page</a></b></p>\",2);\n\t$output->display();\n}", "public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}", "function showError(){\n\t\techo json_encode(array(\n\t\t\t\"alert\" => \"error\",\n\t\t\t\"title\" => \"Failed to Update!\",\n\t\t\t\"message\" => \"Program Updating has been Failed\"\n\t\t));\n\t}", "public function actionError(){\n\t\tif($error=Yii::app()->errorHandler->error){\n\t\t\tif(YII_DEBUG){\n\t\t\t\t//开始框架的调试模式则显示错误信息\n\t\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\t\techo $error['message'];\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error);\n\t\t\t}else{\n\t\t\t\t//否则所有的错误都会导致页面重定向到首页\n\t\t\t\t$this->redirect(array('site/index'));\n\t\t\t}\n\t\t}\n\t}", "public function actionError()\n\t{\t\t\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "function displayErrorMessage($index,$params = array()) {\n\t\tglobal $lang;\n\t\n\t\t$message = nl2br(getLang('form_error_'.$index,$params));\n\t\n\t\tif ($index == 'something_wrong_happened' && isset($params['message'])) {\n\t\t\t$message .= ' '.getCassandraMessage($params['message']);\n\t\t}\n\t\n\t\treturn '<div class=\"alert alert-error\">'.$message.'</div>';\n\t}", "public static function show_errors(){\n\t\t\tself::$SHOWING_ERRORS=true;\n\t\t\tset_error_handler(array('Errors','handle_errors'),E_ALL | E_STRICT);\n\t\t\tset_exception_handler(array('Errors','handle_exceptions'));\n\t\t}", "public function actionError() {\n\t\tif ($error = Yii::app ()->errorHandler->error) {\n\t\t\tif (Yii::app ()->request->isAjaxRequest)\n\t\t\t\techo $error ['message'];\n\t\t\telse\n\t\t\t\t$this->render ( 'error', $error );\n\t\t}\n\t}", "public function actionError()\n\t{\n\t\tif ($error = Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function thm_blocksy_validation_error_notice() {\n\t\t\n\t\techo \"<div class='error notice'><p>\".$this->error.\"</p></div>\";\n\n\t}", "public function actionError() {\n\t\t$error=Yii::app()->errorHandler->error;\n\t\t\n\t\tif($error) {\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "static function showError($errno, $errstr, $errfile, $errline, $errcontext, $errtype) {\n\t\tif(!headers_sent()) {\n\t\t\t$errText = \"$errtype: \\\"$errstr\\\" at line $errline of $errfile\";\n\t\t\t$errText = str_replace(array(\"\\n\",\"\\r\"),\" \",$errText);\n\t\t\tif(!headers_sent()) header($_SERVER['SERVER_PROTOCOL'] . \" 500 $errText\");\n\t\t\t\n\t\t\t// if error is displayed through ajax with CliDebugView, use plaintext output\n\t\t\tif(Director::is_ajax()) header('Content-Type: text/plain');\n\t\t}\n\t\t\n\t\t// Legacy error handling for customized prototype.js Ajax.Base.responseIsSuccess()\n\t\t// if(Director::is_ajax()) echo \"ERROR:\\n\";\n\t\t\n\t\t$reporter = self::create_debug_view();\n\t\t\n\t\t// Coupling alert: This relies on knowledge of how the director gets its URL, it could be improved.\n\t\t$httpRequest = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_REQUEST['url'];\n\t\tif(isset($_SERVER['REQUEST_METHOD'])) $httpRequest = $_SERVER['REQUEST_METHOD'] . ' ' . $httpRequest;\n\n\t\t$reporter->writeHeader($httpRequest);\n\t\t$reporter->writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext);\n\n\t\t$lines = file($errfile);\n\n\t\t// Make the array 1-based\n\t\tarray_unshift($lines,\"\");\n\t\tunset($lines[0]);\n\n\t\t$offset = $errline-10;\n\t\t$lines = array_slice($lines, $offset, 16, true);\n\t\t$reporter->writeSourceFragment($lines, $errline);\n\n\t\t$reporter->writeTrace($lines);\n\t\t$reporter->writeFooter();\n\t\texit(1);\n\t}", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->\n isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError()\n {\n $this->layout = '//layouts/blank_error';\n if($error = Yii::app()->errorHandler->error)\n {\n if(Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError() {\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "function customError($errno, $errstr)\n {\n echo \"<b>Error:</b> [$errno] $errstr\";\n }", "function customError($errno, $errstr)\n {\n echo \"<b>Error:</b> [$errno] $errstr\";\n }", "public function actionError() {\n $this->layout = '//layouts/error';\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError() {\n\t if($error=app()->errorHandler->error) {\t\t\n\t \tif(app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse {\n\t\t\t\t$row = Pagecontent::model()->getPageContent('pagenotfound'); // get the page content for the page\n\t\t\t\tif ($row) { // row is found (page has contents) so we are rending the default view\n\t\t\t\t\t$row['html_title'] .= (!empty($row['html_title']) ? ' ' : '') . ' (' . $error['code'] . ')';\n\t\t\t\t\t$this->setPageAttributes($row);\t\t\n\t\t\t\t\t$this->render('default',array ('row'=>$row));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error); // execute the error view file \t \t\n\t\t\t}\n\t }\n\t}", "public function libxml_display_errors() { \r\n\t\r\n\t\t$errors = libxml_get_errors(); \r\n\t\t$retorno = \"\";\r\n\t\tforeach ($errors as $error) { \r\n\t\t\t$retorno .= $this->libxml_display_error($error); \r\n\t\t} \r\n\t\t\r\n\t\t// Limpa os erros da memoria\r\n\t\tlibxml_clear_errors();\r\n\t\t\r\n\t\t// Retorna os erros\r\n\t\treturn $retorno;\r\n\t}", "public function actionError() {\n\n $this->layout = '//layouts/layoutSite';\n\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError()\n\t{\n\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "function displayError($error, $step) {\r\n\techo '<h2>An error occurred in step '.$step.'</h2><p>Error: '.htmlspecialchars($error['error']).\r\n\t\t'<br />Description: '.(isset($error['error_description']) ? htmlspecialchars($error['error_description']) : 'n/a').'</p>';\r\n}", "public function errorMsg() {\r\n if(isset($this->get['e']) && isset($this->session[self::SESSION_ERROR])) {\r\n return '<p class=\"error\">' . $this->session[self::SESSION_ERROR] . '</p>';\r\n } else {\r\n return '';\r\n }\r\n }", "public function actionError()\r\r\n\t{\r\r\n\t\tif($error = Yii::app()->errorHandler->error)\r\r\n\t\t{\r\r\n\t\t\tif(Yii::app()->request->isAjaxRequest)\r\r\n\t\t\t\techo $error['message'];\r\r\n\t\t\telse\r\r\n\t\t\t\t$this->render('error', $error);\r\r\n\t\t}\r\r\n\t}", "public function showError($message)\r\n {\r\n $data['menu'] = \"\";\r\n\r\n foreach($this->menu['Menu'] as $m)\r\n {\r\n $data['menu'] .= '<li>';\r\n $data['menu'] .= '<a href=\"'.$m['AppMenuLink'].'\"><i class=\"fa '.$m['AppMenuIcon'].' fa-fw\"></i> '.$m['AppMenuName'].'</a>';\r\n $data['menu'] .= '</li>';\r\n }\r\n\r\n if(is_array($message)){\r\n $data['ErrorList'] = $message;\r\n $data['Error'] = \"There where multiple errors while trying to execute your task\";\r\n }\r\n else if(isset($message)){\r\n $data['Error'] = $message;\r\n }\r\n else{\r\n $data['Error'] = \"There was an error while trying to execute your task\";\r\n }\r\n\r\n $data['base_url'] = base_url();\r\n $this->load_view(\"Task/Error\", $data);\r\n }", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "public function actionError() {\r\n\t\tif ($error = Yii::app()->errorHandler->error) {\r\n\t\t\tif (Yii::app()->request->isAjaxRequest)\r\n\t\t\t\techo $error['message'];\r\n\t\t\telse\r\n\t\t\t\t$this->render('error', $error);\r\n\t\t}\r\n\t}", "public function errorAction() {\n $errors = $this->_getParam(\"error_handler\");\n \n // assegno i valori alla view\n $this->viewInit();\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n // 404 error -- controller or action not found \n $this->getResponse()->setRawHeader(\"HTTP/1.1 404 Not Found\");\n $this->view->title = \"HTTP/1.1 404 Not Found\";\n break;\n default:\n // application error; display error page, but don't change \n // status code\n $this->view->title = \"Application Error\";\n break;\n }\n $this->view->message = $errors->exception;\n }", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}" ]
[ "0.7883885", "0.7883064", "0.77275234", "0.7568589", "0.7421737", "0.74103326", "0.73702157", "0.7292104", "0.7284852", "0.7276367", "0.72644156", "0.7247669", "0.72269577", "0.7224591", "0.71912116", "0.71616125", "0.7133253", "0.7074319", "0.7051967", "0.7033873", "0.7023419", "0.70167106", "0.70050853", "0.69891727", "0.6973539", "0.69455504", "0.6928747", "0.6928478", "0.69221276", "0.69061804", "0.6897778", "0.6874346", "0.6874346", "0.68589294", "0.6823921", "0.6821966", "0.6819811", "0.6798472", "0.6795364", "0.678497", "0.6767828", "0.6761366", "0.6758973", "0.67572623", "0.67567784", "0.6753267", "0.67528766", "0.67350465", "0.6730181", "0.6726016", "0.6707289", "0.6705155", "0.66977376", "0.6695932", "0.66891736", "0.6669932", "0.66689515", "0.66543853", "0.66535276", "0.6643155", "0.66145474", "0.661373", "0.66095", "0.66093385", "0.6595379", "0.659534", "0.65930814", "0.65924454", "0.65915674", "0.6585935", "0.6584542", "0.6584472", "0.6579914", "0.6574943", "0.6574943", "0.6574466", "0.6574466", "0.6574172", "0.65729433", "0.6569147", "0.65691364", "0.65672493", "0.65650135", "0.6563806", "0.6562894", "0.6560084", "0.6559344", "0.65588623", "0.6557359", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65567356", "0.65551627" ]
0.0
-1
Return short and long descriptions for HTTP error codes.
private function getErrorDetails($code) { if (!isset($this->error_details[$code])) { $code = 404; } list($short, $long) = $this->error_details[$code]; // append exception output if (!is_null($this->exception)) { $long = sprintf("%s<br/>Error message is: %s", $long, $this->exception->getMessage()); } // some customizations when needed switch ($code) { case 404: $long = sprintf($long, $_SERVER['REQUEST_URI']); break; } return array($code, $short, $long); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function error( $code, $desc ) {\n\t\t$codes = array();\n\t\t$codes[400] = 'Bad Request';\n\t\t$codes[401] = 'Unauthorized';\n\t\t$codes[403] = 'Forbidden';\n\t\t$codes[404] = 'Not Found';\n\t\t$codes[405] = 'Method Not Allowed';\n\t\t$codes[406] = 'Not Acceptable';\n\t\t$codes[501] = 'Not Implemented';\n\t\t$codes[503] = 'Service unavailable';\n\t\t\n\t\theader('Content-Type: text/html');\n\t\theader( 'HTTP/1.1 '. $code . ' '. @$codes[$code] );\n\t\tdie( $desc );\n\t}", "function http_get_response_code_error($code)\n\t{\n\t\t$errors = array(\n\t\t200 => 'Success - The request was successful',\n\t\t201 => 'Created (Success) - The request was successful. The requested object/resource was created.',\n\t\t400 => 'Invalid Request - There are many possible causes for this error, but most commonly there is a problem with the structure or content of XML your application provided. Carefully review your XML. One simple test approach is to perform a GET on a URI and use the GET response as an input to a PUT for the same resource. With minor modifications, the input can be used for a POST as well.',\n\t\t401 => 'Unauthorized - This is an authentication problem. Primary reason is that the API call has either not provided a valid API Key, Account Owner Name and Associated Password or the API call attempted to access a resource (URI) which does not match the same as the Account Owner provided in the login credientials.',\n\t\t404 => 'URL Not Found - The URI which was provided was incorrect. Compare the URI you provided with the documented URIs. Start here.',\n\t\t409 => 'Conflict - There is a problem with the action you are trying to perform. Commonly, you are trying to \"Create\" (POST) a resource which already exists such as a Contact List or Email Address that already exists. In general, if a resource already exists, an application can \"Update\" the resource with a \"PUT\" request for that resource.',\n\t\t415 => 'Unsupported Media Type - The Media Type (Content Type) of the data you are sending does not match the expected Content Type for the specific action you are performing on the specific Resource you are acting on. Often this is due to an error in the content-type you define for your HTTP invocation (GET, PUT, POST). You will also get this error message if you are invoking a method (PUT, POST, DELETE) which is not supported for the Resource (URI) you are referencing.\n\t\tTo understand which methods are supported for each resource, and which content-type is expected, see the documentation for that Resource.',\n\t\t500 => 'Server Error',\n\t\t);\n\n\t\tif(array_key_exists($code, $errors)):\n\t\t\treturn $errors[$code];\n\t\tendif;\n\n\t\treturn '';\n\t}", "function get_status_header_desc($code) {\n\t$codes_to_desc = array(\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\t\t\t102 => 'Processing',\n\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\t\t\t207 => 'Multi-Status',\n\t\t\t226 => 'IM Used',\n\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found',\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t306 => 'Reserved',\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\t\t\t422 => 'Unprocessable Entity',\n\t\t\t423 => 'Locked',\n\t\t\t424 => 'Failed Dependency',\n\t\t\t426 => 'Upgrade Required',\n\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t506 => 'Variant Also Negotiates',\n\t\t\t507 => 'Insufficient Storage',\n\t\t\t510 => 'Not Extended'\n\t);\n\t\n\tif(check_value($codes_to_desc[$code])) {\n\t\treturn $codes_to_desc[$code];\t\n\t}\n\t\n}", "function httpError($code, $message = null, $die = true, $only_headers = false) {\n if($message === null) {\n $errors = array(\n 100 => \"HTTP/1.1 100 Continue\",\n 101 => \"HTTP/1.1 101 Switching Protocols\",\n 200 => \"HTTP/1.1 200 OK\",\n 201 => \"HTTP/1.1 201 Created\",\n 202 => \"HTTP/1.1 202 Accepted\",\n 203 => \"HTTP/1.1 203 Non-Authoritative Information\",\n 204 => \"HTTP/1.1 204 No Content\",\n 205 => \"HTTP/1.1 205 Reset Content\",\n 206 => \"HTTP/1.1 206 Partial Content\",\n 300 => \"HTTP/1.1 300 Multiple Choices\",\n 301 => \"HTTP/1.1 301 Moved Permanently\",\n 302 => \"HTTP/1.1 302 Found\",\n 303 => \"HTTP/1.1 303 See Other\",\n 304 => \"HTTP/1.1 304 Not Modified\",\n 305 => \"HTTP/1.1 305 Use Proxy\",\n 307 => \"HTTP/1.1 307 Temporary Redirect\",\n 400 => \"HTTP/1.1 400 Bad Request\",\n 401 => \"HTTP/1.1 401 Unauthorized\",\n 402 => \"HTTP/1.1 402 Payment Required\",\n 403 => \"HTTP/1.1 403 Forbidden\",\n 404 => \"HTTP/1.1 404 Not Found\",\n 405 => \"HTTP/1.1 405 Method Not Allowed\",\n 406 => \"HTTP/1.1 406 Not Acceptable\",\n 407 => \"HTTP/1.1 407 Proxy Authentication Required\",\n 408 => \"HTTP/1.1 408 Request Time-out\",\n 409 => \"HTTP/1.1 409 Conflict\",\n 410 => \"HTTP/1.1 410 Gone\",\n 411 => \"HTTP/1.1 411 Length Required\",\n 412 => \"HTTP/1.1 412 Precondition Failed\",\n 413 => \"HTTP/1.1 413 Request Entity Too Large\",\n 414 => \"HTTP/1.1 414 Request-URI Too Large\",\n 415 => \"HTTP/1.1 415 Unsupported Media Type\",\n 416 => \"HTTP/1.1 416 Requested range not satisfiable\",\n 417 => \"HTTP/1.1 417 Expectation Failed\",\n 500 => \"HTTP/1.1 500 Internal Server Error\",\n 501 => \"HTTP/1.1 501 Not Implemented\",\n 502 => \"HTTP/1.1 502 Bad Gateway\",\n 503 => \"HTTP/1.1 503 Service Unavailable\",\n 504 => \"HTTP/1.1 504 Gateway Time-out\" \n );\n \n $message = array_var($errors, $code);\n if(trim($message) == '') {\n $message = 'Unknown';\n } // if\n } // if\n \n header(\"HTTP/1.1 $code $message\");\n print '<h1>' . clean($message) . '</h1>';\n \n if($die) {\n die();\n } // if\n }", "function get_status_header_desc( $code ) {\n\t\tstatic $wp_header_to_desc;\n\n\t\tif ( !isset( $wp_header_to_desc ) ) {\n\t\t\t$wp_header_to_desc = array(\n\t\t\t\t100 => 'Continue',\n\t\t\t\t101 => 'Switching Protocols',\n\t\t\t\t102 => 'Processing',\n\n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created',\n\t\t\t\t202 => 'Accepted',\n\t\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t\t204 => 'No Content',\n\t\t\t\t205 => 'Reset Content',\n\t\t\t\t206 => 'Partial Content',\n\t\t\t\t207 => 'Multi-Status',\n\t\t\t\t226 => 'IM Used',\n\n\t\t\t\t300 => 'Multiple Choices',\n\t\t\t\t301 => 'Moved Permanently',\n\t\t\t\t302 => 'Found',\n\t\t\t\t303 => 'See Other',\n\t\t\t\t304 => 'Not Modified',\n\t\t\t\t305 => 'Use Proxy',\n\t\t\t\t306 => 'Reserved',\n\t\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t\t400 => 'Bad Request',\n\t\t\t\t401 => 'Unauthorized',\n\t\t\t\t402 => 'Payment Required',\n\t\t\t\t403 => 'Forbidden',\n\t\t\t\t404 => 'Not Found',\n\t\t\t\t405 => 'Method Not Allowed',\n\t\t\t\t406 => 'Not Acceptable',\n\t\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t\t408 => 'Request Timeout',\n\t\t\t\t409 => 'Conflict',\n\t\t\t\t410 => 'Gone',\n\t\t\t\t411 => 'Length Required',\n\t\t\t\t412 => 'Precondition Failed',\n\t\t\t\t413 => 'Request Entity Too Large',\n\t\t\t\t414 => 'Request-URI Too Long',\n\t\t\t\t415 => 'Unsupported Media Type',\n\t\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t\t417 => 'Expectation Failed',\n\t\t\t\t422 => 'Unprocessable Entity',\n\t\t\t\t423 => 'Locked',\n\t\t\t\t424 => 'Failed Dependency',\n\t\t\t\t426 => 'Upgrade Required',\n\n\t\t\t\t500 => 'Internal Server Error',\n\t\t\t\t501 => 'Not Implemented',\n\t\t\t\t502 => 'Bad Gateway',\n\t\t\t\t503 => 'Service Unavailable',\n\t\t\t\t504 => 'Gateway Timeout',\n\t\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t\t506 => 'Variant Also Negotiates',\n\t\t\t\t507 => 'Insufficient Storage',\n\t\t\t\t510 => 'Not Extended'\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $wp_header_to_desc[$code] ) )\n\t\t\treturn $wp_header_to_desc[$code];\n\t\telse\n\t\t\treturn '';\n\t}", "function http_status_code($code, $message = \"\") {\n\n if (!empty($code)) {\n\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default:\n exit('Unknown http status code \"' . htmlentities($code) . '\"');\n break;\n }\n\n $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n \n // Append the content if not empty\n if (!empty($message)) $message = \" - \" . $message;\n\n header($protocol . ' ' . $code . ' ' . $text . \"$message\");\n\n $GLOBALS['http_status_code'] = $code;\n\n } else {\n\n $code = (isset($GLOBALS['http_status_code']) ? $GLOBALS['http_status_code'] : 200);\n\n }\n\n // We must kill the requisition\n die($code);\n }", "private function codes()\n {\n $a_http_status_codes = array(\n 100 => 'Continue', 102 => 'Processing',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content',\n 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported',\n 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found',\n 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout',\n 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 421 => 'Misdirected Request',\n 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required',\n 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large',\n 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented',\n 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected',\n 510 => 'Not Extended', 511 => 'Network Authentication Required'\n );\n return $a_http_status_codes;\n }", "public static function getHttpStatusMessage(object $errorCode): string\n {\n $httpMessages = [\n // 1xx informational response\n 100 => 'HTTP_CONTINUE',\n 101 => 'HTTP_SWITCHING_PROTOCOLS',\n 102 => 'HTTP_PROCESSING',\n 103 => 'HTTP_EARLY_HINTS',\n // 2xx success\n 200 => 'HTTP_OK',\n 201 => 'HTTP_CREATED',\n 202 => 'HTTP_ACCEPTED',\n 203 => 'HTTP_NON_AUTHORITATIVE_INFORMATION',\n 204 => 'HTTP_NO_CONTENT',\n 205 => 'HTTP_RESET_CONTENT',\n 206 => 'HTTP_PARTIAL_CONTENT',\n 207 => 'HTTP_MULTI_STATUS',\n 208 => 'HTTP_ALREADY_REPORTED',\n 226 => 'HTTP_IM_USED',\n // 3xx redirection\n 300 => 'HTTP_MULTIPLE_CHOICES',\n 301 => 'HTTP_MOVED_PERMANENTLY',\n 302 => 'HTTP_FOUND',\n 303 => 'HTTP_SEE_OTHER',\n 304 => 'HTTP_NOT_MODIFIED',\n 305 => 'HTTP_USE_PROXY',\n 306 => 'HTTP_SWITCH_PROXY',\n 307 => 'HTTP_TEMPORARY_REDIRECT',\n 308 => 'HTTP_PERMANENT_REDIRECT',\n // 4xx client errors\n 400 => 'HTTP_BAD_REQUEST',\n 401 => 'HTTP_UNAUTHORIZED',\n 402 => 'HTTP_PAYMENT_REQUIRED',\n 403 => 'HTTP_FORBIDDEN',\n 404 => 'HTTP_NOT_FOUND',\n 405 => 'HTTP_METHOD_NOT_ALLOWED',\n 406 => 'HTTP_NOT_ACCEPTABLE',\n 407 => 'HTTP_PROXY_AUTHENTICATION_REQUIRED',\n 408 => 'HTTP_REQUEST_TIMEOUT',\n 409 => 'HTTP_CONFLICT',\n 410 => 'HTTP_GONE',\n 411 => 'HTTP_LENGTH_REQUIRED',\n 412 => 'HTTP_PRECONDITION_FAILED',\n 413 => 'HTTP_PAYLOAD_TOO_LARGE',\n 414 => 'HTTP_URI_TOO_LONG',\n 415 => 'HTTP_UNSUPPORTED_MEDIA_TYPE',\n 416 => 'HTTP_RANGE_NOT_SATISFIABLE',\n 417 => 'HTTP_EXPECTATION_FAILED',\n 418 => 'HTTP_IM_A_TEAPOT',\n 421 => 'HTTP_MISIDRECTED_REQUEST',\n 422 => 'HTTP_UNPROCESSABLE_ENTITY',\n 423 => 'HTTP_LOCKED',\n 424 => 'HTTP_FAILED_DEPENDENCY',\n 425 => 'HTTP_TOO_EARLY',\n 426 => 'HTTP_UPGRADE_REQUIRED',\n 428 => 'HTTP_PRECONDITION_REQUIRED',\n 429 => 'HTTP_TOO_MANY_REQUESTS',\n 431 => 'HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE',\n 451 => 'HTTP_UNAVIALBLE_FOR_LEGAL_REASONS',\n // 5xx server errors\n 500 => 'HTTP_INTERNAL_SERVER_ERROR',\n 501 => 'HTTP_NOT_IMPLEMENTED',\n 502 => 'HTTP_BAD_GATEWAY',\n 503 => 'HTTP_SERVICE_UNAVAILABLE',\n 504 => 'HTTP_GATEWAY_TIMEOUT',\n 505 => 'HTTP_VERSION_NOT_SUPPORTED',\n 506 => 'HTTP_VARIANT_ALSO_NEGOTIATES',\n 507 => 'HTTP_INSUFFICIENT_STORAGE',\n 508 => 'HTTP_LOOP_DETECTED',\n 510 => 'HTTP_NOT_EXTENDED',\n 511 => 'HTTP_NETWORK_AUTHENTICATION_REQUIRED',\n // 9xx fallback\n 999 => 'HTTP_UNKNOWN_STATUS',\n ];\n\n if (array_key_exists($errorCode->getStatusCode(), $httpMessages)) {\n return $httpMessages[$errorCode->getStatusCode()];\n }\n\n return '';\n }", "public static function getDescription($httpCode)\n {\n if (isset(self::$codes[$httpCode])) {\n return sprintf('%d (%s)', $httpCode, self::$codes[$httpCode]);\n }\n return $httpCode;\n }", "public function getStatusError($code = false)\n {\n switch ($code) {\n case 204:\n return 204;\n break;\n case 400: //Bad Request\n return 400;\n break;\n case 401:\n return 401;\n break;\n case 403:\n return 403;\n break;\n case 404:\n return 404;\n break;\n case 502:\n return 502;\n break;\n case 504:\n return 504;\n break;\n default:\n return 500;\n break;\n }\n }", "function status($code) {\n $reason=@constant('self::HTTP_'.$code);\n if (PHP_SAPI!='cli')\n header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);\n return $reason;\n }", "function get_status_header_desc($code)\n {\n }", "protected function getHttpResponseCodes() {\n return array (\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Switch Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 418 => 'I\\'m a teapot',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 425 => 'Unordered Collection',\n 426 => 'Upgrade Required',\n 449 => 'Retry With',\n 450 => 'Blocked by Windows Parental Controls',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 509 => 'Bandwidth Limit Exceeded',\n 510 => 'Not Extended'\n );\n }", "function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }", "private function _error(int $httpCode, string $message, string $status): array\n {\n return [\n 'error' => [\n 'code' => $httpCode,\n 'message' => $message,\n 'status' => $status,\n ],\n ];\n }", "function get_status_header_desc($code) {\n global $output_header_to_desc;\n\n $code = abs(intval($code));\n\n if (!isset ($output_header_to_desc)) {\n $output_header_to_desc = [\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 226 => 'IM Used',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Reserved',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Page Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 426 => 'Upgrade Required',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 510 => 'Not Extended'\n ];\n }\n if (isset ($output_header_to_desc [ $code ])) {\n return $output_header_to_desc [ $code ];\n } else {\n return '';\n }\n}", "public function httpCode($code=null){\n\t\t// FIXME: this doesn't take care to differentiate which codes are\n\t\t// in HTTP/1.0 vs HTTP/1.1; should it?\n\t\t$phrases = array(\n\t\t\t100 => \"Continue\",\n\t\t\t101 => \"Switching Protocols\",\n\n\t\t\t200 => \"OK\",\n\t\t\t201 => \"Created\",\n\t\t\t202 => \"Accepted\",\n\t\t\t203 => \"Non-Authoritative Information\",\n\t\t\t204 => \"No Content\",\n\t\t\t205 => \"Reset Content\",\n\t\t\t206 => \"Partial Content\",\n\n\t\t\t300 => \"Multiple Choices\", // useful for disambiguation?\n\t\t\t301 => \"Moved Permanently\",\n\t\t\t302 => \"Found\",\n\t\t\t303 => \"See Other\",\n\t\t\t304 => \"Not Modified\",\n\t\t\t305 => \"Use Proxy\",\n\t\t\t307 => \"Temporary Redirect\",\n\n\t\t\t400 => \"Bad Request\",\n\t\t\t401 => \"Unauthorized\", // use when auth'ing will make a request valid\n\t\t\t403 => \"Forbidden\", // use when auth'ing won't make a difference\n\t\t\t404 => \"Not Found\",\n\t\t\t405 => \"Method Not Allowed\", // HTTP method, e.g. using GET when only POST is valid\n\t\t\t406 => \"Not Acceptable\",\n\t\t\t407 => \"Proxy Authentication Required\",\n\t\t\t408 => \"Request Timeout\",\n\t\t\t409 => \"Conflict\",\n\t\t\t410 => \"Gone\", // something existed but was intentionally removed\n\t\t\t411 => \"Length Required\",\n\t\t\t412 => \"Precondition Failed\",\n\t\t\t413 => \"Request Entity Too Large\",\n\t\t\t414 => \"Request-URI Too Long\",\n\t\t\t415 => \"Unsupported Media Type\",\n\t\t\t416 => \"Requested Range Not Satisfiable\",\n\t\t\t417 => \"Expectation Failed\",\n\n\t\t\t500 => \"Internal Server Error\",\n\t\t\t501 => \"Not Implemented\",\n\t\t\t502 => \"Bad Gateway\",\n\t\t\t503 => \"Service Unavailable\",\n\t\t\t504 => \"Gateway Timeout\",\n\t\t);\n\n\t\tif(!is_null($code)){\n\t\t\tif(!array_key_exists($code, $phrases)){\n\t\t\t\t$code = 404;\n\t\t\t}\n\t\t\theader(\"HTTP/1.1 $code {$phrases[$code]}\");\n\t\t\t$this->httpResponseCode = $code;\n\t\t}\n\n\t\treturn \"HTTP/1.1 $this->httpResponseCode {$phrases[$this->httpResponseCode]}\";\n\t}", "function httpStatusMessage ( $status )\n {\n # rfc2616-sec10\n $messages = array(\n // [Informational 1xx]\n 100=>'100 Continue',\n 101=>'101 Switching Protocols',\n // [Successful 2xx]\n 200=>'200 OK',\n 201=>'201 Created',\n 202=>'202 Accepted',\n 203=>'203 Non-Authoritative Information',\n 204=>'204 No Content',\n 205=>'205 Reset Content',\n 206=>'206 Partial Content',\n // [Redirection 3xx]\n 300=>'300 Multiple Choices',\n 301=>'301 Moved Permanently',\n 302=>'302 Found',\n 303=>'303 See Other',\n 304=>'304 Not Modified',\n 305=>'305 Use Proxy',\n 306=>'306 (Unused)',\n 307=>'307 Temporary Redirect',\n // [Client Error 4xx]\n 400=>'400 Bad Request',\n 401=>'401 Unauthorized',\n 402=>'402 Payment Required',\n 403=>'403 Forbidden',\n 404=>'404 Not Found',\n 405=>'405 Method Not Allowed',\n 406=>'406 Not Acceptable',\n 407=>'407 Proxy Authentication Required',\n 408=>'408 Request Timeout',\n 409=>'409 Conflict',\n 410=>'410 Gone',\n 411=>'411 Length Required',\n 412=>'412 Precondition Failed',\n 413=>'413 Request Entity Too Large',\n 414=>'414 Request-URI Too Long',\n 415=>'415 Unsupported Media Type',\n 416=>'416 Requested Range Not Satisfiable',\n 417=>'417 Expectation Failed',\n // [Server Error 5xx]\n 500=>'500 Internal Server Error',\n 501=>'501 Not Implemented',\n 502=>'502 Bad Gateway',\n 503=>'503 Service Unavailable',\n 504=>'504 Gateway Timeout',\n 505=>'505 HTTP Version Not Supported'\n );\n return isset($messages[$status])? $messages[$status] : null;\n }", "function getResponseCodeMessage($code) {\n $code = is_string($code) ? intval($code) : $code;\n switch ($code) {\n case 100: $text = 'Continue';\n break;\n case 101: $text = 'Switching Protocols';\n break;\n case 200: $text = 'OK';\n break;\n case 201: $text = 'Created';\n break;\n case 202: $text = 'Accepted';\n break;\n case 203: $text = 'Non-Authoritative Information';\n break;\n case 204: $text = 'No Content';\n break;\n case 205: $text = 'Reset Content';\n break;\n case 206: $text = 'Partial Content';\n break;\n case 300: $text = 'Multiple Choices';\n break;\n case 301: $text = 'Moved Permanently';\n break;\n case 302: $text = 'Moved Temporarily';\n break;\n case 303: $text = 'See Other';\n break;\n case 304: $text = 'Not Modified';\n break;\n case 305: $text = 'Use Proxy';\n break;\n case 400: $text = 'Bad Request';\n break;\n case 401: $text = 'Unauthorized';\n break;\n case 402: $text = 'Payment Required';\n break;\n case 403: $text = 'Forbidden';\n break;\n case 404: $text = 'Not Found';\n break;\n case 405: $text = 'Method Not Allowed';\n break;\n case 406: $text = 'Not Acceptable';\n break;\n case 407: $text = 'Proxy Authentication Required';\n break;\n case 408: $text = 'Request Time-out';\n break;\n case 409: $text = 'Conflict';\n break;\n case 410: $text = 'Gone';\n break;\n case 411: $text = 'Length Required';\n break;\n case 412: $text = 'Precondition Failed';\n break;\n case 413: $text = 'Request Entity Too Large';\n break;\n case 414: $text = 'Request-URI Too Large';\n break;\n case 415: $text = 'Unsupported Media Type';\n break;\n case 500: $text = 'Internal Server Error';\n break;\n case 501: $text = 'Not Implemented';\n break;\n case 502: $text = 'Bad Gateway';\n break;\n case 503: $text = 'Service Unavailable';\n break;\n case 504: $text = 'Gateway Time-out';\n break;\n case 505: $text = 'HTTP Version not supported';\n break;\n default:\n $text = \"Unknown http status code\";\n break;\n }\n return $text;\n}", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}", "protected static function getError(int $code): array {\r\n $message = '';\r\n switch ($code) {\r\n case self::PARSE_ERROR:\r\n $message = 'Parse error';\r\n break;\r\n case self::INVALID_REQUEST:\r\n $message = 'Invalid request';\r\n break;\r\n case self::METHOD_NOT_FOUND:\r\n $message = 'Method not found';\r\n break;\r\n case self::INVALID_PARAMS:\r\n $message = 'Invalid params';\r\n break;\r\n case self::INTERNAL_ERROR:\r\n $message = 'Internal error';\r\n break;\r\n }\r\n \r\n return ['code' => $code, 'message' => $message];\r\n }", "public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }", "protected function getHTTPResponceTextByCode($code) {\n $text = '';\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default: break;\n }\n return $text;\n }", "function http_translate_code( $code ) {\n\t\t// Check the given parameters\n\t\tif( ! is_int( $code ) ) {\n\t\t\tthrow new \\InvalidArgumentException( 'Status is expected to be an integer.' );\n\t\t}\n\t\t// Return the string matching the given code.\n\t\tswitch( $code ) {\n\t\t\tcase 100: return 'Continue'; break;\n\t\t\tcase 101: return 'Switching Protocols'; break;\n\t\t\tcase 200: return 'OK'; break;\n\t\t\tcase 201: return 'Created'; break;\n\t\t\tcase 202: return 'Accepted'; break;\n\t\t\tcase 203: return 'Non-Authoritative Information'; break;\n\t\t\tcase 204: return 'No Content'; break;\n\t\t\tcase 205: return 'Reset Content'; break;\n\t\t\tcase 206: return 'Partial Content'; break;\n\t\t\tcase 300: return 'Multiple Choices'; break;\n\t\t\tcase 301: return 'Moved Permanently'; break;\n\t\t\tcase 302: return 'Moved Temporarily'; break;\n\t\t\tcase 303: return 'See Other'; break;\n\t\t\tcase 304: return 'Not Modified'; break;\n\t\t\tcase 305: return 'Use Proxy'; break;\n\t\t\tcase 400: return 'Bad Request'; break;\n\t\t\tcase 401: return 'Unauthorized'; break;\n\t\t\tcase 402: return 'Payment Required'; break;\n\t\t\tcase 403: return 'Forbidden'; break;\n\t\t\tcase 404: return 'Not Found'; break;\n\t\t\tcase 405: return 'Method Not Allowed'; break;\n\t\t\tcase 406: return 'Not Acceptable'; break;\n\t\t\tcase 407: return 'Proxy Authentication Required'; break;\n\t\t\tcase 408: return 'Request Time-out'; break;\n\t\t\tcase 409: return 'Conflict'; break;\n\t\t\tcase 410: return 'Gone'; break;\n\t\t\tcase 411: return 'Length Required'; break;\n\t\t\tcase 412: return 'Precondition Failed'; break;\n\t\t\tcase 413: return 'Request Entity Too Large'; break;\n\t\t\tcase 414: return 'Request-URI Too Large'; break;\n\t\t\tcase 415: return 'Unsupported Media Type'; break;\n\t\t\tcase 500: return 'Internal Server Error'; break;\n\t\t\tcase 501: return 'Not Implemented'; break;\n\t\t\tcase 502: return 'Bad Gateway'; break;\n\t\t\tcase 503: return 'Service Unavailable'; break;\n\t\t\tcase 504: return 'Gateway Time-out'; break;\n\t\t\tcase 505: return 'HTTP Version not supported'; break;\n\t\t}\n\t\t// Default is null\n\t\treturn null;\n\t}", "public function get_error_codes()\n {\n }", "function type_http_code($http_code){\n /* Check and return the type of this HTTP code */\n switch($http_code){\n case 300: return \"Multiple Choices\";\n case 301: return \"Moved Permanently\";\n case 302: return \"Found\";\n case 303: return \"See Other\";\n case 304: return \"Not Modified\";\n case 306: return \"Switch Proxy\";\n case 307: return \"Temporary Redirect\";\n case 308: return \"Permanent Redirect\";\n case 400: return \"Bad Request\";\n case 401: return \"Unauthorized\";\n case 402: return \"Payment Required\";\n case 403: return \"Forbidden\";\n case 404: return \"Not Found\";\n case 405: return \"Method Not Allowed\";\n case 406: return \"Not Acceptable\";\n case 407: return \"Proxy Authentication Required\";\n case 408: return \"Request Timeout\";\n case 409: return \"Conflict\";\n case 410: return \"Gone\";\n case 411: return \"Length Required\";\n case 412: return \"Precondition Failed\";\n case 413: return \"Request Entity Too Large\";\n case 414: return \"Request-URI Too Long\";\n case 415: return \"Unsupported Media Type\";\n case 416: return \"Requested Range Not Satisfiable\";\n case 417: return \"Expectation Failed\";\n case 418: return \"I'm a teapot\";\n case 419: return \"Authentication Timeout\";\n case 420: return \"Method Failure\";\n case 420: return \"Enhance Your Calm\";\n case 422: return \"Unprocessable Entity\";\n case 423: return \"Locked\";\n case 424: return \"Failed Dependency\";\n case 425: return \"Unordered Collection\";\n case 426: return \"Upgrade Required\";\n case 428: return \"Precondition Required\";\n case 429: return \"Too Many Requests\";\n case 431: return \"Request Header Fields Too Large\";\n case 440: return \"Login Timeout\";\n case 444: return \"No Response\";\n case 449: return \"Retry With\";\n case 450: return \"Blocked by Windows Parental Controls\";\n case 451: return \"Unavailable For Legal Reasons\";\n case 451: return \"Redirect\";\n case 494: return \"Request Header Too Large\";\n case 495: return \"Cert Error\";\n case 496: return \"No Cert\";\n case 497: return \"HTTP to HTTPS\";\n case 499: return \"Client Closed Request\";\n case 500: return \"Internal Server Error\";\n case 501: return \"Not Implemented\";\n case 502: return \"Bad Gateway\";\n case 503: return \"Service Unavailable\";\n case 504: return \"Gateway Timeout\";\n case 505: return \"HTTP Version Not Supported\";\n case 506: return \"Variant Also Negotiates\";\n case 507: return \"Insufficient Storage\";\n case 508: return \"Loop Detected\";\n case 509: return \"Bandwidth Limit Exceeded\";\n case 510: return \"Not Extended\";\n case 511: return \"Network Authentication Required\";\n case 520: return \"Origin Error\";\n case 521: return \"Web server is down\";\n case 522: return \"Connection timed out\";\n case 523: return \"Proxy Declined Request\";\n case 524: return \"A timeout occurred\";\n case 598: return \"Network read timeout error\";\n case 599: return \"Network connect timeout error\";\n default: return \"UNKNOWN ERROR!\";\n }\n}", "public static function error()\n {\n return [\n 'code' => JsonResponse::HTTP_INTERNAL_SERVER_ERROR,\n 'status' => 'error',\n 'message' => 'Oops, something went wrong.'\n ];\n }", "public static function http_code( $code = null ) {\n\t\t// -- Check if a status code was defined\n\t\tif( $code !== null ) {\n\n\t\t\t// -- Get the proper HTTP status code\n\t\t\tswitch( $code ) {\n\t\t\t\tcase 100: $text = 'Continue'; break;\n\t\t\t\tcase 101: $text = 'Switching Protocols'; break;\n\t\t\t\tcase 200: $text = 'OK'; break;\n\t\t\t\tcase 201: $text = 'Created'; break;\n\t\t\t\tcase 202: $text = 'Accepted'; break;\n\t\t\t\tcase 203: $text = 'Non-Authoritative Information'; break;\n\t\t\t\tcase 204: $text = 'No Content'; break;\n\t\t\t\tcase 205: $text = 'Reset Content'; break;\n\t\t\t\tcase 206: $text = 'Partial Content'; break;\n\t\t\t\tcase 300: $text = 'Multiple Choices'; break;\n\t\t\t\tcase 301: $text = 'Moved Permanently'; break;\n\t\t\t\tcase 302: $text = 'Moved Temporarily'; break;\n\t\t\t\tcase 303: $text = 'See Other'; break;\n\t\t\t\tcase 304: $text = 'Not Modified'; break;\n\t\t\t\tcase 305: $text = 'Use Proxy'; break;\n\t\t\t\tcase 400: $text = 'Bad Request'; break;\n\t\t\t\tcase 401: $text = 'Unauthorized'; break;\n\t\t\t\tcase 402: $text = 'Payment Required'; break;\n\t\t\t\tcase 403: $text = 'Forbidden'; break;\n\t\t\t\tcase 404: $text = 'Not Found'; break;\n\t\t\t\tcase 405: $text = 'Method Not Allowed'; break;\n\t\t\t\tcase 406: $text = 'Not Acceptable'; break;\n\t\t\t\tcase 407: $text = 'Proxy Authentication Required'; break;\n\t\t\t\tcase 408: $text = 'Request Time-out'; break;\n\t\t\t\tcase 409: $text = 'Conflict'; break;\n\t\t\t\tcase 410: $text = 'Gone'; break;\n\t\t\t\tcase 411: $text = 'Length Required'; break;\n\t\t\t\tcase 412: $text = 'Precondition Failed'; break;\n\t\t\t\tcase 413: $text = 'Request Entity Too Large'; break;\n\t\t\t\tcase 414: $text = 'Request-URI Too Large'; break;\n\t\t\t\tcase 415: $text = 'Unsupported Media Type'; break;\n\t\t\t\tcase 500: $text = 'Internal Server Error'; break;\n\t\t\t\tcase 501: $text = 'Not Implemented'; break;\n\t\t\t\tcase 502: $text = 'Bad Gateway'; break;\n\t\t\t\tcase 503: $text = 'Service Unavailable'; break;\n\t\t\t\tcase 504: $text = 'Gateway Time-out'; break;\n\t\t\t\tcase 505: $text = 'HTTP Version not supported'; break;\n\t\t\t\tdefault:\n\t\t\t\t\texit( 'Unknown http status code \"' . htmlentities( $code ) . '\"' );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$protocol = ( isset( $_SERVER[ 'SERVER_PROTOCOL' ] ) ? $_SERVER[ 'SERVER_PROTOCOL' ] : 'HTTP/1.0' );\n\n\t\t\theader($protocol . ' ' . $code . ' ' . $text);\n\n\t\t\t$GLOBALS[ 'http_response_code' ] = $code;\n\n\t\t} else {\n\t\t\t$code = ( isset( $GLOBALS[ 'http_response_code' ] ) ? $GLOBALS[ 'http_response_code' ] : 200 );\n\t\t}\n\n\t\treturn $code;\n\t}", "public function getMessage() {\n\n\t\t\tswitch($this->getCode()) {\n\t\t\t\tcase 100: return 'Continue';\n\t\t\t\tcase 101: return 'Switching Protocols';\n\t\t\t\tcase 102: return 'Processing';\n\t\t\t\tcase 200: return 'OK';\n\t\t\t\tcase 201: return 'Created';\n\t\t\t\tcase 202: return 'Accepted';\n\t\t\t\tcase 203: return 'Non-Authoritative Information';\n\t\t\t\tcase 204: return 'No Content';\n\t\t\t\tcase 205: return 'Reset Content';\n\t\t\t\tcase 206: return 'Partial Content';\n\t\t\t\tcase 207: return 'Multi-Status';\n\t\t\t\tcase 208: return 'Already Reported';\n\t\t\t\tcase 226: return 'IM Used';\n\t\t\t\tcase 300: return 'Multiple Choices';\n\t\t\t\tcase 301: return 'Moved Permanently';\n\t\t\t\tcase 302: return 'Found';\n\t\t\t\tcase 303: return 'See Other';\n\t\t\t\tcase 304: return 'Not Modified';\n\t\t\t\tcase 305: return 'Use Proxy';\n\t\t\t\tcase 306: return 'Switch Proxy';\n\t\t\t\tcase 307: return 'Temporary Redirect';\n\t\t\t\tcase 308: return 'Permanent Redirect';\n\t\t\t\tcase 400: return 'Bad Request';\n\t\t\t\tcase 401: return 'Unauthorized';\n\t\t\t\tcase 402: return 'Payment Required';\n\t\t\t\tcase 403: return 'Forbidden';\n\t\t\t\tcase 404: return 'Not Found';\n\t\t\t\tcase 405: return 'Method Not Allowed';\n\t\t\t\tcase 406: return 'Not Acceptable';\n\t\t\t\tcase 407: return 'Proxy Authentication Required';\n\t\t\t\tcase 408: return 'Request Timeout';\n\t\t\t\tcase 409: return 'Conflict';\n\t\t\t\tcase 410: return 'Gone';\n\t\t\t\tcase 411: return 'Length Required';\n\t\t\t\tcase 412: return 'Precondition Failed';\n\t\t\t\tcase 413: return 'Request Entity Too Large';\n\t\t\t\tcase 414: return 'Request-URI Too Long';\n\t\t\t\tcase 415: return 'Unsupported Media Type';\n\t\t\t\tcase 416: return 'Requested Range Not Satisfiable';\n\t\t\t\tcase 417: return 'Expectation Failed';\n\t\t\t\tcase 418: return 'I\\'m a teapot';\n\t\t\t\tcase 419: return 'Authentication Timeout';\n\t\t\t\tcase 420: return 'Enhance Your Calm';\n\t\t\t\tcase 420: return 'Method Failure';\n\t\t\t\tcase 422: return 'Unprocessable Entity';\n\t\t\t\tcase 423: return 'Locked';\n\t\t\t\tcase 424: return 'Failed Dependency';\n\t\t\t\tcase 424: return 'Method Failure';\n\t\t\t\tcase 425: return 'Unordered Collection';\n\t\t\t\tcase 426: return 'Upgrade Required';\n\t\t\t\tcase 428: return 'Precondition Required';\n\t\t\t\tcase 429: return 'Too Many Requests';\n\t\t\t\tcase 431: return 'Request Header Fields Too Large';\n\t\t\t\tcase 444: return 'No Response';\n\t\t\t\tcase 449: return 'Retry With';\n\t\t\t\tcase 450: return 'Blocked by Windows Parental Controls';\n\t\t\t\tcase 451: return 'Redirect';\n\t\t\t\tcase 451: return 'Unavailable For Legal Reasons';\n\t\t\t\tcase 494: return 'Request Header Too Large';\n\t\t\t\tcase 495: return 'Cert Error';\n\t\t\t\tcase 496: return 'No Cert';\n\t\t\t\tcase 497: return 'HTTP to HTTPS';\n\t\t\t\tcase 499: return 'Client Closed Request';\n\t\t\t\tcase 500: return 'Internal Server Error';\n\t\t\t\tcase 501: return 'Not Implemented';\n\t\t\t\tcase 502: return 'Bad Gateway';\n\t\t\t\tcase 503: return 'Service Unavailable';\n\t\t\t\tcase 504: return 'Gateway Timeout';\n\t\t\t\tcase 506: return 'Variant Also Negotiates';\n\t\t\t\tcase 507: return 'Insufficient Storage';\n\t\t\t\tcase 508: return 'Loop Detected';\n\t\t\t\tcase 509: return 'Bandwidth Limit Exceeded';\n\t\t\t\tcase 510: return 'Not Extended';\n\t\t\t\tcase 511: return 'Network Authentication Required';\n\t\t\t\tcase 598: return 'Network read timeout error';\n\t\t\t\tcase 599: return 'Network connect timeout error';\n\t\t\t\tdefault: return 'Unknown Response';\n\t\t\t}\n\n\t\t}", "public function dataStatusCodeMessages()\n {\n return array(\n array(100, 'Continue'),\n array(101, 'Switching Protocols'),\n array(200, 'OK'),\n array(201, 'Created'),\n array(202, 'Accepted'),\n array(203, 'Non-Authoritative Information'),\n array(204, 'No Content'),\n array(205, 'Reset Content'),\n array(206, 'Partial Content'),\n array(300, 'Multiple Choices'),\n array(301, 'Moved Permanently'),\n array(302, 'Found'),\n array(303, 'See Other'),\n array(304, 'Not Modified'),\n array(305, 'Use Proxy'),\n array(307, 'Temporary Redirect'),\n array(400, 'Bad Request'),\n array(401, 'Unauthorized'),\n array(402, 'Payment Required'),\n array(403, 'Forbidden'),\n array(404, 'Not Found'),\n array(405, 'Method Not Allowed'),\n array(406, 'Not Acceptable'),\n array(407, 'Proxy Authentication Required'),\n array(408, 'Request Timeout'),\n array(409, 'Conflict'),\n array(410, 'Gone'),\n array(411, 'Length Required'),\n array(412, 'Precondition Failed'),\n array(413, 'Request Entity Too Large'),\n array(414, 'Request-URI Too Long'),\n array(415, 'Unsupported Media Type'),\n array(416, 'Requested Range Not Satisfiable'),\n array(417, 'Expectation Failed'),\n array(500, 'Internal Server Error'),\n array(501, 'Not Implemented'),\n array(502, 'Bad Gateway'),\n array(503, 'Service Unavailable'),\n\n // Edge cases...\n array('foo', null),\n array(null, null),\n array(1, null),\n array(600, null),\n array(460, null),\n array(10, null),\n );\n }", "static function Response($code) {\n\t\treturn 'HTTP/' . Http::VERSION . ' ' . Http::$codes[$code];\n\t}", "private function _getStatusCodeMessage($status)\n{\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 200 => 'OK',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 500 => 'Internal Server Error',\n\n 501 => 'Not Implemented',\n );\n return (isset($codes[$status])) ? $codes[$status] : '';\n}", "public function getStatusMessage($statusCode)\n {\n switch ($statusCode) {\n case 100:\n return 'Continue';\n case 101:\n return 'Switching Protocols';\n case 200:\n return 'OK';\n case 201:\n return 'Created';\n case 202:\n return 'Accepted';\n case 203:\n return 'Non-Authoritative Information';\n case 204:\n return 'No Content';\n case 205:\n return 'Reset Content';\n case 206:\n return 'Partial Content';\n case 300:\n return 'Multiple Choices';\n case 301:\n return 'Moved Permanently';\n case 302:\n return 'Found';\n case 303:\n return 'See Other';\n case 304:\n return 'Not Modified';\n case 305:\n return 'Use Proxy';\n case 306:\n return '(Unused)';\n case 307:\n return 'Temporary Redirect';\n case 400:\n return 'Bad Request';\n case 401:\n return 'Unauthorized';\n case 402:\n return 'Payment Required';\n case 403:\n return 'Forbidden';\n case 404:\n return 'Not found';\n case 405:\n return 'Method Not Allowed';\n case 406:\n return 'Not Acceptable';\n case 407:\n return 'Proxy Authentication Required';\n case 408:\n return 'Request Timeout';\n case 409:\n return 'Conflict';\n case 410:\n return 'Gone';\n case 411:\n return 'Length Required';\n case 412:\n return 'Precondition Failed';\n case 413:\n return 'Request Entity Too Large';\n case 414:\n return 'Request-URI Too Long';\n case 415:\n return 'Unsupported Media Type';\n case 416:\n return 'Requested Range Not Satisfiable';\n case 417:\n return 'Expectation Failed';\n case 500:\n return 'Internal Server Error';\n case 501:\n return 'Not Implemented';\n case 502:\n return 'Bad Gateway';\n case 503:\n return 'Service Unavailable';\n case 504:\n return 'Gateway Timeout';\n case 505:\n return 'HTTP Version Not Supported';\n default:\n return '';\n }\n }", "static function send_http_status($code) {\n\t\tstatic $_status = array(\n\t\t// Informational 1xx\n\t\t100 => 'Continue',\n\t\t101 => 'Switching Protocols',\n\n\t\t// Success 2xx\n\t\t200 => 'OK',\n\t\t201 => 'Created',\n\t\t202 => 'Accepted',\n\t\t203 => 'Non-Authoritative Information',\n\t\t204 => 'No Content',\n\t\t205 => 'Reset Content',\n\t\t206 => 'Partial Content',\n\n\t\t// Redirection 3xx\n\t\t300 => 'Multiple Choices',\n\t\t301 => 'Moved Permanently',\n\t\t302 => 'Found', // 1.1\n\t\t303 => 'See Other',\n\t\t304 => 'Not Modified',\n\t\t305 => 'Use Proxy',\n\t\t// 306 is deprecated but reserved\n\t\t307 => 'Temporary Redirect',\n\n\t\t// Client Error 4xx\n\t\t400 => 'Bad Request',\n\t\t401 => 'Unauthorized',\n\t\t402 => 'Payment Required',\n\t\t403 => 'Forbidden',\n\t\t404 => 'Not Found',\n\t\t405 => 'Method Not Allowed',\n\t\t406 => 'Not Acceptable',\n\t\t407 => 'Proxy Authentication Required',\n\t\t408 => 'Request Timeout',\n\t\t409 => 'Conflict',\n\t\t410 => 'Gone',\n\t\t411 => 'Length Required',\n\t\t412 => 'Precondition Failed',\n\t\t413 => 'Request Entity Too Large',\n\t\t414 => 'Request-URI Too Long',\n\t\t415 => 'Unsupported Media Type',\n\t\t416 => 'Requested Range Not Satisfiable',\n\t\t417 => 'Expectation Failed',\n\n\t\t// Server Error 5xx\n\t\t500 => 'Internal Server Error',\n\t\t501 => 'Not Implemented',\n\t\t502 => 'Bad Gateway',\n\t\t503 => 'Service Unavailable',\n\t\t504 => 'Gateway Timeout',\n\t\t505 => 'HTTP Version Not Supported',\n\t\t509 => 'Bandwidth Limit Exceeded'\n\t\t);\n\t\tif(array_key_exists($code,$_status)) {\n\t\t\theader('HTTP/1.1 '.$code.' '.$_status[$code]);\n\t\t}\n\t}", "public function getErrorMessageByCode($code): string\n {\n switch ($code) {\n case 400:\n {\n return 'Requisição Mal Formada';\n }\n case 401:\n {\n return 'Usuário não autorizado';\n }\n case 403:\n {\n return 'Acesso não autorizado';\n }\n case 404:\n {\n return 'Recurso não Encontrado';\n }\n case 405:\n {\n return 'Operação não suportada';\n }\n case 408:\n {\n return 'Tempo esgotado para a requisição';\n }\n case 409:\n {\n return 'Recurso em conflito';\n }\n case 413:\n {\n return 'Requisição excede o tamanho máximo permitido';\n }\n case 415:\n {\n return 'Content-type inválido';\n }\n case 422:\n {\n return 'Não foi possível processar as instruções contidas na requisição';\n }\n case 429:\n {\n return 'Requisição excede a quantidade máxima de chamadas permitidas à API.';\n }\n case 500:\n {\n return 'Erro na API';\n }\n }\n }", "public function httpStatusDataProvider()\n {\n return [\n [\"badGateway\", 502, \"Bad gateway\"],\n [\"badRequest\", 400, \"Bad request\"],\n [\"conflict\", 409, \"Conflict\"],\n [\"expectationFailed\", 417, \"Expectation failed\"],\n [\"forbidden\", 403, \"Forbidden\"],\n [\"gatewayTimeout\", 504, \"Gateway timeout\"],\n [\"gone\", 410, \"Gone\"],\n [\"httpVersionNotSupported\", 505, \"Http version not supported\"],\n [\"internalServerError\", 500, \"Internal server error\"],\n [\"lengthRequired\", 411, \"Length required\"],\n [\"methodNotAllowed\", 405, \"Method not allowed\"],\n [\"notAcceptable\", 406, \"Not acceptable\"],\n [\"notFound\", 404, \"Not found\"]\n // TODO: Add the remaining status codes.\n ];\n }", "private function http_status_code_string($code, $include_code = false)\n {\n switch ($code) {\n // 1xx Informational\n case 100:\n $string = 'Continue';\n break;\n case 101:\n $string = 'Switching Protocols';\n break;\n case 102:\n $string = 'Processing';\n break; // WebDAV\n case 122:\n $string = 'Request-URI too long';\n break; // Microsoft\n\n // 2xx Success\n case 200:\n $string = 'OK';\n break;\n case 201:\n $string = 'Created';\n break;\n case 202:\n $string = 'Accepted';\n break;\n case 203:\n $string = 'Non-Authoritative Information';\n break; // HTTP/1.1\n case 204:\n $string = 'No Content';\n break;\n case 205:\n $string = 'Reset Content';\n break;\n case 206:\n $string = 'Partial Content';\n break;\n case 207:\n $string = 'Multi-Status';\n break; // WebDAV\n\n // 3xx Redirection\n case 300:\n $string = 'Multiple Choices';\n break;\n case 301:\n $string = 'Moved Permanently';\n break;\n case 302:\n $string = 'Found';\n break;\n case 303:\n $string = 'See Other';\n break; //HTTP/1.1\n case 304:\n $string = 'Not Modified';\n break;\n case 305:\n $string = 'Use Proxy';\n break; // HTTP/1.1\n case 306:\n $string = 'Switch Proxy';\n break; // Depreciated\n case 307:\n $string = 'Temporary Redirect';\n break; // HTTP/1.1\n\n // 4xx Client Error\n case 400:\n $string = 'Bad Request';\n break;\n case 401:\n $string = 'Unauthorized';\n break;\n case 402:\n $string = 'Payment Required';\n break;\n case 403:\n $string = 'Forbidden';\n break;\n case 404:\n $string = 'Not Found';\n break;\n case 405:\n $string = 'Method Not Allowed';\n break;\n case 406:\n $string = 'Not Acceptable';\n break;\n case 407:\n $string = 'Proxy Authentication Required';\n break;\n case 408:\n $string = 'Request Timeout';\n break;\n case 409:\n $string = 'Conflict';\n break;\n case 410:\n $string = 'Gone';\n break;\n case 411:\n $string = 'Length Required';\n break;\n case 412:\n $string = 'Precondition Failed';\n break;\n case 413:\n $string = 'Request Entity Too Large';\n break;\n case 414:\n $string = 'Request-URI Too Long';\n break;\n case 415:\n $string = 'Unsupported Media Type';\n break;\n case 416:\n $string = 'Requested Range Not Satisfiable';\n break;\n case 417:\n $string = 'Expectation Failed';\n break;\n case 422:\n $string = 'Unprocessable Entity';\n break; // WebDAV\n case 423:\n $string = 'Locked';\n break; // WebDAV\n case 424:\n $string = 'Failed Dependency';\n break; // WebDAV\n case 425:\n $string = 'Unordered Collection';\n break; // WebDAV\n case 426:\n $string = 'Upgrade Required';\n break;\n case 449:\n $string = 'Retry With';\n break; // Microsoft\n case 450:\n $string = 'Blocked';\n break; // Microsoft\n\n // 5xx Server Error\n case 500:\n $string = 'Internal Server Error';\n break;\n case 501:\n $string = 'Not Implemented';\n break;\n case 502:\n $string = 'Bad Gateway';\n break;\n case 503:\n $string = 'Service Unavailable';\n break;\n case 504:\n $string = 'Gateway Timeout';\n break;\n case 505:\n $string = 'HTTP Version Not Supported';\n break;\n case 506:\n $string = 'Variant Also Negotiates';\n break;\n case 507:\n $string = 'Insufficient Storage';\n break; // WebDAV\n case 509:\n $string = 'Bandwidth Limit Exceeded';\n break; // Apache\n case 510:\n $string = 'Not Extended';\n break;\n\n // Unknown code:\n default:\n $string = 'Unknown';\n break;\n }\n if ($include_code)\n return $code . ' ' . $string;\n return $string;\n }", "function get_reason($status) {\n $reason = array(\n 100 => 'Continue', 'Switching Protocols',\n 200 => 'OK', 'Created', 'Accepted', 'Non-Authoritative Information',\n 'No Content', 'Reset Content', 'Partial Content',\n 300 => 'Multiple Choices', 'Moved Permanently', 'Found', 'See Other',\n 'Not Modified', 'Use Proxy', '(Unused)', 'Temporary Redirect',\n 400 => 'Bad Request', 'Unauthorized', 'Payment Required','Forbidden',\n 'Not Found', 'Method Not Allowed', 'Not Acceptable',\n 'Proxy Authentication Required', 'Request Timeout', 'Conflict',\n 'Gone', 'Length Required', 'Precondition Failed',\n 'Request Entity Too Large', 'Request-URI Too Long',\n 'Unsupported Media Type', 'Requested Range Not Satisfiable',\n 'Expectation Failed',\n 500 => 'Internal Server Error', 'Not Implemented', 'Bad Gateway',\n 'Service Unavailable', 'Gateway Timeout',\n 'HTTP Version Not Supported');\n\n return isset($reason[$status]) ? $reason[$status] : '';\n }", "public function errorInfo()\n {\n if ($this->error !== false) {\n return ['HY000', $this->error['code'], $this->error['message']];\n }\n\n return ['00000', null, null];\n }", "function getStatusCode();", "public static function type( $code ) {\n\t\t// -- Get the proper message based on HTTP status code\n\t\tswitch( $code ) {\n\t\t\tcase Error::$not_found: \n\t\t\t\treturn Error::missing(); \n\t\t\tbreak;\n\n\t\t\tcase Error::$internal: \n\t\t\t\treturn Error::internal(); \n\t\t\tbreak;\n\t\t}\n\t}", "private static function _getStatusCodeMessage($status)\n {\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n return (isset($codes[$status])) ? $codes[$status] : '';\n }", "public function getErrorCode();", "function wspra_get_status_message($code=200){\n $status = array(\n 100 => 'Continue', \n 101 => 'Switching Protocols', \n 200 => 'OK',\n 201 => 'Created', \n 202 => 'Accepted', \n 203 => 'Non-Authoritative Information', \n 204 => 'No Content', \n 205 => 'Reset Content', \n 206 => 'Partial Content', \n 300 => 'Multiple Choices', \n 301 => 'Moved Permanently', \n 302 => 'Found', \n 303 => 'See Other', \n 304 => 'Not Modified', \n 305 => 'Use Proxy', \n 306 => '(Unused)', \n 307 => 'Temporary Redirect', \n 400 => 'Bad Request', \n 401 => 'Unauthorized', \n 402 => 'Payment Required', \n 403 => 'Forbidden', \n 404 => 'Not Found', \n 405 => 'Method Not Allowed', \n 406 => 'Not Acceptable', \n 407 => 'Proxy Authentication Required', \n 408 => 'Request Timeout', \n 409 => 'Conflict', \n 410 => 'Gone', \n 411 => 'Length Required', \n 412 => 'Precondition Failed', \n 413 => 'Request Entity Too Large', \n 414 => 'Request-URI Too Long', \n 415 => 'Unsupported Media Type', \n 416 => 'Requested Range Not Satisfiable', \n 417 => 'Expectation Failed', \n 500 => 'Internal Server Error', \n 501 => 'Not Implemented', \n 502 => 'Bad Gateway', \n 503 => 'Service Unavailable', \n 504 => 'Gateway Timeout', \n 505 => 'HTTP Version Not Supported',\n 1001 => 'Parameters required!',\n 1002 => 'No Results Found'\n );\n return $status[$code];\n}", "function HttpStatus($code) {\n $status = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 400 => 'Bad Request',\n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error');\n\n // If anything else, return 500\n return $status[$code] ? $status[$code] : $status[500];\n}", "public function getReasonPhrase(): string\n {\n return StatusCode::MESSAGES_MAP[$this->status];\n }", "public function _getStatusCodeMessage($status) {\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Oops! Something has gone wrong and the page you were looking for could not be found! Try the <a href=\"\" class=\"color-blue\">home page.</a>',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => \"We're sorry because something went wrong, please try again!\",\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n );\n return (isset($codes[$status])) ? $codes[$status] : 'Unknown Result';\n }", "function error($code, $desc) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code);\r\n if(strtoupper($_SERVER['REQUEST_METHOD']) != 'HEAD') {\r\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\r\n echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">'.\"\\n\";\r\n echo '<html xml:lang=\"en\" lang=\"en\">';\r\n echo '<head><title>' . $code . '</title></head><body><h1>' . $code . '</h1><p>' . $desc . '</p></body></html>';\r\n }\r\n exit;\r\n }", "function getHttpCode();", "final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }", "private function _getStatusCodeMessage($statusCode)\r\n {\r\n $codes = Array(\r\n 100 => 'Continue',\r\n 101 => 'Switching Protocols',\r\n 200 => 'OK',\r\n 201 => 'Created',\r\n 202 => 'Accepted',\r\n 203 => 'Non-Authoritative Information',\r\n 204 => 'No Content',\r\n 205 => 'Reset Content',\r\n 206 => 'Partial Content',\r\n 300 => 'Multiple Choices',\r\n 301 => 'Moved Permanently',\r\n 302 => 'Found',\r\n 303 => 'See Other',\r\n 304 => 'Not Modified',\r\n 305 => 'Use Proxy',\r\n 306 => '(Unused)',\r\n 307 => 'Temporary Redirect',\r\n 400 => 'Bad Request',\r\n 401 => 'Unauthorized',\r\n 402 => 'Payment Required',\r\n 403 => 'Forbidden',\r\n 404 => 'Not Found',\r\n 405 => 'Method Not Allowed',\r\n 406 => 'Not Acceptable',\r\n 407 => 'Proxy Authentication Required',\r\n 408 => 'Request Timeout',\r\n 409 => 'Conflict',\r\n 410 => 'Gone',\r\n 411 => 'Length Required',\r\n 412 => 'Precondition Failed',\r\n 413 => 'Request Entity Too Large',\r\n 414 => 'Request-URI Too Long',\r\n 415 => 'Unsupported Media Type',\r\n 416 => 'Requested Range Not Satisfiable',\r\n 417 => 'Expectation Failed',\r\n 500 => 'Internal Server Error',\r\n 501 => 'Not Implemented',\r\n 502 => 'Bad Gateway',\r\n 503 => 'Service Unavailable',\r\n 504 => 'Gateway Timeout',\r\n 505 => 'HTTP Version Not Supported'\r\n );\r\n\r\n return (isset($codes[$statusCode])) ? $codes[$statusCode] : '';\r\n }", "function status_header($code = 200) {\n $message = [\n 200 => \"OK\",\n 404 => \"Page not found\",\n 302 => \"Moved temporarily\",\n 303 => \"Something something\",\n 500 => \"Server error\"\n ];\n header(\"HTTP/1.0 \".$code.\" \".$message[$code]);\n}", "public static function getStatusCodeMessage($status)\n\t\t{\n\t\t\t// via parse_ini_file()... however, this will suffice\n\t\t\t// for an example\n\t\t\t$codes = Array(\n\t\t\t\t100 => 'Continue',\n\t\t\t\t101 => 'Switching Protocols',\n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created',\n\t\t\t\t202 => 'Accepted',\n\t\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t\t204 => 'No Content',\n\t\t\t\t205 => 'Reset Content',\n\t\t\t\t206 => 'Partial Content',\n\t\t\t\t300 => 'Multiple Choices',\n\t\t\t\t301 => 'Moved Permanently',\n\t\t\t\t302 => 'Found',\n\t\t\t\t303 => 'See Other',\n\t\t\t\t304 => 'Not Modified',\n\t\t\t\t305 => 'Use Proxy',\n\t\t\t\t306 => '(Unused)',\n\t\t\t\t307 => 'Temporary Redirect',\n\t\t\t\t400 => 'Bad Request',\n\t\t\t\t401 => 'Unauthorized',\n\t\t\t\t402 => 'Payment Required',\n\t\t\t\t403 => 'Forbidden',\n\t\t\t\t404 => 'Not Found',\n\t\t\t\t405 => 'Method Not Allowed',\n\t\t\t\t406 => 'Not Acceptable',\n\t\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t\t408 => 'Request Timeout',\n\t\t\t\t409 => 'Conflict',\n\t\t\t\t410 => 'Gone',\n\t\t\t\t411 => 'Length Required',\n\t\t\t\t412 => 'Precondition Failed',\n\t\t\t\t413 => 'Request Entity Too Large',\n\t\t\t\t414 => 'Request-URI Too Long',\n\t\t\t\t415 => 'Unsupported Media Type',\n\t\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t\t417 => 'Expectation Failed',\n\t\t\t\t500 => 'Internal Server Error',\n\t\t\t\t501 => 'Not Implemented',\n\t\t\t\t502 => 'Bad Gateway',\n\t\t\t\t503 => 'Service Unavailable',\n\t\t\t\t504 => 'Gateway Timeout',\n\t\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t\t600 => 'OK',\n\t\t\t\t601 => 'Bad request',\n\t\t\t\t602 => 'You must be authorized to view this page.',\n\t\t\t\t603 => 'The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found.',\n\t\t\t\t604 => 'The server encountered an error processing your request.',\n\t\t\t\t605 => 'The requested method is not implemented.',\n\t\t\t\t606 => 'You have exceeded api call limit for the hour',\n\t\t\t\t607 => 'You have exceeded api call limit for the day'\n\t\t\t);\n\t\n\t\t\treturn (isset($codes[$status])) ? $codes[$status] : '';\n\t\t}", "public function getHttpErrorCode()\n {\n return $this->httpErrorCode;\n }", "function status_header($code, $description = '')\n {\n }", "function getHTTPCode() {\n\n return 500;\n\n }", "function HTTPFailWithCode($code,$message)\n{\n\theader(reasonForCode($code));\n\texit($message);\n}", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "public function getErrorDesc()\n {\n return $this->errorDesc;\n }", "public function errorcode();", "private function getCodeMsg($code)\n\t{\n\t\t$codeMsg = [\n\t\t\t/* 100+ */\n\t\t\t100 => 'Continue', 101 => 'Switching Protocols',\n\n\t\t\t/* 200+ */\n\t\t\t200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',\n\n\t\t\t/* 300+ */\n\t\t\t300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n\t\t\t304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect',\n\n\t\t\t/* 400+ */\n\t\t\t400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden',\n\t\t\t404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone',\n\t\t\t411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t/* 500+ */\n\t\t\t500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported'\n\t\t];\n\n\t\treturn $codeMsg[$code];\n\t}", "public function getErrorDescription(): string\n {\n return $this->errorDescription;\n }", "private function __requestStatus( $code )\n {\n $status = array( \n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 402 => 'Request Limit Reached',\n 404 => 'Not Found', \n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n ); \n return ( $status[$code] ) ? $status[$code] : $status[500]; \n }", "function sendHttpStatus($code) \n {\n\t\tstatic $_status = array(\n\t\t\t// Informational 1xx\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\n\t\t\t// Success 2xx\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\n\t\t\t// Redirection 3xx\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found', // 1.1\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t// 306 is deprecated but reserved\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t// Client Error 4xx\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t// Server Error 5xx\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t509 => 'Bandwidth Limit Exceeded'\n\t\t);\n\t\tif(isset($_status[$code])) {\n\t\t\theader('HTTP/1.1 '.$code.' '.$_status[$code]);\n\t\t}\n\t}", "public static function getStatusCodeMessage($status)\n {\n// via parse_ini_file()... however, this will suffice\n// for an example\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n return (isset($codes[$status])) ? $codes[$status] : '';\n }", "public function getReasonPhrase(int $code): string\n {\n $code = $this->filterCode($code);\n\n if (!isset($this->values[$code])) {\n throw new OutOfBoundsException(sprintf(\"Unknown http status code: '%s'\", $code));\n }\n\n return $this->values[$code];\n }", "public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }", "public static function httpStatus($_code) {\n\t\tif (!defined('self::HTTP_'.$_code)) {\n\t\t\t// Invalid status code\n\t\t\tself::$global['CONTEXT']=$_code;\n\t\t\ttrigger_error(self::TEXT_HTTP);\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Get description\n\t\t$_response=constant('self::HTTP_'.$_code);\n\t\t// Send raw HTTP header\n\t\tif (PHP_SAPI!='cli' && !self::$global['QUIET'] && !headers_sent())\n\t\t\theader('HTTP/1.1 '.$_code.' '.$_response);\n\t\treturn $_response;\n\t}", "protected function info($code, $msg)\n {\n switch ($code) {\n case 400:\n $name = 'Bad Request';\n $message = 'The request cannot be fulfilled due to bad syntax.';\n break;\n case 401:\n $name = 'Unauthorized';\n $message = 'Authentication is required and has failed or has not yet been provided.';\n break;\n case 403:\n $name = 'Forbidden';\n $message = 'You have not permission!';\n break;\n case 404:\n $name = 'Not Found';\n $message = 'The requested resource could not be found but may be available again in the future.';\n break;\n case 405:\n $name = 'Method Not Allowed';\n $message = 'A request was made of a resource using a request method not supported by that resource.';\n break;\n case 406:\n $name = 'Not Acceptable';\n $message = 'The requested resource is only capable of generating content not acceptable.';\n break;\n case 409:\n $name = 'Conflict';\n $message = 'The request could not be processed because of conflict in the request.';\n break;\n case 410:\n $name = 'Gone';\n $message = 'The requested resource is no longer available and will not be available again.';\n break;\n case 411:\n $name = 'Length Required';\n $message = 'The request did not specify the length of its content, which is required by the requested resource.';\n break;\n case 412:\n $name = 'Precondition Failed';\n $message = 'The server does not meet one of the preconditions that the requester put on the request.';\n break;\n case 415:\n $name = 'Unsupported Media Type';\n $message = 'The request entity has a media type which the server or resource does not support.';\n break;\n case 422:\n $name = 'Unprocessable Entity';\n $message = 'The request was well-formed but was unable to be followed due to semantic errors.';\n break;\n case 428:\n $name = 'Precondition Required';\n $message = 'The origin server requires the request to be conditional.';\n break;\n case 429:\n $name = 'Too Many Requests';\n $message = 'The user has sent too many requests in a given amount of time.';\n break;\n case 500:\n $name = 'Internal Server Error';\n $message = 'An error has occurred and this resource cannot be displayed.';\n break;\n case 501:\n $name = 'Not Implemented';\n $message = 'The server either does not recognize the request method, or it lacks the ability to fulfil the request.';\n break;\n case 502:\n $name = 'Bad Gateway';\n $message = 'The server was acting as a gateway or proxy and received an invalid response from the upstream server.';\n break;\n case 503:\n $name = 'Service Unavailable';\n $message = 'The server is currently unavailable. It may be overloaded or down for maintenance.';\n break;\n case 504:\n $name = 'Gateway Timeout';\n $message = 'The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.';\n break;\n case 505:\n $name = 'HTTP Version Not Supported';\n $message = 'The server does not support the HTTP protocol version used in the request.';\n break;\n default:\n $code = 500;\n $name = 'Internal Server Error';\n $message = 'An error has occurred and this resource cannot be displayed.';\n }\n\n //$extra = (!$msg || strlen($msg) > 35 || strlen($msg) < 5) ? 'Houston, We Have A Problem' : $msg;\n\n $extra = $msg;\n\n return compact('code', 'name', 'message', 'extra');\n }", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getReasonPhrase() : string\n {\n return $this->reasonPhrase ?? Response::CODE_LIST[$this->getStatusCode()];\n }", "function Errors_404()\n{\n\treturn \"<html>\n\t\t\t<head>\n\t\t\t\t<title>404 Not Found</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<h1>Not Found</h1>\n\t\t\t\t<p>The requested URL was not found on this server.</p>\n\t\t\t\t<p>Additionally, a 404 Not Found\n\t\t\t\terror was encountered while trying to use an ErrorDocument to handle the request.</p>\n\t\t\t</body>\n\t\t\t</html>\";\n}", "public static function strerror($status) {\n return \"\";\n }", "public function errorInfo();", "public function errorInfo();", "function statusCode()\n {\n }", "public function __toString() {\n return sprintf('HTTP/1.1 %d %s', $this->getStatus(), $this->getDescription());\n }", "public static function error(int $code, string $message, $errors = [])\n {\n return response([\n 'message' => __($message),\n 'errors' => $errors\n ], $code);\n }", "private function _requestStatus($code) {\n $status = array( \n 200 => 'OK',\n 404 => 'Not Found', \n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n \t); \n return ($status[$code])?$status[$code]:$status[500]; \n }", "public function getHttpStatusMessage()\r\n\t{\r\n\t return $this->_solrResponse->getHttpStatusMessage();\r\n\t}", "function getStatusMessage(){\n\t\tif($this->_StatusMessage){ return $this->_StatusMessage; }\n\n\t\t//cerpano z\n\t\t//http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n\t\t$status = array(\n\t\t\t// Successful 2xx\n\t\t\t\"200\" => \"OK\",\n\t\t\t\"201\" => \"Created\",\n\t\t\t\"202\" => \"Accepted\",\n\t\t\t\"203\" => \"Non-Authoritative Information\",\n\t\t\t\"204\" => \"No Content\",\n\t\t\t\"205\" => \"Reset Content\",\n\t\t\t\"206\" => \"Partial Content\",\n\t\t\t// Redirection 3xx\n\t\t\t\"300\" => \"Multiple Choices\",\n\t\t\t\"301\" => \"Moved Permanently\",\n\t\t\t\"302\" => \"Found\",\n\t\t\t\"303\" => \"See Other\",\n\t\t\t\"304\" => \"Not Modified\",\n\t\t\t\"305\" => \"Use Proxy\",\n\t\t\t// (306 Unused)\n\t\t\t\"307\" => \"Temporary Redirect\",\n\t\t\t// Client Error 4xx\n\t\t\t\"400\" => \"Bad Request\",\n\t\t\t\"401\" => \"Unauthorized\",\n\t\t\t\"402\" => \"Payment Required\",\n\t\t\t\"403\" => \"Forbidden\",\n\t\t\t\"404\" => \"Not Found\",\n\t\t\t\"405\" => \"Method Not Allowed\",\n\t\t\t\"406\" => \"Not Acceptable\",\n\t\t\t\"407\" => \"Proxy Authentication Required\",\n\t\t\t\"408\" => \"Request Timeout\",\n\t\t\t\"409\" => \"Conflict\",\n\t\t\t\"410\" => \"Gone\",\n\t\t\t\"411\" => \"Length Required\",\n\t\t\t\"412\" => \"Precondition Failed\",\n\t\t\t\"413\" => \"Request Entity Too Large\",\n\t\t\t\"414\" => \"Request-URI Too Long\",\n\t\t\t\"415\" => \"Unsupported Media Type\",\n\t\t\t\"416\" => \"Requested Range Not Satisfiable\",\n\t\t\t\"417\" => \"Expectation Failed\",\n\t\t\t\"418\" => \"I'm a teapot\",\n\t\t\t// Server Error 5xx\n\t\t\t\"500\" => \"Internal Server Error\",\n\t\t\t\"501\" => \"Not Implemented\",\n\t\t\t\"502\" => \"Bad Gateway\",\n\t\t\t\"503\" => \"Service Unavailable\",\n\t\t\t\"504\" => \"Gateway Timeout\",\n\t\t\t\"505\" => \"HTTP Version Not Supported\",\n\t\t\t\"506\" => \"Variant Also Negotiates\",\n\t\t\t\"507\" => \"Insufficient Storage\",\n\t\t);\n\t\treturn isset($status[\"$this->_StatusCode\"]) ? $status[\"$this->_StatusCode\"] : \"Unknown\";\n\t}", "public function get_error_code()\n {\n }", "public function getErrorType() {\n if (curl_error($this->query['ch'])) {\n return 'network';\n }\n\n if ($this->getHttpCode() >= 400) {\n return 'http';\n }\n\n return null;\n }", "public static function get_status_code_message($status)\n {\n $codes = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 301 => 'Moved Permanently',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n );\n\n return (isset($codes[$status])) ? $codes[$status] : '';\n }", "private function _getStatusCodeMessage($status){\n\t\t// via parse_ini_file()... however, this will suffice\n\t\t// for an example\n\t\t$codes = Array(\n\t\t\t200 => 'OK',\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t);\n\t\treturn (isset($codes[$status])) ? $codes[$status] : '';\n\t}", "protected function generateHttpError(int $errorCode = 404): void\n {\n\t\t$content =\n '<h1>' .\n $errorCode .\n ' ' .\n Response::$statusTexts[$errorCode] .\n '</h1>';\n\n\t\tResponse::create($content, $errorCode)->send();\n\t\texit();\n\t}", "function api_error($err_code, $err_message, $err_data = null, $id = null) {\n $err = ['code'=>$err_code, 'message'=>$err_message];\n if (!is_null($err_data)) $err['data'] = $err_data;\n return api_return($err, $id, 'error');\n}", "public static function status($code=200,$msg=null,$return=false){\n\t\t\tif($msg===null)\n\t\t\t\tswitch($code){\n\t\t\t\t\t// 1xx Informational\n\t\t\t\t\tcase 100: $msg='HTTP/1.1 100 Continue'; break;\n\t\t\t\t\tcase 101: $msg='HTTP/1.1 101 Switching Protocols'; break;\n\t\t\t\t\tcase 102: $msg='HTTP/1.1 102 Processing'; break;\n\t\t\t\t\t// 2xx Success\n\t\t\t\t\tcase 200: $msg='HTTP/1.0 200 OK'; break;\n\t\t\t\t\tcase 201: $msg='HTTP/1.0 201 Created'; break;\n\t\t\t\t\tcase 202: $msg='HTTP/1.0 202 Acepted'; break;\n\t\t\t\t\tcase 203: $msg='HTTP/1.0 203 Non-Authoritative Information'; break;\n\t\t\t\t\tcase 204: $msg='HTTP/1.0 204 No Content'; break;\n\t\t\t\t\tcase 205: $msg='HTTP/1.0 205 Reset Content'; break;\n\t\t\t\t\tcase 206: $msg='HTTP/1.0 206 Partial Content'; break;\n\t\t\t\t\tcase 207: $msg='HTTP/1.0 207 Multi-Status'; break;\n\t\t\t\t\tcase 226: $msg='HTTP/1.0 226 IM Used'; break;\n\t\t\t\t\t// 3xx Redirection\n\t\t\t\t\tcase 300: $msg='HTTP/1.0 300 Multiple Choices'; break;\n\t\t\t\t\tcase 301: $msg='HTTP/1.0 301 Moved Permanently'; break;\n\t\t\t\t\tcase 302: $msg='HTTP/1.0 302 Found'; break;\n\t\t\t\t\tcase 303: $msg='HTTP/1.0 303 See Other'; break;\n\t\t\t\t\tcase 304: $msg='HTTP/1.0 304 Not Modified'; break;\n\t\t\t\t\tcase 305: $msg='HTTP/1.0 305 Use Proxy'; break;\n\t\t\t\t\tcase 306: $msg='HTTP/1.0 306 Switch Proxy'; break;\n\t\t\t\t\tcase 307: $msg='HTTP/1.0 307 Temporary Redirect'; break;\n\t\t\t\t\t// 4xx Client Error\n\t\t\t\t\tcase 400: $msg='HTTP/1.0 400 Bad Request'; break;\n\t\t\t\t\tcase 401: $msg='HTTP/1.0 401 Unauthorized'; break;\n\t\t\t\t\tcase 402: $msg='HTTP/1.0 402 Payment Required'; break;\n\t\t\t\t\tcase 403: $msg='HTTP/1.0 403 Forbidden'; break;\n\t\t\t\t\tcase 404: $msg='HTTP/1.0 404 Not Found'; break;\n\t\t\t\t\tcase 405: $msg='HTTP/1.0 405 Method Not Allowed'; break;\n\t\t\t\t\tcase 406: $msg='HTTP/1.0 406 Not Acceptable'; break;\n\t\t\t\t\tcase 407: $msg='HTTP/1.0 407 Proxy Authentication Required'; break;\n\t\t\t\t\tcase 408: $msg='HTTP/1.0 408 Request Timeout'; break;\n\t\t\t\t\tcase 409: $msg='HTTP/1.0 409 Conflict'; break;\n\t\t\t\t\tcase 410: $msg='HTTP/1.0 410 Gone'; break;\n\t\t\t\t\tcase 411: $msg='HTTP/1.0 411 Length Required'; break;\n\t\t\t\t\tcase 412: $msg='HTTP/1.0 412 Precondition Failed'; break;\n\t\t\t\t\tcase 413: $msg='HTTP/1.0 413 Request Entity Too Large'; break;\n\t\t\t\t\tcase 414: $msg='HTTP/1.0 414 Request-URI Too Long'; break;\n\t\t\t\t\tcase 415: $msg='HTTP/1.0 415 Unsupported Media Type'; break;\n\t\t\t\t\tcase 416: $msg='HTTP/1.0 416 Requested Range Not Satisfiable'; break;\n\t\t\t\t\tcase 417: $msg='HTTP/1.0 417 Expectation Failed'; break;\n\t\t\t\t\tcase 418: $msg='HTTP/1.0 418 I\\'m a teapot'; break;\n\t\t\t\t\tcase 422: $msg='HTTP/1.0 422 Unprocessable Entity'; break;\n\t\t\t\t\tcase 423: $msg='HTTP/1.0 423 Locked'; break;\n\t\t\t\t\tcase 424: $msg='HTTP/1.0 424 Failed Dependency'; break;\n\t\t\t\t\tcase 425: $msg='HTTP/1.0 425 Unordered Collection'; break;\n\t\t\t\t\tcase 426: $msg='HTTP/1.0 426 Upgrade Required'; break;\n\t\t\t\t\tcase 444: $msg='HTTP/1.0 444 No Response'; break;\n\t\t\t\t\tcase 449: $msg='HTTP/1.0 449 Retry With'; break;\n\t\t\t\t\tcase 450: $msg='HTTP/1.0 450 Blocked by Windows Parental Controls'; break;\n\t\t\t\t\tcase 499: $msg='HTTP/1.0 499 Client Closed Request'; break;\n\t\t\t\t\t// 5xx Server Error\n\t\t\t\t\tcase 500: $msg='HTTP/1.0 500 Internal Server Error'; break;\n\t\t\t\t\tcase 501: $msg='HTTP/1.0 501 Not Implemented'; break;\n\t\t\t\t\tcase 502: $msg='HTTP/1.0 502 Bad Gateway'; break;\n\t\t\t\t\tcase 503: $msg='HTTP/1.0 503 Service Unavailable'; break;\n\t\t\t\t\tcase 504: $msg='HTTP/1.0 504 Gateway Timeout'; break;\n\t\t\t\t\tcase 505: $msg='HTTP/1.0 505 HTTP Version Not Supported'; break;\n\t\t\t\t\tcase 506: $msg='HTTP/1.0 506 Variant Also Negotiates'; break;\n\t\t\t\t\tcase 507: $msg='HTTP/1.0 507 Insufficient Storage'; break;\n\t\t\t\t\tcase 509: $msg='HTTP/1.0 509 Bandwidth Limit Exceeded'; break;\n\t\t\t\t\tcase 510: $msg='HTTP/1.0 510 Not Extended'; break;\n\t\t\t\t\t// The default (?)\n\t\t\t\t\t$msg='HTTP/1.1 '.(int)$code.' Unknown';\n\t\t\t\t}\n\t\t\tif($return)return $msg;\n\t\t\tif(!headers_sent())header($msg,true,$code);\n\t\t\treturn !headers_sent();\n\t\t}", "function defineErrorCode(int $errorCode) : string {\n $errors = [\n 0 => 'There is no error, the file uploaded with success',\n 1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',\n 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',\n 3 => 'The uploaded file was only partially uploaded',\n 4 => 'No file was uploaded',\n 6 => 'Missing a temporary folder',\n 7 => 'Failed to write file to disk.',\n 8 => 'A PHP extension stopped the file upload.',\n ];\n\n return $errors[$errorCode];\n}", "public function getHttpCode()\n {\n return $this->information[ self::INFORMATION_HTTP_CODE ];\n }" ]
[ "0.73382276", "0.7187227", "0.6890476", "0.68526995", "0.6646916", "0.66284716", "0.6571516", "0.6535722", "0.65039366", "0.64789367", "0.64746636", "0.6452553", "0.64498425", "0.6437008", "0.637233", "0.63466275", "0.634254", "0.631513", "0.6314962", "0.6314705", "0.6306479", "0.6276103", "0.62373495", "0.62280273", "0.62242234", "0.617347", "0.61117", "0.6102776", "0.6087041", "0.6078857", "0.60671157", "0.6067108", "0.6051509", "0.6051149", "0.6046024", "0.6039039", "0.6037539", "0.60352725", "0.60306644", "0.6024075", "0.6019588", "0.60076374", "0.6003532", "0.6002131", "0.59857583", "0.59729886", "0.5971772", "0.5963072", "0.59615576", "0.59322596", "0.59269875", "0.592686", "0.591722", "0.59142447", "0.5910757", "0.59099865", "0.5905422", "0.5899192", "0.5898609", "0.5896244", "0.5891898", "0.58790725", "0.58715963", "0.58689964", "0.58523804", "0.5845079", "0.5843205", "0.5835892", "0.5833219", "0.5831732", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5795693", "0.5785894", "0.5781369", "0.5773624", "0.5766402", "0.5766402", "0.57554233", "0.57536536", "0.57355666", "0.572312", "0.57224077", "0.5718287", "0.5717545", "0.57145864", "0.5695227", "0.5685772", "0.56857306", "0.5683034", "0.5681175", "0.5679681", "0.5677474" ]
0.62926596
21
Set the exception to handle, which is used to generate a custom error message.
public function setException($err) { $this->exception = $err; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setExceptionHandler()\n {\n new ExceptionHandler();\n }", "public static function set ()\n {\n set_error_handler([__CLASS__, 'handle']);\n }", "public function handle() {\n throw new Exception(\"This is a test exception.\");\n }", "public static function setException($v)\n {\n self::$exception = $v;\n }", "public function setException($exception)\n {\n $this->exception = $exception;\n }", "public function setException(Throwable $exception) {\n $this->exception= $exception;\n }", "public function handleException($exception);", "public static function setExceptionHandler(){\n //Set the Pokelio exception handler\n set_exception_handler('Pokelio_Exception::PokelioExceptionHandler');\n }", "abstract protected function handleError(\\Exception $e);", "public function setException(\\TYPO3\\Flow\\Mvc\\Controller\\Exception $exception) {\n\t\t$this->exception = $exception;\n\t}", "public function setException($exception, $reassign = false);", "public function setErrorHandler($handler)\n {\n }", "public function setThrowException($value)\n {\n $this->provider->throwExceptionInError = $value;\n }", "public function setException(){\n $this->dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "public function __construct()\n {\n set_exception_handler(array($this, 'handleException'));\n }", "public function setErrorHandler(): self\n {\n set_error_handler([$this, 'handle']);\n\n return $this;\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 }", "protected function registerExceptionHandler()\n {\n set_exception_handler(function (\\Exception $exception) {\n $this->exception = $exception;\n $code = $this->exception->getCode();\n $statusCode = $this->response->getStatusCode();\n\n if (!is_int($code) || $code < 400 || $code > 599) {\n $code = 500;\n }\n\n // overwrite with user defined\n if ((int)$statusCode >= 400) {\n $code = $statusCode;\n }\n\n $this->response->withStatus($code);\n $this->resolve('errorHandler');\n });\n\n return $this;\n }", "public function handleException(\\Throwable $exception) : void\n {\n throw $exception;\n }", "protected function caughtException(\\Exception $e)\n {\n $this->caughtException = $e;\n }", "public function setErrorFromException(\\Exception $exception)\n {\n $this->error = $exception->__toString();\n }", "protected function onHandleError($exception)\n {\n $message = $exception->getMessage();\n Yii::log($message, CLogger::LEVEL_ERROR);\n throw $exception;\n }", "public static function setExceptionHandler($class_name, $handler)\n\t{\n\t\tself::$exception_handlers[$class_name] = $handler;\n\t}", "public function handleException(\\Exception $exception): void;", "public static function handleException($exception) {\n\t\t$error = new Error(\n\t\t\tError::ERROR, $exception->getCode(),\n\t\t\t$exception->getMessage(), $exception->getFile(),\n\t\t\t$exception->getLine()\n\t\t);\n\n\t\tself::onError($error);\n\t}", "public function setThrowable(\\Throwable $exception) : void\n {\n $this->exception = null;\n $this->throwable = $exception;\n }", "public function registerExceptionHandler()\n\t{\n\t\tset_exception_handler(function($e){\n\t\t\treturn View::handleError($e->getMessage(), 500);\n\t\t});\n\t}", "public function setExceptionHandler(Whoops $handler = null)\n {\n if (!is_null($this->exceptionHandler)) {\n $this->exceptionHandler->unregister();\n }\n\n if (!is_null($handler)) {\n $handler->register();\n }\n\n $this->exceptionHandler = $handler;\n }", "public function handle(Exception $e){\n $this->exception = $e;\n $this->notify();\n if(DEVELOPMENT_ENVIRONMENT == true):\n if(is_a($e,'ErrorException'))\n $trace = \n '<div id=\"php_error\"><strong><span style=\"color:#faa51a;\">PHP Interpreter ERROR ['.\n $e->getCode().']:</span> '.\n $e->getMessage().' at Line( '.\n $e->getLine().' )in File: '.\n $e->getFile().'</strong><br /><br /><p><pre>'.\n $e->getTraceAsString().'</pre></p></div>';\n else\n $trace =\n '<div id=\"php_error\"><strong><span style=\"color:#faa51a;\">LAIKA ERROR ['.\n $e->getCode().']:</span> '.\n $e->getMessage().' at Line( '.\n $e->getLine().' ) in File: '.\n $e->getFile().'</strong><br /><br /><p><pre>'.\n $e->getTraceAsString().'</pre></p></div>';\n $this->display($trace,$e->getFile(),$e->getLine());\n else:\n $message = '<div id=\"php_error\">\n <strong><span style=\"color:#faa51a;\">APPLICATION ERROR</span></strong>\n </div>';\n $this->display($message,NULL,NULL); \n endif; \n }", "protected function handleException(\\Exception $e)\n {\n if ($cb = $this->errorHandler) {\n $cb($e);\n }\n }", "protected function initializeErrorHandling() {}", "public static function exceptionHandler($e)\n {\n self::newMessage($e);\n self::customErrorMsg();\n }", "public static function setError($message) {\n self::$_class = \"Example\\\\Excel\\\\Controllers\\\\Error\";\n throw new \\Exception($message);\n }", "public function triggerError(\\Exception $e)\n {\n $this->errorHandler = new ErrorHandler();\n $this->errorHandler->handle($e);\n }", "public function handleException($exception)\n {\n // Ignore if the error is suppressed by using the shut-up operator @\n if (error_reporting() === 0) {\n return;\n }\n\n if (is_object($this->systemLogger)) {\n $options = $this->resolveCustomRenderingOptions($exception);\n if (isset($options['logException']) && $options['logException']) {\n if ($exception instanceof \\Throwable) {\n if ($this->systemLogger instanceof ThrowableLoggerInterface) {\n $this->systemLogger->logThrowable($exception);\n } else {\n // Convert \\Throwable to \\Exception for non-supporting logger implementations\n $this->systemLogger->logException(new \\Exception($exception->getMessage(), $exception->getCode()));\n }\n } elseif ($exception instanceof \\Exception) {\n $this->systemLogger->logException($exception);\n }\n }\n }\n\n switch (PHP_SAPI) {\n case 'cli':\n $this->echoExceptionCli($exception);\n break;\n default:\n $this->echoExceptionWeb($exception);\n }\n }", "public function setupErrorHandler()\n {\n $this->error_handler = set_error_handler(array($this, 'error_handler'));\n }", "protected function _setExceptionHandler($cls) {\n ExceptionProcessor::getInstance()->setHandler($cls);\n }", "public function startExceptionHandling()\n\t{\n\t\t// By registering the error handler with a level of -1, we state that we want\n\t\t// all PHP errors converted to ErrorExceptions and thrown, which provides\n\t\t// a quite strict development environment, but prevents unseen errors.\n\t\t$this['kernel.error']->register(-1);\n\n\t\t$me = $this;\n\n\t\treturn $this->setExceptionHandler(function($exception) use ($me)\n\t\t{\n\t\t\t$handlers = $me->getErrorHandlers();\n\n\t\t\t$response = $me['exception']->handle($exception, $handlers);\n\n\t\t\t// If one of the custom error handlers returned a response, we will send that\n\t\t\t// response back to the client after preparing it. This allows a specific\n\t\t\t// type of exceptions to handled by a Closure giving great flexibility.\n\t\t\tif ( ! is_null($response))\n\t\t\t{\n\t\t\t\t$response = $me->prepareResponse($response, $me['request']);\n\n\t\t\t\t$response->send();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$me['kernel.exception']->handle($exception);\n\t\t\t}\n\t\t});\n\t}", "protected function _register_exception_handler()\n {\n if (!class_exists('\\prggmr\\signal\\integer\\Range', false)){\n require_once 'signal/integer/range.php';\n }\n if (null === $this->_exception_handle_signal) {\n $this->_engine_handle_signal = new \\prggmr\\signal\\integer\\Range(\n 0xE002, 0xE014\n );\n } else {\n if ($this->_search_complex($this->_engine_handle_signal)[0] === self::SEARCH_FOUND) {\n return true;\n }\n }\n $this->handle(function(){\n $args = func_get_args();\n $type = end($args);\n $message = null;\n if ($args[0] instanceof \\Exception) {\n $message = $args[0]->getMessage();\n } else {\n $message = engine_code($type);\n }\n throw new EngineException($message, $type, $args);\n }, $this->_engine_handle_signal, 0, null);\n }", "public function _handleException($e)\n\t{\n\t\tif(!$this->_inError && $handler = $this->_application->errorHandler())\n\t\t{\n\t\t\t$this->_inError = true;\n\t\t\t$handler->handle($e);\n\t\t\t$this->_inError = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(php_sapi_name() == 'cli')\n\t\t\t{\n\t\t\t\techo $e->__toString();\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader('HTTP/1.1 500 Internal Server Error');\n\n\t\t\t\techo \"<h1>Error: \".$e->getMessage().'</h1>';\n\t\t\t\techo '<pre>'.$e->__toString().'</pre>';\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n {\n set_error_handler([$this, 'handleError']);\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}", "public static function handle_exception($e) {\n\t\tswitch ( get_class($e) ) {\n\t\t\tcase 'NumbatDBError':\n\t\t\tcase 'PDOException':\n\t\t\t\t$type = 'db';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = 'uncaught';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$config = array();\n\t\tif($type == 'db' && get_class($e) == 'NumbatDBError')\n\t\t\t$config = $e->getConfig();\n\n\t\tnumbat_primative_die($e->getMessage(), $type, $config);\n\t}", "protected function handleException($e)\n {\n switch (ENV) {\n case 'production':\n $this->renderException($e);\n break;\n default:\n $this->reportException($e);\n break;\n\n }\n }", "public static function setExceptionHandler(Exception $e)\n\t{\n\t\tself::showDebugBacktrace(debug_backtrace());\n\t}", "public static function handle()\n {\n set_error_handler([ErrorHandler::class, 'errorToException'], E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED);\n }", "public function handleException(Exception $exception)\n {\n newrelic_notice_error($exception->getMessage(), $exception);\n }", "public static function handleException( $e )\n\t{\n\t\t$details['type'] = get_class( $e );\n\t\t$details['code'] = $e->getCode();\n\t\t$details['message'] = $e->getMessage();\n\t\t$details['line'] = $e->getLine();\n\t\t$details['file'] = $e->getFile();\n\t\t$details['trace'] = $e->getTrace();\n\t\t\n\t\tself::bluescreen( $details );\n\t}", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n // Don't catch suppressed errors with '@' sign\n // @link http://stackoverflow.com/questions/7380782/error-supression-operator-and-set-error-handler\n $error_reporting = ini_get('error_reporting');\n if (!($error_reporting & $errno)) {\n return;\n }\n throw new ErrorException($errstr, $errno, 0, $errfile, $errline);\n}", "public function handleExceptions($e)\n {\n if (!$e instanceof Exception) {\n $e = new FatalThrowableError($e);\n }\n }", "public function handleException($e)\n {\n if (!$e instanceof Exception) {\n $e = new FatalThrowableError($e);\n }\n\n if (IS_CLI) {\n $this->renderForConsole($e);\n } else {\n $this->renderHttpResponse($e);\n }\n }", "protected function registerErrorHandling()\n {\n error_reporting(-1);\n\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new ErrorException($message, 0, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n $this->handleUncaughtException($e);\n });\n\n register_shutdown_function(function () {\n $this->handleShutdown();\n });\n }", "public function exceptionHandler(\\Exception $exception)\n {\n $this->displayException($exception);\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 static function handle(\\Exception $exception) {\r\n // Creation du message\r\n $message = 'Uncaught exception ' . get_class($exception) . ' with message \"' . $exception->getMessage() . '\" in ' . $exception->getFile() . '(' . $exception->getLine() . \")\" . PHP_EOL . $exception->getTraceAsString();\r\n\r\n // Log de l'exception\r\n if (self::getLogger()->isErrorEnabled()) {\r\n self::getLogger()->error($message);\r\n }\r\n\r\n // Affichage du message d'erreur\r\n echo $message;\r\n\r\n // Arret inconditionnel du traitement\r\n exit;\r\n }", "public static function handleException($exception) {\n $file = $exception->getFile();\n $line = $exception->getLine();\n $errMessage = $exception->getMessage();\n $trace = $exception->getTraceAsString();\n $error = \"$file:$line $errMessage $trace\";\n $logger = Container::getService('Logger');\n $logger->excpt($error);\n self::sendError($errMessage);\n exit;\n }", "function as_exception_handler($e){\n\t\t$msg = 'Error('.$e->getCode().') '. $e->getMessage().' in '. $e->getFile().':'. $e->getLine();\n\t\t$this->catch_error($msg, 'clickgs plugin crashed');\n\t}", "public function handle(\\Exception $error);", "public static function handler(Exception $e)\n {\n try {\n\n if (Request::$current !== NULL\n && Request::current()->is_ajax() === TRUE\n && Kohana::$environment !== Kohana::PRODUCTION) {\n header('Content-Type: text/plain; charset='.Kohana::$charset, TRUE, 500);\n self::_print($e);\n }\n\n if (Kohana::$environment === Kohana::PRODUCTION && ! self::$custom_view_file)\n Kohana_Kohana_Exception::$error_view = self::get_view_file($e);\n elseif (self::$custom_view_file)\n Kohana_Kohana_Exception::$error_view = self::$custom_view_file;\n\n parent::handler($e);\n\n } catch(Exception $e) {\n /**\n * Things are going *really* badly for us, We now have no choice\n * but to bail. Hard.\n */\n // Clean the output buffer if one exists\n ob_get_level() AND ob_clean();\n\n // Set the Status code to 500, and Content-Type to text/plain.\n header('Content-Type: text/plain; charset='.Kohana::$charset, TRUE, 500);\n\n echo Kohana_Exception::text($e);\n\n exit(1);\n }\n }", "public static function setDefaultExceptionHandler($handler){\n\t\tself::$_defaultExceptionHandler = $handler;\n\t}", "public function handleException(\\Throwable $exception)\n {\n $handlerException = null;\n\n if (!$this->loggedErrors) {\n if (false !== strpos($message = $exception->getMessage(), \"@anonymous\\0\")) {\n $message = \"Anonymous Class Exception\"; //call class not found exception here\n }\n\n if ($exception::ERROR == self::PERMISSION_DENIED) \n $message = self::PERMISSION_DENIED . '<br>';\n elseif($exception::ERROR == self::NOT_FOUND)\n $message = self::NOT_FOUND . '<br>';\n if (strpos($exception->getMessage(), \"FatalError\")) {\n $message .= '<br>Fatal Error: ';\n } elseif ($exception instanceof \\Error) {\n $message .= '<br>Uncaught Error: ';\n } elseif ($exception instanceof ErrorException) {\n $message .= '<br>Uncaught ';\n } elseif ($exception instanceof BaseForbiddenException) {\n $message .= 'Permission Error: ';\n }elseif($exception instanceof PageNotFoundException){\n $message .= 'Not Found Error: ';\n } else{\n $message .= '<br>Uncaught Exception: ';\n }\n\n try {\n $this->log($message, ['exception' => $exception]);\n } catch (\\Throwable $handlerException) {\n echo $handlerException->getMessage();\n }\n }\n\n if ($exception instanceof OutOfMemoryError) {\n $this->log($exception->getMessage(), ['exception' => $exception, 'type' => 'OutOfMemoryError']);\n }\n $loggedErrors = $this->loggedErrors;\n $this->loggedErrors = $exception === $handlerException ? 0 : $this->loggedErrors;\n }", "public function setException(Throwable $e)\n {\n $this->_exceptions[] = $e;\n return $this;\n }", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\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}", "protected function _handleException(Exception $exception)\n {\n $logMessage = Application\\Error::toString($exception);\n Application::getLog()->crit($logMessage);\n\n // Are we in cli mode?\n if ('cli' === strtolower(PHP_SAPI)) {\n $this->disableView();\n return;\n }\n\n // Is that a user readable exception?\n if ($exception instanceof Exception) {\n $this->view->message = $logMessage;\n return;\n }\n }", "public function setHandler($handler)\n {\n if (!class_exists($handler)) {\n throw new \\Exception('Class \"' . $handler . '\" does not exist!');\n }\n\n $this->handler = $handler;\n }", "function handle_error($exception) {\n try {\n print $this->encode(array(\n 'error' => $exception->getMessage(),\n 'message' => $exception->getMessage(), // Should be a i18n end user message\n 'data' => @$exception->data,\n 'status' => @$exception->status\n ));\n } catch(Exception $e) {\n echo 'Error: '.$e->getmessage();\n }\n }", "public function handleException(Exception $e)\n {\n watchdog('Award Force API', $e->getMessage(), array(), WATCHDOG_ERROR);\n\n exit(t('An error has occurred. Please try again, and if the problem persists, contact the system administrator.'));\n }", "public function handleException($exception)\n {\n //if application is on production keep silent\n if (\\App::environment('production'))\n \\Log::error($exception->getMessage());\n\n //Eloquent Model Exception\n else if ($exception instanceof ModelNotFoundException)\n throw new ModelNotFoundException($exception->getMessage());\n\n //DB Error\n else if ($exception instanceof PDOException)\n throw new PDOException($exception->getMessage());\n\n else if ($exception instanceof BadMethodCallException)\n throw new BadMethodCallException($exception->getMessage());\n\n //Through general Exception\n else\n throw new Exception($exception->getMessage());\n\n }", "protected function setErrorClassAttribute() {}", "function handleException(Exception $ex)\n{\n\techo \"There was an error: {$ex}\";\n}", "public function setHandle($handle)\n {\n $this->handle = $handle;\n }", "protected function setExceptionHandler(Closure $handler)\n\t{\n\t\treturn set_exception_handler($handler);\n\t}", "private function handleException($e)\n {\n // TODO: test coverage\n if ($e instanceof ClientException) {\n // will catch all 4xx errors\n if ($e->getResponse()->getStatusCode() == 403) {\n throw new AuthenticationException(\n $this->apiKey,\n $this->apiSecret,\n null,\n $e\n );\n } else {\n throw new DomainException(\n 'The OpenTok API request failed: ' . json_decode($e->getResponse()->getBody(true))->message,\n null,\n $e\n );\n }\n } else if ($e instanceof ServerException) {\n // will catch all 5xx errors\n throw new UnexpectedValueException(\n 'The OpenTok API server responded with an error: ' . json_decode($e->getResponse()->getBody(true))->message,\n null,\n $e\n );\n } else {\n // TODO: check if this works because Exception is an interface not a class\n throw new Exception('An unexpected error occurred');\n }\n }", "public function UnhandeldException(){\n\t\t$this -> message = \"An unhandeld exception was thrown. Please infrom...\";\n\t}", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "function exception_error_handler( $errno, $errstr, $errfile, $errline ) {\n throw new ErrorException( $errstr, $errno, 0, $errfile, $errline );\n}", "function default_exception_handler($ex) {\n $backtrace = $ex->getTrace();\n $place = array('file'=>$ex->getFile(), 'line'=>$ex->getLine(), 'exception'=>get_class($ex));\n array_unshift($backtrace, $place);\n\n if ($ex instanceof moodle_exception) {\n _print_normal_error($ex->errorcode, $ex->module, $ex->a, $ex->link, $backtrace, $ex->debuginfo);\n } else {\n _print_normal_error('generalexceptionmessage', 'error', $ex->getMessage(), '', $backtrace);\n }\n}", "public function handleException(\\Throwable $exception): void\n {\n \\call_user_func($this->callback, $exception);\n\n $previousExceptionHandlerException = $exception;\n\n // Unset the previous exception handler to prevent infinite loop in case\n // we need to handle an exception thrown from it\n $previousExceptionHandler = $this->previousExceptionHandler;\n $this->previousExceptionHandler = null;\n\n try {\n if (null !== $previousExceptionHandler) {\n $previousExceptionHandler($exception);\n }\n } catch (\\Throwable $previousExceptionHandlerException) {\n // Do nothing, we just need to set the $previousExceptionHandlerException\n // variable to the exception we just catched to compare it later\n // with the original object instance\n }\n\n // If the exception object instance is the same as the one catched from\n // the previous exception handler, if any, give it back to the native\n // PHP handler to prevent infinite circular loop\n if ($exception === $previousExceptionHandlerException) {\n // Disable the fatal error handler or the error will be reported twice\n self::$reservedMemory = null;\n\n throw $exception;\n }\n\n $this->handleException($previousExceptionHandlerException);\n }", "public static function exceptionHandler($exception) {\r\n\t\t\t$className = Configure::read('Exception.Renderer');\r\n\t\t\tcall_user_func(array($className, 'render'), $exception);\r\n\t\t\tdie();\r\n\t\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 }", "function handleException( $exception ) {\n echo \"Sorry, a problem occurred. Please try later.\";\n error_log( $exception->getMessage() );\n}", "public function handleException(\\Throwable $throwable)\n {\n // Captured an application-level exception.\n try {\n // Log the exception.\n Logger::get()->exception($throwable);\n // Try to display a user-friendly message.\n $responder = new Responders\\Http\\Error;\n $responder->setThrowable($throwable);\n $responder->getResponse()->issue();\n // Stop the application, as it did not handle the exception\n // properly.\n die(-1);\n } catch (\\Exception $innerException) {\n $this->fail($innerException);\n }\n }", "function handleError($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n // error was suppressed with the @-operator\n if (0 === error_reporting()) {\n return false;\n }\n\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "function handler($ex) {\n echo \"In exception handler\\n\";\n}", "private function handleException(\\Exception $exception)\n {\n $contents = json_decode($exception->getResponse()->getBody()->getContents());\n\n $errors = $contents->errors ?? [];\n\n foreach ($errors as $key => $error) {\n $errors[$key] = $error->code . ': ' . $error->message;\n }\n\n $this->api->setErrors($errors);\n }", "protected function registerErrorHandling()\n {\n error_reporting(E_ALL);\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new \\ErrorException($message, 403, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n echo($e);\n });\n\n register_shutdown_function(function () {\n echo(error_get_last());\n });\n }", "public function handle($exception)\n {\n $exception = call_user_func($this->config('exceptionCallback'), $exception);\n if (!$exception) {\n return;\n }\n $client = $this->client();\n $client = call_user_func($this->config('clientCallback'), $client);\n if ($client) {\n $client->addError(sprintf('%s: %s', get_class($exception), $exception->getMessage()));\n }\n }", "public function setErrorMessage($e){\n //checks if error message is cause due to invalid characters\n if($e -> getMessage() == EnumStatus::$InvalidCharactersError){\n //if so those are removed.\n $this -> saveDisplayName = strip_tags($this -> saveDisplayName);\n $this -> saveUserName = strip_tags($this -> saveUserName);\n }\n $this -> message = $e -> getMessage();\n }", "public function enable_signaled_exceptions()\n {\n $this->_engine_exceptions = true;\n $this->_register_exception_handler();\n }", "public function setException($exception)\n {\n $this->exception = $exception;\n return $this;\n }", "private static function initErrorHandler() {\n\t\t\tset_exception_handler('ErrorHandler::handleExceptions');\n\t\t\tset_error_handler('ErrorHandler::handleErrors');\n\t\t}", "abstract public function handleFatalError($e);", "public static function exception_handler($exception) { \n ResponseFactory::send($exception->getMessage()); //Send exception message as response.\n }", "protected function registerErrorHandler()\n {\n set_error_handler(function ($severity, $message, $file, $line) {\n if (!(error_reporting() & $severity)) {\n return;\n }\n\n throw new \\ErrorException($message, 0, $severity, $file, $line);\n });\n\n return $this;\n }", "private function initErrorHandler()\n {\n $handler = new ErrorHandler();\n set_error_handler([$handler, 'handler']);\n }", "public static function handleException($e)\n {\n self::setHeader($e);\n //TODO quitar el extract, que el view pida los que necesite\n extract(Router::get(), EXTR_OVERWRITE);\n // Registra la autocarga de helpers\n spl_autoload_register('kumbia_autoload_helper', true, true);\n\n $Controller = Util::camelcase($controller);\n ob_start();\n if (PRODUCTION) { //TODO: añadir error 500.phtml\n include APP_PATH . 'views/_shared/errors/404.phtml';\n return;\n }\n if ($e instanceof KumbiaException) {\n $view = $e->view;\n $tpl = $e->template;\n } else {\n $view = 'exception';\n $tpl = 'views/templates/exception.phtml';\n }\n //Fix problem with action name in REST\n $action = $e->getMessage() ? $e->getMessage() : $action;\n\n include CORE_PATH . \"views/errors/{$view}.phtml\";\n \n $content = ob_get_clean();\n\n // termina los buffers abiertos\n while (ob_get_level ()) {\n ob_end_clean();\n }\n include CORE_PATH . $tpl;\n }", "function exceptionHandler($exception) {\n\t$errno = E_USER_ERROR;\n\t$type = get_class($exception);\n\t$message = \"Uncaught \" . $type . \": \" . $exception->getMessage();\n\t$file = $exception->getFile();\n\t$line = $exception->getLine();\n\t$context = $exception->getTrace();\n\tDebug::fatalHandler($errno, $message, $file, $line, $context);\n}", "public function registerErrorHandler() {\n set_error_handler(array($this, 'handleError'));\n error_reporting(E_ALL);\n }" ]
[ "0.67127323", "0.6669807", "0.65453446", "0.6504442", "0.64260197", "0.6398304", "0.63810664", "0.63382185", "0.6274508", "0.6187444", "0.61745644", "0.61180365", "0.6109779", "0.60826457", "0.6002602", "0.59925616", "0.5987312", "0.59670925", "0.59663886", "0.5957488", "0.5929001", "0.5918087", "0.5910199", "0.5886435", "0.5875875", "0.586596", "0.5864269", "0.5863721", "0.58628047", "0.5824252", "0.5803783", "0.5776497", "0.5756875", "0.5753868", "0.57514274", "0.573905", "0.57188433", "0.5714981", "0.57064325", "0.57028836", "0.57002336", "0.5700046", "0.5682418", "0.56663436", "0.5656105", "0.5643958", "0.562586", "0.5621275", "0.5616103", "0.560708", "0.55927515", "0.55845815", "0.5584103", "0.55622125", "0.55361456", "0.5528748", "0.5520674", "0.5498579", "0.549119", "0.5481506", "0.5462241", "0.5444668", "0.5442095", "0.5414977", "0.5410451", "0.53932256", "0.53801745", "0.5377733", "0.53574336", "0.5355852", "0.5337726", "0.5337634", "0.5336937", "0.5324125", "0.5319128", "0.53055936", "0.5296669", "0.52834654", "0.5283338", "0.527625", "0.5275661", "0.5275661", "0.52649724", "0.5254353", "0.5253665", "0.5249194", "0.52490467", "0.5248278", "0.52443373", "0.52441067", "0.52439475", "0.5241976", "0.52412647", "0.5240137", "0.5240085", "0.52380073", "0.5225702", "0.5225467", "0.52248746", "0.5221967" ]
0.60083765
14
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 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}", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "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 }", "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}", "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 }", "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 testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\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}", "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 controller(array $params): void\n {\n if (!isset($params['name'])) {\n Console::fatal('Missing name parameter.');\n }\n\n $entityName = studly_case($params['name']);\n $options = [\n 'entityName' => $entityName,\n 'className' => 'App\\\\Controller\\\\' . str_plural($entityName) . 'Controller',\n 'fileKind' => 'controller',\n 'replace' => [\n 'tags' => ['{entityName}', '{controllerName}'],\n 'values' => [$entityName, str_plural($entityName)],\n ],\n 'filePath' => 'Controller/' . str_plural($entityName) . 'Controller.php',\n ];\n\n $this->createFile($options);\n }" ]
[ "0.82679385", "0.81739837", "0.7811711", "0.7706132", "0.76824135", "0.76599807", "0.7486886", "0.7407581", "0.72973657", "0.72537446", "0.71976084", "0.7175448", "0.70148426", "0.6989921", "0.698332", "0.69719964", "0.6963479", "0.69347966", "0.6898294", "0.68923163", "0.68766165", "0.6870487", "0.6863028", "0.6839216", "0.6780402", "0.6704657", "0.6670529", "0.6662537", "0.6652341", "0.6645224", "0.6616762", "0.6615776", "0.6587971", "0.64491856", "0.64456904", "0.64298046", "0.6427206", "0.6303513", "0.62986237", "0.6293529", "0.62816995", "0.626091", "0.62548393", "0.6170004", "0.61632925", "0.61594075", "0.6142092", "0.6137889", "0.6134217", "0.61322975", "0.61300254", "0.61109394", "0.6095679", "0.6089122", "0.60764354", "0.6065879", "0.6060519", "0.60574526", "0.60453564", "0.6030476", "0.6024937", "0.60245734", "0.601992", "0.6013322", "0.60132945", "0.6011444", "0.6010348", "0.6003902", "0.59994984", "0.5998256", "0.5995091", "0.59874576", "0.59874576", "0.59874576", "0.5969236", "0.5952697", "0.59487635", "0.59418136", "0.592625", "0.59155315", "0.5914119", "0.5913534", "0.59123963", "0.5910155", "0.5904157", "0.59010935", "0.5899018", "0.5896666", "0.58957773", "0.5893092", "0.58897334", "0.5877193", "0.5870557", "0.5865181", "0.58613557", "0.5851115", "0.5839423", "0.5834002", "0.58249503", "0.5816664", "0.5812349" ]
0.0
-1
/ List all available items
public function index() { if (!has_permission('items', '', 'view')) { access_denied('Invoice Items'); } if ($this->input->is_ajax_request()) { $this->perfex_base->get_table_data('invoice_items'); } $this->load->model('taxes_model'); $data['taxes'] = $this->taxes_model->get(); $data['items_groups'] = $this->invoice_items_model->get_groups(); $data['title'] = _l('invoice_items'); $this->load->view('admin/invoice_items/manage', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "function getItems();", "function getItems();", "public function listAll();", "public function listAll();", "public function getAll()\n {\n \tif(!$this->isEmpty()){\n \t\treturn $this->items;\n \t}\n }", "public function listAll()\n {\n }", "public function all(){\r\n return $this->items;\r\n }", "public function getItems()\n {\n }", "public function all()\n {\n $item = new Item;\n $items = $item->all();\n View::renderJson($items);\n }", "public function indexAction() {\n $service = $this->getItemService();\n\n $items = $service->findAll();\n \n return array(\n 'items' => $items,\n );\n }", "public function getItemsList(){\n return $this->_get(4);\n }", "protected function all()\n\t{\n\t\treturn $this->items;\n\t}", "public function listing();", "public function listItems()\n {\n return null;\n }", "public function items()\n {\n \n }", "public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}", "public function items ()\n {\n }", "abstract public function items();", "public function showall()\n {\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }", "public function get_all ();", "public function all()\n\t{\n\t\treturn $this->items;\n\t}", "public function index()\n {\n return $this->itemRepo->findAll();\n }", "public function showAll()\n {\n }", "public static function getAll() {}", "public function getAll(){\n\t\t\t//return $this->db->get('item'); \n\t\t}", "public final function get_all()\n {\n }", "public function all() {\n\t\treturn $this->items;\n\t}", "function listitems($name)\r\n\t\t{\r\n\t\t \t\r\n\t\t}", "function listAll()\n{\n\tglobal $orderedIT;\n\n\t//to make sure this comes first\n\t//not so usefull anymore since they're not all open at start anyways..\n\tdispBatch('GENERIC', $orderedIT['GENERIC']);\n\n\tforeach($orderedIT as $name => $elem)\n\t{\n\t\tif ($name=='GENERIC') continue;\n\n\t\tdispBatch($name, $elem);\n\t}\n}", "public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}", "abstract protected function _getItems();", "public static function getAll();", "public static function getAll();", "public function get_all_public_items () {\n\t\treturn array();\n\t}", "public function items() {\n return $this->list;\n }", "public function &items();", "public function actionList() {\n $this->_getList();\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getItems(): array;", "public function getItems(): array;", "public function getAllItems(){\n\n\t\treturn $this->redis_client->keys(\"*\");\n\t}", "public function index()\n {\n return Item::join('categories', 'categories.id', '=', 'items.category_id')\n ->select('categories.name AS category_name', 'items.name', 'items.serial', 'items.description', 'items.max_quantity', 'items.created_at', 'items.category_id AS category', 'items.id', 'items.availability')\n ->latest()\n ->paginate(5);\n }", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function getAllItems() {\n\t\t$allItems = [];\n\t\t$res = $this->db->query(\"SELECT * FROM voorziening ORDER BY naam\");\n\t\twhile ($row = $res->fetch_assoc()) {\n\t\t\t$allItems[] = $row;\n\t\t}\n\t\treturn $allItems;\n\t}", "public function getItems() : array;", "public function all()\n {\n return $this->refresh()->getItems();\n }", "public function all()\n {\n return $this->item;\n }", "public function getAll()\n {\n return $this->list;\n }", "public function getPageItems()\n {\n }", "public function viewAll()\n {\n $items = Item::all();\n\n\n return view('pages.items')->with('items', $items);\n }", "function getAll()\r\n {\r\n\r\n }", "public function available_items_template()\n {\n }", "public function showItems(){\n\t\t$displayItems \t=\t\"\";\n\t\t$items\t\t\t=\tself::getItems();\t\t\n\t\t$searchItem\t\t=\tself::getSearchVal();\t\t\n\t\t$catUrl\t\t\t=\tself::getCatUrl();\n\t\t$brandUrl\t\t=\tself::getBrandUrl();\t \t\n\t\t$prodUrl\t\t=\tself::getProdUrl();\t \t\t\n\t\t$searchCond\t\t=\t(empty($searchItem)) ? \"\" : \"&search=$searchItem\";\n\t\t$mform \t\t\t=\tnew formMaintenance();\t\t \n\t\t$query \t\t\t=\t\"SELECT name FROM reference WHERE ref_name='display_items'\";\n\t\t$mod\t\t\t=\tself::getModule();\n\t\t$type\t\t\t=\tself::getModuleType();\n\t\t$displayItems \t.=\t\"Item Count\t: <select onchange=\\\"location.href='?mod=$mod&type=$type$searchCond$catUrl$brandUrl$prodUrl&items='+this.value\\\">\";\n\t\t$displayItems \t.=\t$mform->select2($query,$items,\"name\",\"name\");\t\t\t\t\t\n\t\t$displayItems \t.=\t\"</select>\";\t \n\t\treturn $displayItems;\t\n\t}", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "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}", "function read_all_items() {\n $db = GetGlobal('db');\n\t $lan = GetReq('lan')>=0?GetReq('lan'):getlocal();\t//in case of post sitemap set lan param uri \n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\t \n\t $start = GetReq('start');\n\t //$headcat = GetReq('headcat')?GetReq('headcat'):\"\";\t \n\t //$meter = $start?$start-1:0; \t \n\t \n\t \t\n $sSQL = \"select id,itmname,itmfname,cat0,cat1,cat2,cat3,cat4,itmdescr,itmfdescr,itmremark,\".$this->getmapf('code').\" from products \";\n\t $sSQL .= \" WHERE \";\n\t $sSQL .= \"itmactive>0 and active>0 \";\t\n\t //$sSQL .= \" GROUP BY cat0,$itmname\";\n\t $sSQL .= \" ORDER BY cat0,cat1,cat2,cat3,cat4,$itmname asc \";\n\t $sSQL .= $start ? \" LIMIT $start,10000\" : \" LIMIT 10000\";\t\t\t\n\t //echo $sSQL;\n\t\t\n\t $resultset = $db->Execute($sSQL,2);\t\n\t // $result = $resultset;\n\t $this->result = $resultset; \n \t $this->max_items = $db->Affected_Rows();//count($this->result);\t \n return (null);//$this->max_items);\t\t \n\t}" ]
[ "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.75065845", "0.7506436", "0.7506436", "0.7413543", "0.7413543", "0.72705233", "0.71902233", "0.7186648", "0.7149032", "0.7124", "0.71215796", "0.70933443", "0.70890325", "0.70749325", "0.7028643", "0.6938973", "0.6933959", "0.69303125", "0.68945545", "0.68829226", "0.68599755", "0.68599755", "0.68599755", "0.68599755", "0.68599755", "0.68599755", "0.6852797", "0.6848993", "0.6848222", "0.6831515", "0.6831291", "0.68300575", "0.6821238", "0.6798523", "0.6796741", "0.67477345", "0.6725402", "0.67202365", "0.67154396", "0.67144", "0.67144", "0.67140496", "0.6709442", "0.6707685", "0.6700312", "0.6652107", "0.6652107", "0.6652107", "0.665167", "0.665167", "0.66402674", "0.66402674", "0.6623258", "0.66199523", "0.66152054", "0.6614054", "0.6596522", "0.65897775", "0.6578952", "0.6570246", "0.6549575", "0.65323424", "0.6530467", "0.6523833", "0.6519042", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65164644", "0.65050375", "0.64981693" ]
0.0
-1
/ Edit or update items / ajax request /
public function manage() { if (has_permission('items', '', 'view')) { if ($this->input->post()) { $data = $this->input->post(); if ($data['itemid'] == '') { if (!has_permission('items', '', 'create')) { header('HTTP/1.0 400 Bad error'); echo _l('access_denied'); die; } $id = $this->invoice_items_model->add($data); $success = false; $message = ''; if ($id) { $success = true; $message = _l('added_successfuly', _l('invoice_item')); } echo json_encode(array( 'success' => $success, 'message' => $message, 'item' => $this->invoice_items_model->get($id) )); } else { if (!has_permission('items', '', 'edit')) { header('HTTP/1.0 400 Bad error'); echo _l('access_denied'); die; } $success = $this->invoice_items_model->edit($data); $message = ''; if ($success) { $message = _l('updated_successfuly', _l('invoice_item')); } echo json_encode(array( 'success' => $success, 'message' => $message )); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postEditItems()\n\t{\n\t\tif (!$this->request->ajax()) { return $this->ajaxErrorResponse(); }\n\n\t\t// Get the properties that will be applied to all items.\n\t\t$properties = [\n\t\t\t'buyRaw' => $this->request->input('buyRaw' ) ? true : false,\n\t\t\t'buyRecycled' => $this->request->input('buyRecycled' ) ? true : false,\n\t\t\t'buyRefined' => $this->request->input('buyRefined' ) ? true : false,\n\t\t\t'buyModifier' => $this->request->input('buyModifier' ) ? : 0.00,\n\t\t\t'sell' => $this->request->input('sell' ) ? true : false,\n\t\t\t'sellModifier' => $this->request->input('sellModifier') ? : 0.00,\n\t\t\t'lockPrices' => $this->request->input('lockPrices' ) ? true : false,\n\t\t\t'source' => $this->request->input('source' ) ? : \"Jita\",\n\t\t];\n\n\t\t$properties['buyModifier'] = is_numeric($properties['buyModifier'])\n\t\t\t? (double)$properties['buyModifier' ] : 0.00;\n\n\t\t$properties['sellModifier'] = is_numeric($properties['sellModifier'])\n\t\t\t? (double)$properties['sellModifier'] : 0.00;\n\n\t\t// Get the properties that will be applied to single items.\n\t\t$property = [\n\t\t\t'buyPrice' => $this->request->input('buyPrice' ) ?: 0.00,\n\t\t\t'sellPrice' => $this->request->input('sellPrice') ?: 0.00,\n\t\t];\n\n\t\t$property['buyPrice'] = is_numeric($property['buyPrice'])\n\t\t\t? (double)$property['buyPrice' ] : 0.00;\n\n\t\t$property['sellPrice'] = is_numeric($property['sellPrice'])\n\t\t\t? (double)$property['sellPrice'] : 0.00;\n\n\t\t// Get the items being updated.\n\t\t$ids = explode(',', $this->request->input('items'));\n\t\t$ids = count($ids) && $ids[0] != '' ? $ids : [];\n\t\t$items = $this->item_model->whereIn('typeID', $ids)->get();\n\n\t\ttry {\n\t\t\tif ($items->count() == 0) { throw new \\Exception(''); }\n\n\t\t\tDB::transaction(function () use ($items, $properties, $property) {\n\t\t\t\t// Update a single item.\n\t\t\t\tif ($items->count() == 1) {\n\t\t\t\t\t$items[0]->update(array_merge($properties, $property));\n\n\t\t\t\t// Update multiple items.\n\t\t\t\t} else if ($items->count() > 1) {\n\t\t\t\t\t$items->each(function ($item) use ($properties) {\n\t\t\t\t\t\t$item->update($properties);\n\t\t\t\t\t});\n\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\t\t\ttrans('buyback.messages.edit_items_nothing', $items->count()));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn $this->ajaxSuccessResponse(\n\t\t\t\ttrans_choice('buyback.messages.edit_items_success', $items->count() == 1 ? 1 : 2));\n\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\ttrans_choice('buyback.messages.edit_items_failure', $items->count() == 1 ? 1 : 2));\n\t\t}\n\t}", "public function update()\n\t{\n\t\tif (app::is_ajax())\n\t\t{\n\t\t\t$values = new stdClass;\n\t\t\t$values->id = $this->input->post('inline-id');\n\t\t\t$values->title = $this->input->post('inline-title');\n\t\t\t$values->url = $this->input->post('inline-url');\n\t\t\n\t\t\tif ($this->rownd->save($values))\n\t\t\t{\n\t\t\t\t$title = character_limiter($values->title, 56, '...');\n\t\t\t\t$this->output->set_content_type('application/json')\n\t\t\t\t\t\t\t ->set_output(json_encode(array('id'=>$values->id, 'title'=> $title, 'url'=>$values->url)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect('/');\n\t\t}\n\t}", "public function actionAjaxupdateview()\n\t{\n\t\tif(isset($_GET['fastedit']))\n\t\t{\n\t\t\t$this->renderPartial('_metadatabox',array(\n\t\t\t\t'dataProvider'=>Image::model()->findByPk($_GET['id']),\n\t\t\t\t'fastedit'=>true,\n\t\t\t));\t\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$this->renderPartial('_metadatabox',array('dataProvider'=>Image::model()->findByPk($_GET['id']),));\n\t\t}\t\t\t\t\n\t}", "public function updateItem(ItemRequest $request,$id)\n {\n \n }", "public function edit( $id)\n {\n //obtengo el objeto para ser usado en el javascript click edit\n if(request()->ajax())\n {\n $data = TipoItem::findOrFail($id);\n return response()->json(['data' => $data]);\n }\n }", "public function edit(Items $items)\n {\n //\n }", "function bodyEdit($request){\r\n global $context;\r\n try{\r\n $data=new $this->model;\r\n\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many')\r\n $data->data[$key]=$request->body[$key];\r\n }\r\n //print_r($data);\r\n if(!$data->update()){\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n }\r\n if($request->isAjax()) return json_success(\"Save Success !!\");\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }", "public static function update(){\n\t\tif(isset($_GET['id'])){\n\t\t\tif($_GET['id'] === \"\") {\n\t\t\t\theader('Location: customers.php');\n\t\t\t}\n\t\t\t$sql = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM item\n\t\t\t\tWHERE id = :id\n\t\t\t\t\";\n\t\t\t$prepare_values = [\n\t\t\t\t':id' => $_GET['id']\n\t\t\t\t];\n\t\t\t// Make a PDO statement\n\t\t\t$statement = DB::prepare($sql);\n\n\t\t\t// Execute\n\t\t\tDB::execute($statement, $prepare_values);\n\n\t\t\t// Get all the results of the statement into an array\n\t\t\t$results = $statement->fetchAll();\n\n\t\t\t// Get the first result as a row\n\t\t\t$row = $results[0];\n\t\t\t$item_name = $row['name'];\n\t\t\t$price = $row['price'];\n\t\t\t$id = $row['id'];\n\t\t\t// Initialize template for updating item\n\t\t\t$template = \"\n\t\t\t<form method=\\\"POST\\\" action=\\\"update_item.php?id=$id\\\">\n\t\t\t\t<label>Item</label>\n\t\t\t\t<input type=\\\"text\\\" name=\\\"name\\\" value=\\\"$item_name\\\">\n\t\t\t\t<label>Price</label>\n\t\t\t\t<input type=\\\"text\\\" name=\\\"price\\\" value=\\\"$price\\\">\n\t\t\t\t<button>Update</button>\n\t\t\t</form>\";\n\t\t} else {\n\t\t\t// Initialize template for adding item\n\t\t\t$template = '\n\t\t\t<form method=\"POST\" action=\"new_item.php\">\n\t\t\t\t<label>Item</label>\n\t\t\t\t<input type=\"text\" name=\"name\" value=\"\">\n\t\t\t\t<label>Price</label>\n\t\t\t\t<input type=\"text\" name=\"price\" value=\"\">\n\t\t\t\t<button>Add</button>\n\t\t\t</form>';\n\t\t}\n\t\treturn $template;\n\t}", "public function edit($id)\n {\n $this->load->database();\n $q = $this->db->get_where('items', array('id' => $id));\n echo json_encode($q->row());\n }", "function _update_item() {\n if ($_POST['id']) {\n $item = \\Model\\Item::find($_POST['id']);\n unset($_POST['id']);\n } else {\n $item = new \\Model\\Item();\n }\n \n if (isset($_POST['flags'])) { \n $item->flags = '';\n \n foreach ($_POST['flags'] as &$flag) {\n $flag = implode(':',$flag);\n }\n \n $item->flags = implode(',',$_POST['flags']);\n }\n \n foreach ($_POST as $name => $value) {\n if (!is_array($value)) {\n $item->$name = $value;\n }\n }\n \n // Make sure the stock is something\n if (!$item->stock)\n $item->stock = 0;\n \n $item->save();\n \n // Check if we need to delete any options\n $options = \\Model\\Itemoption::all(\n array('conditions' => \"itemid = {$item->id}\"));\n \n foreach ($options as $option) {\n foreach ($_POST['options'] as $new_option) {\n if ($new_option['id'] == $option->id) {\n continue 2;\n }\n }\n $option->delete();\n }\n \n if (isset($_POST['options'])) {\n foreach ($_POST['options'] as $option_data) {\n if ($option_data['id']) {\n $option = \\Model\\Itemoption::find($option_data['id']);\n unset($option_data['id']);\n } else {\n $option = new \\Model\\Itemoption();\n }\n \n foreach($option_data as $name => $value) {\n $option->$name = $value;\n }\n \n $option->itemid = $item->id;\n \n $option->save();\n } \n }\n \n $i = $item;\n \n ?>\n <tr data-search=\"<?=$i->number.' '.$i->name?>\" class=\"item-<?=$i->id?>\">\n <td><?=$i->number?></td>\n <td><?=$i->name?></td>\n <td><?=$i->short_description()?></td>\n <td>$<?=$i->price?></td>\n <td><?=$i->formated_weight()?></td>\n <td><?=$i->image_tag()?></td>\n <td><?=$i->display_flags()?></td>\n <td><?=$i->display_stock()?></td>\n <td>\n <button class=\"btn btn-mini btn-danger delete-item\" value=\"<?=sc_cp('Stock/delete_item/'.$i->id)?>\"><i class=\"icon-remove\"></i></button>\n <button class=\"btn btn-mini btn-primary edit-item\" value=\"<?=sc_cp('Stock/edit_item/'.$i->id)?>\"><i class=\"icon-pencil\"></i></button>\n </td>\n </tr>\n <?php \n \n }", "public function update(Request $request, Items $items)\n {\n //\n }", "public function update(){\n\n\t\t/* set method */\n\t\t$this->request_method = 'update';\n\t\t\t\t\n\t\t/* check for a model id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 10, 'No model id in request, cant update' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* read the data received from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* get the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\n\t\t \t\t\t \t\n\t\t/* insert database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */ //improve this for coded api calls, like when setting up bootstrap data (for reading it is no problem any way, because this check is only made for update and create and delete)\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('edit_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 11, 'no user privileges to update the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$result = wp_update_post( $post );\n\t\t\t\t\n\t\t\t\t/* maybe an error while updating */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 12, 'updating the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* geting the id means update was a success */\n\t\t\t\t$updated_id = $result;\n\t\t\t\t\n\t\t\t\t/* save custom data, this only method does all the magic, \n\t\t\t\tdetails must be specified in the custom package handlers */\n\t\t\t\t$this->_action_custom_package_data( $updated_id, $item_data);\t\n\t\t\t\t\n\t\t\t\t/* set a clean response */\n\t\t\t\t$this->parse_model_response($updated_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t\n\t\t\t\t/* comment updateding is not supported */\n\t\t\t\t$this->set_error( 13, 'comments cant be updated!' );\n\t\t\t\t\treturn; \n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\n\t\t\tbreak;\n\t\t}\n do_action('bb-wp-api_after_update', $updated_id, $this->properties, $this );\n\t\n\t}", "public function editAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tforeach ($itemsList as $key=>$value) {\n\t \t$value['type'] = $value['type'] == 1 ? $this->ITEMTYPE[0] : $this->ITEMTYPE[1];//'gift':礼包,'link':链接\n \t $itemsList[$key] = $value;\n \t}\n \t\n \t$this->assign('info', $info);\n \t$this->assign('itemsList', $itemsList);\n $giftNameList = $this->getGiftName($itemsList);\n $this->assign('giftNameList', $giftNameList);\n \n \t$this->assign('dataType', $info[\"type\"] == 1 ?$this->DATATYPE[0] : $this->DATATYPE[1]);\n $this->assign('dataTypes', $this->DATATYPE);\n }", "public function updateItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'integer|min:1',\n 'itemTypeId' => 'integer|min:1',\n 'categoryId' => 'integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input('authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n $id = $this->request->id;\n try {\n $item = new ItemService();\n $result = $item->updateItem($items, $id);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'message' => 'Item Updated Successfully',\n ], 200);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be updated'\n ], 400);\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured updating Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function updateAjaxAction()\n {\n $request = $this->getRequest();\n\n if($request->isXmlHttpRequest()) {\n\n $id = $request->request->get('id');\n $value = $request->request->get('value');\n $type = $request->request->get('type');\n\n $em = $this->getDoctrine()->getManager();\n $parametre = $em->getRepository('InterneGlobalBundle:Parametre')->find($id);\n\n if($parametre != null)\n {\n switch($type)\n {\n case 'string':\n $parametre->setString($value);\n break;\n case 'number':\n $parametre->setNumber($value);\n break;\n case 'text':\n $parametre->setText($value);\n break;\n case 'choice':\n $parametre->setChoice($value);\n break;\n }\n $em->flush();\n return new Response();\n }\n }\n return new Response();\n\n }", "function updateItem() {\n //print_r($query);*/\n //print_r($_REQUEST);\n if (isset($_REQUEST['entity'])) {\n $entity = strtolower($_REQUEST['entity']);\n }\n else {\n return $this->showStart();\n }\n if (isset($_REQUEST['id'])) {\n $id = $_REQUEST['id'];\n /* if submitted, update the details\n * get entity details by id \n * print the details\n */\n if (isset($_REQUEST[\"submitted\"])) {\n $this->error .= \"<pre>submitted</pre>\";\n /*\n * (entity)_column_1=xyz\n */\n $insert_values = array();\n $remove_entity = $entity . '_';\n foreach($_REQUEST as $key=>$value){\n\t$hyphen = strpos($key, $remove_entity);\n\tif ($hyphen !== false) {\n\t $column = substr($key, $hyphen + strlen($remove_entity));\n\t $insert_values[$column] = $value;\n\t}\n }\n $id = $this->updateThing($entity, $id, $insert_values);\n //$_REQUEST['parent_id'] = $parent_id;\n //$_REQUEST['parent_entity'] = $parent_entity;\n }\n if (!is_array($id)) {\n $id_array = array($entity . '_id' => $id);\n }\n else {\n $id_array = $id;\n }\n $itemlist = $this->getListFromDB($entity, $id_array);\n $item_vars = array();\n if (isset($itemlist) and count($itemlist) > 0) {\n $item = $itemlist[0];\n $item_props = get_object_vars($item);\n $item_vars = array_values($item_props);\n }\n\n\n \n }\n \n else {\n $_REQUEST['entity'] = $entity;\n return $this->modifyTemplate();\n }\n $destination='update_item';\n $special = new StdClass();\n $special->active = false;\n /* would be nice to have a more generic solution here*/\n if (strtolower($entity) == 'category') {\n $special->active = true;\n $special->entity = 'template_price';\n $special->destination = 'template_admin';\n $special->action = $this->action . '?mode=' . $special->destination . '&entity=' . $special->entity . '&parent_entity=' . $entity . '&parent_id='. $id;\n }\n $returnurl = $this->action . '?mode=' . $entity .'_admin';\n if (isset($_REQUEST['parent_entity']) && isset($_REQUEST['parent_id'])){\n $parent_entity = $_REQUEST['parent_entity'];\n $parent_id = $_REQUEST['parent_id'];\n $conditions = array(strtolower($parent_entity) . '_id' => $parent_id);\n $returnurl .= '&entity='. $entity .'&parent_entity='.$parent_entity.'&parent_id='.$parent_id;\n \n}\n//&id='. $id;\n$add_id = http_build_query(array('id' => $id));\n\t\t\t $action = $this->action . '?mode=' . $destination . '&entity=' . $entity .'&'. $add_id;\n $properties = $this->getPropertyList($entity);\n foreach($properties as $property) {\n if (is_array($property)){\n $subtype1 = array_keys($property);\n $subtype = $subtype1[0];\n $working_array = $property[$subtype];\n foreach($working_array as $subthing) {\n\t$subthing->id = reset($subthing);\n\t$subthing->description = next($subthing);\n }\n }\n \n }\n \n\n /* screen output*/\n $t = 'admin-update.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $this->error,\n\t\t\t 'entity' => $entity,\n\t\t\t 'properties' => $properties,\n\t\t\t 'returnurl' => $returnurl,\n\t\t\t 'action' => $action,\n\t\t\t 'item' => $item_vars,\n\t\t\t 'special' => $special,\n\t\t\t 'parent_entity' => $parent_entity,\n\t\t\t 'parent_id' => $parent_id\n\t\t\t ));\n return $output; \n}", "function postEdit($request){\r\n global $context;\r\n $data=new $this->model;\r\n try\r\n {\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many')\r\n $data->data[$key]=$request->post[$key];\r\n }\r\n\r\n //print_r($data);\r\n if(!$data->update()){\r\n\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n\r\n }\r\n\r\n\r\n if($request->isAjax()) return json_success(\"Save Success !!\");\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }\r\n catch (\\Exception $ex)\r\n {\r\n if($request->isAjax()) return json_error($ex->getMessage().$obj->error);\r\n return $this->view(\"Error/index\",['ErrorNumber'=>0,'ErrorMessage'=>$ex->getMessage().$obj->error]);\r\n }\r\n }", "public function ajaxAdminEditItem($formData) {\n\t\t$objResponse = new xajaxResponse();\n\n\t\tif (!is_array($formData) || count($formData) == 0)\n\t\t\treturn $objResponse;\n\n\t\t$data = $formData['formData'];\n\t\t$sprzedaz = new Allegro_Sprzedaz();\n\t\tif( (int)$data['id_konto'] > 0) {\n\t\t\t$sprzedaz->idKonto = $data['id_konto'];\n\t\t} else {\n\t\t\t$sprzedaz->setIdKontoByIdSerwis($data['id_serwisu']);\n\t\t}\n\t\t\n\t\tif(mb_strlen($data[\"fid\"][1], \"utf8\") > 50) {\n\t\t\t\n\t\t\t$objResponse->alert('Wystąpił błąd: Zbyt długa nazwa aukcji \"'.$data[\"fid\"][1].'\" ('.mb_strlen($data[\"fid\"][1], \"utf8\").')');\n\t\t\t$objResponse->script(\"document.getElementById('btnWystaw').innerHTML = 'Wystaw';\n\t\t\t\t\t\t\t\t document.getElementById('btnWystaw').disabled = false;\");\n\t\t\treturn $objResponse;\n\t\t}\n\t\t\n\t\t\n\t\tif (trim($data['data_cron']) != '' && trim($data['data_cron_time']) != '') {\n\t\t\t$aukcja = new Allegro();\n\t\t\t$aukcja->data = $data;\t\t\t\n\n\t\t\tforeach($sprzedaz->getSzablonDostawyFids($data['id_szablon_dostawy']) as $fid=>$val) {\n\t\t\t\t$aukcja->data['fid'][$fid] = $val;\n\t\t\t}\n\n\t\t\t$aukcja->data['data_cron'] = $data['data_cron'] . ' ' . $data['data_cron_time'] . ':00';\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$sprzedaz->zapiszAukcje($aukcja, $aukcja->data['data_cron']);\n\t\t\t\t$objResponse->assign(\"editContent\", \"innerHTML\", self::ajaxGetEditResultHTML(0));\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo $e;\n\t\t\t\t$objResponse->alert('Wystąpił błąd: ' . $e->getMessage());\n\t\t\t\t$objResponse->script(\"document.getElementById('btnWystaw').innerHTML = 'Wystaw';\n\t\t\t\t\t\t\t\t document.getElementById('btnWystaw').disabled = false;\");\n\t\t\t} \n\t\t} else {\n\n\t\t\ttry {\n\t\t\t\t$sprzedaz->setAllegroApi($data['id_serwisu'], $data['id_konto']);\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$objResponse->alert('Wystąpił błąd: ' . $e->getMessage());\n\t\t\t\treturn $objResponse;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$apiResult = $sprzedaz->sprzedaz($data);\n\t\t\t\t$objResponse->assign(\"editContent\", \"innerHTML\", self::ajaxGetEditResultHTML((int) $apiResult[\"item-id\"]));\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$objResponse->alert('Wystąpił błąd: ' . $e->getMessage());\n\t\t\t\t$objResponse->script(\"document.getElementById('btnWystaw').innerHTML = 'Wystaw';\n\t\t\t\t\t\t\t\t document.getElementById('btnWystaw').disabled = false;\");\n\t\t\t} \t\t\t\t\n\n\t\t}\t\n\t\t\n\t\treturn $objResponse;\n\t}", "public function update(Request $request, Item $item)\n {\n //\n }", "public function update(Request $request, Item $item)\n {\n //\n }", "public function update(Request $request, Item $item)\n {\n //\n }", "public function laodForEditUnite()\n {\n $this->layout->assign('unite', $this->Unite->get_by('uniid', $this->input->idUnite));\n $contentAjax = $this->layout->ajax('unite' . DS . 'ajax' . DS . 'edit');\n echo json_encode(['modalBody' => $contentAjax]);\n }", "public function editAction()\n {\n \n $id = $this->_request->getParam(\"id\");\n \n // Get object from form Request\n $request_info=array();\n // Get value from Request POST\n $body = $this->_request->getParam(\"desc\");\n // to send Id to database\n $request_info['id']=$id;\n $request_info['desc']=$body;\n // Get object from model Requests\n $request_model=new Application_Model_Requests();\n // Calling edit request function to edit data\n $request_model->editRequest($request_info);\n // redirect to list Request\n // $this->redirect(\"Requests/list\");\n\n\t \n \n \n \n }", "public function editAction()\n {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata);\n $details['id'] = $request;\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->mlsEdit($details);\n $result = json_encode($result[0]);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "public function ajax_update()\n {\n if($this->input->post('status') === 'Gesloten')\n {\n $today = date(\"Y-m-d H:i:s\");\n $this->_validate();\n $data = array(\n 'TK_Status' => $this->input->post('status'),\n 'TK_Prioriteit' => $this->input->post('prioriteit'),\n 'TK_Categorie' => $this->input->post('Categorie'),\n 'TK_Sluitdatum' => $today,\n 'TK_WerkmanID' => $this->input->post('werknemers'),\n );\n }\n else{\n $this->_validate();\n $data = array(\n 'TK_Status' => $this->input->post('status'),\n 'TK_Prioriteit' => $this->input->post('prioriteit'),\n 'TK_Categorie' => $this->input->post('Categorie'),\n 'TK_WerkmanID' => $this->input->post('werknemers'),\n );\n }\n\n\n\t\t$this->Dispatcher_model->update(array('TK_ID' => $this->input->post('id')), $data);\n\n\t\techo json_encode(array('status' => TRUE));\n }", "public function actionUpdate($id)\n{\n$model=$this->loadModel($id,array('itemSizes','itemAddOns'));\n$menu=Menu::model()->findAllByAttributes(array('deleted'=>0,'is_available'=>1));\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\nif(isset($_POST['MenuItems']))\n{\n$model->attributes=$_POST['MenuItems'];\nif($model->save())\n$this->redirect(array('update','id'=>$model->id));\n}\n\n $this->render('update',compact('model','menu'));\n}", "public function editAction()\r\n {\r\n $modelPage = $this->getServiceLocator()->get('DotsPages\\Db\\Model\\Page');\r\n $modelNavBlock = $this->getServiceLocator()->get('DotsNavBlock\\Db\\Model\\NavigationBlock');\r\n $QUERY = $this->getRequest()->getQuery()->toArray();\r\n $nav = $modelNavBlock->getById($QUERY['id']);\r\n $data = $nav->toArray();\r\n switch($data['type']){\r\n case 'link':\r\n $data['link'] = $data['href'];\r\n break;\r\n case 'page':\r\n if ($data['entity_id']){\r\n $page = $modelPage->getById($data['entity_id']);\r\n $data['page'] = $page->title;\r\n }\r\n break;\r\n }\r\n\r\n $form = $this->getEditItemForm();\r\n $form->setData(array('navigation'=>$data));\r\n $response = $this->getResponse();\r\n $content = $this->renderViewModel('dots-nav-block/item-edit', array('form' => $form));\r\n $response->setContent($content);\r\n return $response;\r\n }", "public function compAjaxUpdate() {\r\n $req = $this->input->post('req');\r\n updateComponentDetails($req);\r\n }", "function OnEditItem(){\n if (! $this->error) {\n if ($this->disabled_edit) {\n }\n if ($this->item_id != 0) {\n\n $this->_data = $this->Storage->{$this->GetItemMethod}(array(\n $this->key_field => $this->item_id));\n $form_data = $this->Request->Form;\n $this->_data = array_merge($this->_data, $this->Request->Form);\n if ($this->multilevel) {\n $this->parent_id = $this->_data[$this->parent_field];\n }\n }\n $this->OnBeforeCreateEditControl();\n $this->InitItemsEditControl();\n } //!error\n }", "public function edit($id)\n {\n $item = Item::find($id);\n if($item != null){\n return response()->json([\n 'status_code'=>200,\n 'status_message'=>'success',\n 'data'=>[\n 'unit_price'=>$item->unit_price,\n 'item_name'=>$item->item_name,\n 'id'=>$item->id\n ]\n ]);\n }\n }", "public function editAjaxAction(Request $request){\n try {\n $em = $this->getDoctrine()->getManager();\n \n $data = $request->get('accetic_product');\n $id = $data['id'];\n $product = $em->getRepository('MorusAcceticBundle:Product')->find($id);\n $product->setItemcode(array_key_exists('itemcode', $data) ? $data['itemcode'] : null);\n $product->setItemname(array_key_exists('itemname', $data) ? $data['itemname'] : null);\n $product->setUnit(array_key_exists('unit', $data) ? $data['unit'] : null);\n $product->setForsale(array_key_exists('forsale', $data) ? $data['forsale'] : null);\n $product->setListprice(array_key_exists('listprice', $data) ? floatval($data['listprice']) : null);\n $product->setSaleDescription(array_key_exists('saleDescription', $data) ? $data['saleDescription'] : null);\n $product->setForpurchase(array_key_exists('forpurchase', $data) ? $data['forpurchase'] : null);\n $product->setLastcost(array_key_exists('lastcost', $data) ? floatval($data['lastcost']) : null);\n $product->setPurchaseDescription(array_key_exists('purchaseDescription', $data) ? $data['purchaseDescription'] : null);\n \n \n $em->persist($product);\n \n $em->flush();\n \n return new Response(json_encode(array(\n \"success\" => true\n )));\n } catch (Exception $ex) {\n return new Response(json_encode(array(\n \"success\" => false\n )));\n }\n }", "public function update(Request $request, $type=null,$item_id,$id)\n {\n //\n }", "function edit_list($ajax_php_file, $dbname, $table_name, $is_current_vocs) {\n\t//echo \"<br>Tabellennname:$table_name<br>\";\n\t// erhält von Javascript die id des Pools, der angezeigt werden soll\n\t// table_name ist der name des Tabellenregister mit der Sammlung von Listen\n\n// löscht einen Eintrag aus Users lists\n\t// wird von js-Funktion delete_row ausgeführt\n\tif (isset($_GET['delete_row'])) {\n\t\t$array = $_GET['delete_row'];\n\t\t$array = json_decode(stripslashes($array));\n\t\t$pool_id = $array[0];\n\t\t$row_id = $array[1];\n\t\t$sql = \"DELETE FROM `$dbname` . `vocs_usr` WHERE `vocs_usr`.`id` = $row_id;\";\n\t\tsimplequery($sql);\n\t\t//display_edit_vocs($ajax_php_file,$dbname, $table_name,$is_current_vocs, $pool_id);\n\t}\n\n// Vokabel aus Current Vocs bearbeiten\n\tif (isset($_GET['edit_row'])) {\n\t\t$array = $_GET['edit_row'];\n\t\t$array = json_decode(stripslashes($array));\n\t\t// Struktur des Js arrays: new Array(type,field_value,table_id,row_id);\n\t\t$type = $array[0];\n\t\t$field_value = utf8_encode($array[1]);\n\t\t$pool_id = $array[2];\n\t\t$row_id = $array[3];\n\n\t\t//echo $sql;\n\t\t$sql = \"UPDATE `$dbname`.`$table_name` SET \";\n\t\tif ($type == \"q\") {\n\t\t\t$sql .= \" `Question`\";\n\t\t}\n\t\tif ($type == \"a\") {\n\t\t\t$sql .= \"`Answer`\";\n\t\t}\n\n\t\t$sql .= \" = '$field_value' WHERE `$table_name`.`Id` = $row_id;\";\n\t\t//echo \"<br>$sql\";\n\t\t$result = simplequery($sql);\n\t\tif ($result) {\n\t\t\techo \"Änderung erfolgreich,neuer Eintrag:<b> $field_value </b>\";\n\t\t}\n\t\t//display_edit_vocs($ajax_php_file,$dbname, $table_name,$is_current_vocs, $pool_id);\n\t}\n\n\t// speicher die neu hinzugefügten Felder eines Pools\n\tif (isset($_GET['save_added_vocs'])) {\n\t\t$array = $_GET['save_added_vocs'];\n\t\t$array = json_decode(stripslashes($array));\n\t\t// Struktur des Js arrays: new Array(type,field_value,table_id,row_id);\n\t\t$sql = $array[0];\n\t\t$pool_id = $array[1];\n\t\t//simplequery($sql);\n\t\tupdate_voc_object_array($pool_id, $dbname, $user_id, $current_vocs);\n\n\t}\n\n}", "public function actionUpdate() {}", "public function actionUpdate() {}", "function item($request){\r\n try{\r\n $data= new $this->model;\r\n\r\n\r\n $validate=new Validator();\r\n $validate->validate($request->get,['id'=>'Requierd|Integer']);\r\n\r\n\r\n\r\n $data= $data::find($request->get['id']);\r\n if(!$data){\r\n if($request->UseApi())\r\n {\r\n return json_error(\"Not found item\");\r\n }\r\n header(\"HTTP/1.0 404 Not Found\");\r\n return $this->view(\"Error/index\",['ErrorNumber'=>404]);\r\n }\r\n $data->mode='view';\r\n if($request->UseApi())\r\n {\r\n return json_success(\"Getting success\",$data);\r\n }\r\n\r\n //if($request->isAjax() ){\r\n // return json_success(\"Success\",$data);\r\n // }else{\r\n return $this->view(compact('data'));\r\n //}\r\n }catch(Exception $ex){\r\n if($request->isAjax() ){\r\n return json_error($ex->getMessage());\r\n }\r\n //else{\r\n echo $ex->getMessage();\r\n // }\r\n }\r\n }", "public function edit() \n {\n $post = Input::all();\n \n $bodyArrayKey = $this->model . '-Array';\n\t\tif(isset($post[$bodyArrayKey]) && !empty($post[$bodyArrayKey])) {\n $arrayInput = $post[$bodyArrayKey];\n\t\t\tparse_str($arrayInput, $output);\n $post[$this->model] = $output[$this->model] ;\n }\n \n $jsonKey = $this->model . '-Multiple';\n \n if(isset($post[$jsonKey]) && !empty($post[$jsonKey])) {\n $jsonInput = $post[$jsonKey];\n $arrayObject = json_decode($jsonInput);\n foreach($arrayObject as $key => $object) {\n $arrayObject[$key] = get_object_vars($object);\n }\n \n $post[$this->model] = $arrayObject;\n }\n \n $result = array();\n foreach ($post[$this->model] as $singlePost) {\n $singleResult = $this->updateSingleObject($singlePost);\n $result[] = $singleResult;\n }\n \n return $jsend = JSend\\JSendResponse::success($result);\n }", "public function editar()\n {\n\t\tif($this->_Method == \"POST\")\n\t\t{\n\t\t\t$this->editar_post();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editar_get();\n\t\t}\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "public function edit(Item $item)\n {\n //\n }", "function edit($request){\r\n //get edit\r\n\r\n \t$obj= new $this->model;\r\n $validate=new Validator();\r\n $validate->validate($request->get,['id'=>'Requierd|Integer']);\r\n\r\n\r\n\r\n $data= $obj::find($request->get['id']);\r\n\r\n if(!$data){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n if($request->UseApi())\r\n {\r\n return json_error(\"Not found item\");\r\n }\r\n\r\n return $this->view(\"Error/index\",['ErrorNumber'=>404]);\r\n }\r\n $data->mode='edit';\r\n\r\n if($request->UseApi())\r\n {\r\n return json_success(\"Getting success\",$data);\r\n }\r\n return $this->view(compact('data'));\r\n\r\n\r\n\r\n }", "public function actionUpdate()\n\t{\n if (Yii::app()->request->IsPostRequest) {\n // save posted data\n $_POST['validateOnly'] = ($this->post('ajax','') == 'article-comment-form');\n $result = FSM::run('Article.ArticleCommentAPI.save', $_POST);\n $model = $result->model; \n\n if ($this->post('ajax','') == 'article-comment-form'){\n echo $result->getActiveErrorMessages($result->model);\n Yii::app()->end();\n } \n if (! $result->hasErrors()) {\n $this->message = Yii::t('Core','Item has been saved successfully.');\n $this->redirect(array('update', 'id'=>$model->id));\n }\n } else {\n // show edit form\n $id = $this->get('id', 0);\n if ($id == 0) {\n $model = new ArticleComment();\n } else {\n $model = FSM::run('Article.ArticleCommentAPI.get', array('id' => $id))->model;\n }\n }\n \n $this->render('update', array('model' => $model));\n\t}", "public function updateItem($_id) {\n\t}", "public function update()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n // we use the given id to get the correct product\n show_view('views/admin/bodyparts/update.php',['bodyPart' => BodyPart::find($_GET['id'])]);\n } else { //case when we are writing the bodypart to the database\n $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_SPECIAL_CHARS);\n $part = filter_input(INPUT_POST, 'part', FILTER_SANITIZE_SPECIAL_CHARS);\n BodyPart::update($id, $part);\n redirect('body_parts', 'readAll');\n }\n\n }", "public function edit() {\r\n\t\tif (isset($_POST['title'])) {\r\n\t\t\t$id = (int)$_POST['id'];\r\n\t\t\t$data[MENUGROUP_TITLE] = trim($_POST['title']);\r\n\t\t\t$response['success'] = false;\r\n\t\t\tif ($this->db->update(MENUGROUP_TABLE, $data, MENUGROUP_ID . ' = ' . $id)) {\r\n\t\t\t\t$response['success'] = true;\r\n\t\t\t}\r\n\t\t\theader('Content-type: application/json');\r\n\t\t\techo json_encode($response);\r\n\t\t}\r\n\t}", "public function actionUpdate()\n\t{\n\t parent::actionUpdate();\n\t $dodetail=new Dodetail('search');\n\t $dodetail->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Dodetail']))\n\t\t$dodetail->attributes=$_GET['Dodetail'];\n\n\t\t$customer=new Customer('search');\n\t $customer->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Customer']))\n\t\t$customer->attributes=$_GET['Customer'];\n\n\t\t$product=new Product('search');\n\t $product->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Product']))\n\t\t$product->attributes=$_GET['Product'];\n\n\t\t$unitofmeasure=new Unitofmeasure('search');\n\t $unitofmeasure->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Unitofmeasure']))\n\t\t$unitofmeasure->attributes=$_GET['Unitofmeasure'];\n\n $soheader=new Soheader('search');\n\t $soheader->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Soheader']))\n\t\t$soheader->attributes=$_GET['Soheader'];\n\n $project=new Project('search');\n\t $project->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Project']))\n\t\t$project->attributes=$_GET['Project'];\n\n\t\t$id=$_POST['id'];\n\t $model=$this->loadModel($id[0]);\nif ($model != null)\n {\n if ($this->CheckDataLock($this->menuname, $id[0]) == false)\n {\n $this->InsertLock($this->menuname, $id[0]);\n echo CJSON::encode(array(\n 'status'=>'success',\n\t\t\t\t'doheaderid'=>$model->doheaderid,\n\t\t\t\t'dono'=>$model->dono,\n\t\t\t\t'dodate'=>$model->dodate,\n\t\t\t\t'postdate'=>$model->postdate,\n 'soheaderid'=>$model->soheaderid,\n 'sono'=>($model->soheader!==null)?$model->soheader->sono:\"\",\n 'projectid'=>$model->projectid,\n 'projectno'=>($model->project!==null)?$model->project->projectno:\"\",\n\t\t\t\t'addressbookid'=>$model->addressbookid,\n\t\t\t\t'fullname'=>($model->customer!==null)?$model->customer->fullname:\"\",\n\t\t\t\t'recordstatus'=>$model->recordstatus,\n 'div'=>$this->renderPartial('_form', array('model'=>$model,\n\t\t\t\t\t'dodetail'=>$dodetail,\n\t\t\t\t\t'customer'=>$customer,\n\t\t\t\t\t'product'=>$product,\n\t\t\t\t\t'unitofmeasure'=>$unitofmeasure,\n 'soheader'=>$soheader,\n 'project'=>$project), true)\n\t\t\t\t));\n Yii::app()->end();\n }\n }\n\t}", "public function ajax_update_keluarga()\n {\n $data['user_id'] = $this->user['id'];\n $update = $this->home->update_keluarga($data);\n\n if($update){\n echo json_encode(array(\"response\" => 'SUKSES', 'act' => \"upd\"));\n }else{\n echo json_encode(array(\"response\" => 'GAGAL', 'act' => \"upd\"));\n }\n }", "function editItem($id, $name, $quantity, $value){\n\t$username = \"dbu319t38\"; \n\t$password = \"!U8refRA\"; \n\t$dbServer = \"mysql.cs.iastate.edu\"; \n\t$dbName = \"db319t38\"; \n\t\n\tif (validateCSRF()){\t\n\t\t// Create connection \n\t\t$conn = new mysqli($dbServer, $username, $password, $dbName);\n\t\t\n\t\t// Check connection \n\t\tif ($conn->connect_error) { \n\t\t\tdie(\"Connection failed: \" . $conn->connect_error); \n\t\t}\n\n\t\t$sql = \"UPDATE inventory SET Name = '\" . $name . \"', Quantity = '\" . $quantity . \"', Value = '\" . $value . \"', Updated = '\" . date('Y-m-d') . \"' WHERE Id = \" . $id;\n\n\t\t$conn->query($sql);\n\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\treturn [\"success\" => true];\n\t\t} else {\n\t\t\treturn [\"success\" => false];\n\t\t}\n\t} else {\n\t\treturn [\"success\" => false, \"message\" => \"Error: CSRF Token has expired. Please reload the page and submit the form again.\"];\n\t}\n}", "public function edit($id = null){\n\t\t/* LOG DE USUARIOS ACESSAM ESTA TELA */\n\t\t$this->requestAction(array('controller'=>'users', 'action'=>'gravaLog', 'params'=>'/[items-edit]' ));\n\t\t\n\t\t//Atribui à variavel\n $item = $this->Item->findById($id);\n \n\t\t \n if ($this->request->is('post') || $this->request->is('put')){\n \n $this->Item->id = $id;\n\t\t\t\n\t\t\t//$tiraPrefixo = self::limitar($this->request->data['Item']['href'],3);\n\t\t\t\n\t\t\t$lingua = $this->request->data['Item']['language'];\t\t\t\n\t\t\t$lingua = $lingua.trim( strtolower(self::removeAcentos($this->request->data['Item']['name'])));\t\t\t\n\t\t\t$this->request->data['Item']['href'] = str_replace(\" \", \"-\", $lingua );\t\t\t\n\t\t\t\n\t\t\t \n if ($this->Item->save($this->request->data)){\n $this->Session->setFlash('Item alterado com sucesso.');\n $this->redirect(array('controller'=>'cards','action' => 'index'));\n }else{\n $this->Session->setFlash('Item não pode ser alterado.');\n }\n\t\t\n }\n\t\t\n\t\t//retorna os dados aos campos do formulário de edição \n if(!$this->request->data){\n $this->request->data = $item;\n }\n\t\t\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'text' => 'required',\n 'body' => 'required',\n ]);\n\n if ($validator->fails()) {\n return ['response'=>$validator->messages(),'success'=>false];\n }\n $item=Item::find($id);\n $item->text=$request->input('text');\n $item->body=$request->input('body');\n\n $item->save();\n\n return response()->json($item);\n }", "function view_items () {\r\n if ($this->ShouldUseAjax()) {\r\n if (!isset($this->params['form']['type']) || !isset($this->params['form']['typeId'])) {\r\n $this->autoRender = false;\r\n IERR('Form data incomplete.');\r\n return AJAX_ERROR_CODE;\r\n }\r\n\r\n $type = $this->params['form']['type'];\r\n $typeId = $this->params['form']['typeId'];\r\n\r\n if ($type == 'weapon')\r\n $typeName = $this->Item->WeaponType->GetWeaponTypeName($typeId);\r\n elseif ($type == 'armor')\r\n $typeName = $this->Item->ArmorType->GetArmorTypeName($typeId);\r\n\r\n\r\n $userItemIds = $this->Item->UserItem->ItemCatalogEntry->GetUserItemIdsByType($type, $typeId);\r\n $items = $this->Item->UserItem->ItemCatalogEntry->GetItemEntries($userItemIds);\r\n\r\n $this->set('items', $items);\r\n $this->set('itemType', $type);\r\n $this->set('typeName', $typeName);\r\n $this->set('itemTypeId', $typeId);\r\n return;\r\n }\r\n $this->fof();\r\n }", "public function index_put($id)\n {\n $input = $this->put();\n $this->db->update('items', $input, array('id'=>$id));\n \n $this->response(['Item updated successfully.'], REST_Controller::HTTP_OK);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $modelItem = $model->getItems()->all();\n if ($modelItem == null) {\n $modelItem = [new Item()];\n }\n\n $request = Yii::$app->getRequest();\n if ($request->isPost && $request->post('ajax') !== null) { // Ajax Tabular Validations\n $data = Yii::$app->request->post('Item', []);\n $models = [];\n foreach ($data as $i => $row) {\n $models[$i] = new Item();\n }\n Model::loadMultiple($models, Yii::$app->request->post());\n Yii::$app->response->format = Response::FORMAT_JSON;\n $result = ActiveForm::validateMultiple($models);\n\n $model->load(Yii::$app->request->post());\n $resultParent = ActiveForm::validate($model);\n return ArrayHelper::merge($result, $resultParent);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction(\n Transaction::SERIALIZABLE\n );\n\n try {\n if ($model->save()) {\n $post = Yii::$app->request->post('Item', []);\n\n if (!empty($modelItem)) {\n foreach ($modelItem as $k => $row) {\n if (!isset($post[$k]) && isset($row->id)) {\n $row->delete();\n unset($modelItem[$k]);\n }\n }\n }\n\n foreach ($post as $i => $field) {\n\n if (!isset($modelItem[$i])) {\n $modelItem[$i] = new Item();\n }\n\n if (UploadedFile::getInstance($modelItem[$i], '[' . $i . ']file') !== null) {\n $modelItem[$i]->setFile(UploadedFile::getInstance($modelItem[$i], '[' . $i . ']file'));\n }\n $modelItem[$i]->title = $field['title'];\n $modelItem[$i]->description = $field['description'];\n $modelItem[$i]->btnLink = $field['btnLink'];\n $modelItem[$i]->btnText = $field['btnText'];\n $modelItem[$i]->skedId = $model->id;\n $modelItem[$i]->save();\n\n }\n /*\n foreach ($modelItem as $i => $newModel) {\n $newModel->skedId = $model->id;\n $newModel->save();\n }\n */\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $transaction->rollBack();\n }\n } catch (\\Exception $e) {\n $transaction->rollBack();\n throw new BadRequestHttpException($e->getMessage(), 0, $e);\n }\n }\n\n\n return $this->render('update', [\n 'model' => $model,\n 'models' => $modelItem\n ]);\n }", "public function update(Request $request, $id)\n {\n //\n $datosItems = request()->except(['_token','_method']);\n Items::where('id','=',$id)->update($datosItems);\n \n $item=Items::findOrFail($id);\n return redirect('items');\n }", "public function postUpdateItems()\n\t{\n\t\tif (!$this->request->ajax()) { return $this->ajaxErrorResponse(); }\n\n\t\ttry {\n\t\t\t$this->dispatchNow($this->update_items_job);\n\n\t\t\treturn $this->ajaxSuccessResponse(\n\t\t\t\ttrans('buyback.messages.update_item_prices_success'));\n\n\t\t} catch (\\Exception $e) {\n\t\t\treturn $this->ajaxFailureResponse(\n\t\t\t\ttrans('buyback.messages.update_item_prices_failure'));\n\t\t}\n\t}", "public function updateAction()\n {\n $req = $this->get('request');\n $htmlId = $req->get('editorID');\n $newContent = $req->get('editabledata');\n $em = $this->getDoctrine()->getEntityManager();\n $content = $em->getRepository('AppBundle:StaticContent')\n ->findOneByHtmlId($htmlId);\n $content->setHtml($newContent);\n $em->persist($content);\n $em->flush();\n\n return new JsonResponse(array('status' => 'Database updated static element '.$htmlId.' New content: '.$newContent));\n }", "public function edit()\n {\n $postInformation = $this->input->post();\n $dataArray = array();\n foreach ($postInformation as $key => $value) {\n if ($key != \"lessonId\" and $key != \"moduleId\" && $key != \"file\") {\n $dataArray[\"dataToUpdate\"][$key] = $value;\n }\n }\n $dataArray[\"lessonId\"] = $this->input->post(\"lessonId\");\n $resultEditLesson = $this->Lesson_Model->edit($dataArray);\n echo json_encode($resultEditLesson);\n }", "public function edit($type=null,$item_id, $id)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function update($id){\n $items = Item::find($id);\n return view('update',['items'=>$items]);\n }", "public function edititemAction()\n {\n $this->defaultNoItemRoute = $this->toolboxRoute;\n\n //Run the editItem action method\n $viewList = parent::edititemAction();\n\n //Return the result\n return $viewList;\n }", "private function editar_get()\n {\n $item = $this->ObtenModelPostId();\n\t\t$lModel = new CicloModel(); \n \n //Pasamos a la vista toda la información que se desea representar\n\t\t$data['TituloPagina'] = \"Editar un grupo\";\n\t\t$data[\"Model\"] = $item;\n\t\t$data[\"ComboCiclos\"] = $lModel->ObtenerTodos();\n \n //Finalmente presentamos nuestra plantilla\n\t\theader (\"content-type: application/json; charset=utf-8\");\n $this->view->show($this->_Nombre.\"/editar.php\", $data);\n\t}", "public function update(Request $request, $id)\n {\n $this->validate($request , [\n 'name'=> 'required|string',\n 'description'=> 'required|string',\n ]); // Validasi Bro\n Item::find($id)->update($request->all()); //Proses Insert Disini\n return response()->json([\n 'message' => 'Successfully Updated :D',\n 'data' => Item::find($id)\n ]); // Respon ketika data terubah\n\n }", "public function update($id)\n {\n \n $insert = $this->input->post();\n $this->db->where('id', $id);\n $this->db->update('items', $insert);\n $q = $this->db->get_where('items', array('id' => $id));\n echo json_encode($insert);\n }", "public static function func_ajax_sav_menu() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $id = $_POST['id'];\n $name = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['desc']);\n $list = $wpdb->query($wpdb->prepare(\"UPDATE \" . $wpdb->prefix.self::$table_name. \" SET re_title = %s, re_day = %s, re_desc = %s WHERE re_int = \".$id,$name,$day,$desc ));\n echo \"success\";\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function update_item( \\WP_REST_Request $request ) {\n\t\treturn $this->not_yet_response();\n\t}", "abstract public function updateAjax($ajax_id, $id);", "public function editPostAction() {\n $inputVars = $this->getInput(array(\n \t\t'id', 'dataType', //主表字段:id,type\n \t\t \t'data'//子表字段\n ));\n \tlist($news, $itemsList) = $this->checkInput($inputVars);\n \t$id = intval($news['id']);\n \tlist($edit_info, $oldItemsList) = Admin_Service_Material::getById($id);\n \tif (!$edit_info ) {\n \t\t$this->failPostOutput('修改的素材不存在');\n \t}\n \t$result = Admin_Service_Material::edit($id, $news, $itemsList);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$this->successPostOutput($this->actions['listUrl']);\n }", "public function ajaxsaveAction()\n {\n //disable view in Ajax processing\n $this->view->disable();\n\n //getting request values\n $value = $this->request->get(\"value\");\n $id = $this->request->getPost(\"id\");\n $columnName = $this->request->getPost(\"columnName\");\n \n //getting row will be edited\n $os = Os::findFirstByid($id);\n if (!$os) {\n $data = \"Cannot found this ID: \" . $id;\n } else {\n $os->$columnName = $value;\n if( $os->save() == false ){\n $data = \"Cannot save to database\";\n }\n $data = $value;\n }\n echo $data;\n }", "public function editSlideItem(Request $request) {\n $item = SlideShowItem::findOrFail($request['item_id']);\n\n $item->text_en = $request['text_en'];\n $item->text_sr = $request['text_sr'];\n $item->text_hu = $request['text_hu'];\n $item->href_en = $request['href_en'];\n $item->href_sr = $request['href_sr'];\n $item->href_hu = $request['href_hu'];\n $item->type = $request['type'];\n $item->x = $request['x'];\n $item->y = $request['y'];\n $item->hoffset = $request['hoffset'];\n $item->voffset = $request['voffset'];\n $item->class = $request['class'];\n $item->speed = $request['speed'];\n $item->start = $request['start'];\n $item->depth = $request['depth'];\n $item->easing = $request['easing'];\n $item->endeasing = $request['endeasing'];\n $item->endspeed = $request['endspeed'];\n $item->customout = $request['customout'];\n $item->customin = $request['customin'];\n $item->save();\n\n $slide_image_id = $item->slide_show_image_id;\n\n return response()->json(['id' => $slide_image_id ]);\n }", "public function update(Request $request, $id)\n {\n $this->validation_rules($request);\n\n $itemUpdate=$request->input();\n\n $item=Item::find($id);\n $item->update($itemUpdate);\n\n Session::flash('flash_message', 'Data item layanan berhasil diupdate!');\n\n return redirect('admin/item');\n }", "public function ajax_edit($id)\n {\n $data = $this->Dispatcher_model->get_by_id($id);\n\t\techo json_encode($data);\n }", "public function updateAction()\r\n {\r\n $data = $this->params()->fromPost('data');\r\n\r\n if (!is_null($data)) {\r\n $updateData = Json::decode($data, Json::TYPE_ARRAY);\r\n if (is_array($updateData)) {\r\n if ($updateData[\"fields\"][\"lieuCommunautaire\"] && $updateData[\"fields\"][\"lieuCommunautaire\"]!=\"\" && $updateData[\"fields\"][\"lieuCommunautaire\"]!=null ) {\r\n $contentId = $updateData[\"fields\"][\"lieuCommunautaire\"];\r\n $lieu = $this->_dataService->findById($contentId, false, false);\r\n $updateData[\"fields\"][\"position\"] = $lieu[\"fields\"][\"position\"];\r\n $updateData[\"fields\"][\"positionName\"] = $lieu[\"text\"];\r\n }\r\n $returnArray = $this->_dataService->update($updateData, array(), false);\r\n } else {\r\n $returnArray = array(\r\n 'success' => false,\r\n \"msg\" => 'Not an array'\r\n );\r\n }\r\n } else {\r\n $returnArray = array(\r\n 'success' => false,\r\n \"msg\" => 'No Data'\r\n );\r\n }\r\n if (!$returnArray['success']) {\r\n $this->getResponse()->setStatusCode(500);\r\n }\r\n return $this->_returnJson($returnArray);\r\n }", "public function saveItem() \t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n { $this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $params = json_decode(file_get_contents('php://input'),true); //\n $thisItem=$params['fullData'];\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t//\n Controller::loadModel('Bugs');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $data = array();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['parentid'] = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['bugorfeature'] = $thisItem['bugorfeature']; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['fileid'] = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['dataObject'] = json_encode($thisItem['dataObject']); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['userid']=$this->Auth->user('id');\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['user']=$this->Auth->user('username');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $data['Bugs']['status'] = 0; \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $this->Bugs->id=$thisItem['id'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $this->Bugs->save($data);\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\n }", "public function postEdit(Request $request) {\n\n\t\t$this->validate($request, [\n\t\t\t'item' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'price' => 'required|numeric',\n\t\t\t'purchase_link' => 'required|url',\n\t\t\t'number_wanted' => 'required|integer']);\n\n\t\t$item = \\App\\Item::find($request->id);\n\n\t\t$item->item = $request->item;\n\t\t$item->description = $request->description;\n\t\t$item->price = $request->price;\n\t\t$item->purchase_link = $request->purchase_link;\n\t\t$item->number_wanted = $request->number_wanted;\n\t\t$item->number_remaining = $request->number_wanted;\n\n\t\t$item->save();\n\t\t\n\t\t\\Session::flash('message', 'Your item was updated');\n\n\t\treturn redirect('/wishlist');\n\t}", "function edit($id = null) {\n if (!$id) {\n $this->Session->setFlash(__('Invalid %s', __('item')), 'flash/error');\n $this->redirect(array('action' => 'index'));\n }\n\n if ($this->request->is('post') || $this->request->is('put')) {\n if ($this->Item->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('item')), 'flash/success');\n $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('item')), 'flash/failure');\n }\n } else {\n $this->request->data = $this->Item->details($id);\n }\n\n $this->set('categories', $this->Category->find('list'));\n $this->set('data', $this->request->data);\n }", "public function update($id){\n $item = Item ::find($id);\n $categorys= Category::all();\n return view('items.update',compact('item','categorys'))->with('title',\"Edit Item\");\n }", "public function edit(Request $request)\n {\n $eItemID = $request->input('eItemID');\n\n $data = item::join('categories', 'categories.id', '=', 'items.catid')->findOrFail($eItemID);\n\n return response()->json(['result' => $data]);\n }", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('id', 'name', 'link', 'img', 'sort', 'status', 'model_id','type_id'));\n\t\t$info = $this->_cookData($info);\n\t\t$ret = Browser_Service_Recsite::updateRecsite($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.'); \t\t\n\t}", "public function getEditItemForm(){\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][1] == '0' && $_SESSION[PAGE_SESSIONID]['privileges']['articles'][3] == '0') die($this->text('dont_have_permission'));\n \n $this->datavalidator->addValidation('id','req',$this->text('e6'));\n $this->datavalidator->addValidation('id','numeric',$this->text('e7'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }\n \n $temp = dibi::query('SELECT * FROM ' . DB_TABLEPREFIX . 'ARTICLES WHERE id='.$this->data['id']);\n $article = $temp->fetchAssoc('id');\n if(count($temp) == 1){\n $article = $article[$this->data['id']];\n\n //testng if article is in category wehere user can add articles\n if(!$this->isPranetOfMenuitem($_SESSION[PAGE_SESSIONID]['privileges']['categoryaccess'],$article['id_menucategory'])) return array('state'=>'error','data'=> $this->text('t7'));\n\n $_SESSION['articles_dirname'] = $this->data['id'];\n $markup = '<div><h4 class=\"left\">'.$this->text('edit_article').'</h4>';\n $article['dirname'] = $article['id'];\n $markup .= $this->getForm('update',$article);\n $markup .= '</div>';\n return array('state'=>'ok','data'=> $markup);\n }else{\n return array('state'=>'error','data'=> $this->text('e29'));\n }\n }", "#[Route(path: '/{id}/edit', name: 'lsitem_edit', methods: ['GET', 'POST'])]\n #[IsGranted(Permission::ITEM_EDIT, 'lsItem')]\n public function edit(Request $request, LsItem $lsItem, #[CurrentUser] User $user): Response\n {\n $ajax = $request->isXmlHttpRequest();\n\n try {\n $command = new LockItemCommand($lsItem, $user);\n $this->sendCommand($command);\n } catch (AlreadyLockedException $e) {\n return $this->render(\n 'framework/ls_item/locked.html.twig',\n []\n );\n }\n\n $deleteForm = $this->createDeleteForm($lsItem);\n $editForm = $this->createForm(LsItemType::class, $lsItem, ['ajax' => $ajax]);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n try {\n $command = new UpdateItemCommand($lsItem);\n $this->sendCommand($command);\n\n if ($ajax) {\n // if ajax call, return the item as json\n return $this->generateItemJsonResponse($lsItem);\n }\n\n return $this->redirectToRoute('lsitem_edit', ['id' => $lsItem->getId()]);\n } catch (\\Exception $e) {\n $editForm->addError(new FormError('Error updating item: '.$e->getMessage()));\n }\n }\n\n $ret = [\n 'lsItem' => $lsItem,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ];\n\n if ($ajax && $editForm->isSubmitted() && !$editForm->isValid()) {\n return $this->render('framework/ls_item/edit.html.twig', $ret, new Response('', Response::HTTP_UNPROCESSABLE_ENTITY));\n }\n\n return $this->render('framework/ls_item/edit.html.twig', $ret);\n }", "public function update(Request $request, $id)\n {\n $numRemoved = 0;\n try\n {\n $items = json_decode($request->getContent(), true);\n\n // Go through every item submitted and create it\n foreach($items as $elem)\n {\n $item = Item::find($elem['id']);\n $item->name = $elem['name'];\n $item->capacity = $elem['capacity'];\n $item->low_threshold = $elem['low_threshold'];\n $item->is_food = $elem['is_food'];\n $item->refrigerated = $elem['refrigerated'];\n $item->removed = $elem['removed'];\n $item->save();\n\n if ($item->removed == 'true')\n $numRemoved++;\n\n }\n\n return response([\n 'status' => 'item(s) modified',\n 'items_modified' => count($items),\n 'items_deleted' => $numRemoved], 200)\n ->header('Content-Type', 'text/plain');\n }\n catch (Exception $e)\n {\n // Attempt to catch a bad database store\n return response([\n 'status' => 'item modification failed',\n 'error' => $e->getMessage()\n ], 500);\n }\n }", "public function ajax($id)\n {\n\n $datosFaq=Faqs::findOrFail($id);\n if($datosFaq['activa']=='1'){\n $updateFaq=['activa'=>'0']; \n }elseif($datosFaq['activa']=='0'){\n $updateFaq=['activa'=>'1']; \n }else{\n print_r('Error!');\n }\n \n Faqs::where('id','=',$id)->update($updateFaq);\n }", "public function update(Request $request, ItemUser $itemUser)\n {\n //\n }", "function doEdit()\n {\n $dt = new lmbDate();\n $this->dt_up = $dt->getStamp();\n\n $node_id = $this->request->getInteger('id');\n $node['node_id'] = $node_id;\n $node['title'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_TITLE);\n $node['description'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_DESCR);\n $node['identifier'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_URI);\n $node['price'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_PRICE);\n\n $this->dt_cr = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $node['date_create'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $node['date_update'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_UPDATE_DATE);\n $node['is_branch'] = TreeItem::getIsBranchByNodeId($node_id);\n\n $this->setFormDatasource($node, 'object_form');\n\n $criteria = new lmbSQLFieldCriteria('is_branch', 1);\n $criteria->addAnd('attr_id = '. TreeItem::ID_TITLE );\n $this->items = lmbActiveRecord :: find('TreeItem', $criteria);\n\n\n if($this->request->hasPost())\n {\n $this->_validateAndSave(false);\n //$this->_onAfterSave();\n }\n }", "public function editAction() {\n $this->parent->getModel(\"fruits\")->update(\"update fruit_table set name = :name where id = :id\", array(\":name\"=>$_REQUEST[\"name\"], \":id\"=>$_REQUEST[\"id\"]));\n\n header(\"Location:/about\");\n }", "public function edit($id)\n {\n $item = $this->itemCRUD->find_item($id);\n\n\n $this->load->view('theme/header');\n $this->load->view('itemCRUD/edit',array('item'=>$item));\n $this->load->view('theme/footer');\n }", "public function updateAction() : object\n {\n if (isset($_SESSION['username'])) {\n $form = new UpdateForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/update\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Update an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function update(Request $request)\n {\n //\n $updateitem = item::findOrFail($request->editid);\n\n $updateitem->itemname = $request['eItemname'];\n $updateitem->itemdesc = $request['eItemDesc'];\n $updateitem->price = $request['ePrice'];\n $updateitem->quantity = $request['eQuantity'];\n $updateitem->catid = $request['catid'];\n\n\n\n if ($request['eItemname'] == NULL || $request['eItemDesc'] == NULL || $request['ePrice'] == NULL || $request['eQuantity'] == NULL) {\n $notification = array(\n 'message'=> 'Please fill up required fields!',\n 'alert-type' => 'error'\n );\n\n }else{\n $updateitem->save();\n $notification = array(\n 'message'=> 'Item updated successfully!',\n 'alert-type' => 'success'\n );\n\n }\n\n return back()->with($notification);\n\n\n\n }", "public function editItem($id,$item)\n\t{\n $this->db->trans_start();\n\t\t$this->db->where('id',$id);\n\t\t$this->db->update('item',$item);\n $this->db->trans_complete();\n\t}", "function OnDoEditItem(){\n if (! $this->error) {\n $this->_data = $this->GetFieldsData();\n $this->_data[$this->key_field] = $this->item_id;\n\n $this->ValidateBeforeAdd();\n\n $item = $this->Storage->{$this->GetItemMethod}(array(\n $this->key_field => $this->item_id));\n //set system fields\n $this->setItemSystemFields($this->_data, $item);\n\n //check for unique fields\n if ($this->listSettings->HasItem(\"MAIN\", \"UNIQUE_FIELDS\")) {\n $this->checkForDuplicateUnique();\n }\n\n if ($this->disabled_edit) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n }\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=LIBRARY_DISABLED_EDIT\" . \"&\" . $this->restore);\n }\n if (empty($this->validator->formerr_arr) && ! $this->child_error) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n $this->parent_id = $this->Request->ToNumber(\"custom_val\", 0);\n }\n //before edit event handler call\n $this->OnBeforeEdit();\n $this->UpdateRadioFields();\n $_result = $this->Storage->Update($this->_data);\n if ($_result){\n $this->InsertNotOrdinaryFields($this->_data);\n //after edit event handler call\n $this->OnAfterEdit();\n if ($this->is_context_frame)\n \t$url = \"?package=context&page=contextframe&event=refresh&MESSAGE[]=EDIT_ITEM_SAVED\";\n else\n \t$url = \"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=EDIT_ITEM_SAVED\" . \"&\" . $this->restore;\n\n $this->AfterSubmitRedirect($url);\n }\n }\n else {\n $this->event = \"EditItem\";\n }\n $this->OnBeforeCreateEditControl();\n $this->InitItemsEditControl();\n }\n }", "public function editAction()\n {\n $this->_title($this->__('Request price'))\n ->_title($this->__('Manage request price'));\n\n // 1. Instance RP model\n// /* @var $model Test_Requestprice_Model_Requestprice */\n $model = Mage::getModel('test_requestprice/requestprice');\n\n //2. Id ID exists check it and load data\n $reqpriceId = $this->getRequest()->getParam('id');\n if ($reqpriceId) {\n $model->load($reqpriceId);\n\n if (!$model->getId()) {\n $this->_getSession()->addError(\n Mage::helper('test_requestprice')->__('Request price item does not exist.')\n );\n return $this->_redirect('*/*/');\n }\n // prepare title\n $this->_title($model->getTitle());\n $breadCrumb = Mage::helper('test_requestprice')->__('Edit Item');\n } else {\n $this->_title(Mage::helper('test_requestprice')->__('New Item'));\n $breadCrumb = Mage::helper('test_requestprice')->__('New Item');\n }\n // init breadcrumbs\n $this->_initAction()->_addBreadcrumb($breadCrumb, $breadCrumb);\n\n // 3. Set entered data if there was an error during save\n $data = Mage::getSingleton('adminhtml/session')->getFormData(true);\n if (!empty($data)) {\n $model->addData($data);\n }\n\n // 4. Register model to use later in blocks\n Mage::register('requestprice_item', $model);\n\n // 5. Render layout\n $this->renderLayout();\n }", "public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }", "public function updateItem(){\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][1] == '0' && $_SESSION[PAGE_SESSIONID]['privileges']['articles'][3] == '0') die($this->text('dont_have_permission'));\n\n //checking if data is valid\n $result = $this->checkData();\n if($result !== true) return $result;\n \n //checking if user is allowed to edit article category articles\n if(!$this->isPranetOfMenuitem($_SESSION[PAGE_SESSIONID]['privileges']['categoryaccess'],$this->data['id_menucategory'])) return array('state'=>'error','data'=> $this->text('t7'));\n \n //if user cannot publish articles set values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '0') {\n unset($this->data['published']);\n unset($this->data['publish_date']);\n }\n\n $this->datavalidator->addValidation('id','req',$this->text('e6'));\n $this->datavalidator->addValidation('id','numeric',$this->text('e7'));\n \n //if user can change article ownership set values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][4] == '0') {\n unset($this->data['added_by']);\n }else{\n $this->datavalidator->addValidation('added_by','req',$this->text('e1'));\n $this->datavalidator->addValidation('added_by','numeric',$this->text('e2'));\n }\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }\n\n $id = $this->data['id'];\n unset($this->data['id']);\n\n if($this->data['keywords'] == ''){\n $keywordgenerator = new keywordgenerator($this->data['article_content'].' '.$this->data['article_prologue'].' '.$this->data['article_title']);\n $this->data['keywords'] = $keywordgenerator->get_keywords();\n }\n \n //pridal som koli chybe websupportu (low memory)////////////////////////\n //$article_content = preg_replace('/&/i','&amp;',html_entity_decode($this->data['article_content'],ENT_COMPAT,'UTF-8'));\n /*$article_content = $this->data['article_content'];\n unset($this->data['article_content']);*/\n \n if(strlen($this->data['keywords']) > 500) $this->data['keywords'] = substr($this->data['keywords'],0,500);\n $this->data['alias'] = $this->registry['textprocessors']->createClearAlphanumericString($this->data['article_title']);\n $this->data['updated_by'] = $_SESSION[PAGE_SESSIONID]['id'];\n $this->data['article_title'] = strtr($this->data['article_title'],$this->htmltranslation);\n $this->data['article_prologue'] = strtr($this->data['article_prologue'],$this->htmltranslation);\n $this->data['article_content'] = stripslashes($this->data['article_content']);\n $this->data['article_changeDate'] = date('Y-m-d H:i:s');\n $this->data['publish_date'] = date('Y-m-d H:i:s',strtotime($this->data['publish_date']));\n \n if($this->languager->getLangsCount() < 2){\n $this->data['lang'] = $this->languager->getDefaultLangId();\n }\n \n $temp = dibi::query(\"UPDATE \" . DB_TABLEPREFIX . \"ARTICLES SET \",$this->data,\"WHERE id='\" . $id .\"'\");\n $returnvalue = array();\n if ($temp == 0 || $temp == 1) {\n $returnvalue = array('state'=>'highlight','data'=> $this->text('article_saved'));\n }else {\n $returnvalue = array('state'=>'error','data'=> $this->text('e3'));\n }\n\n //pridal som koli chybe websupportu (low memory)////////////////////////\n /*if(DEVELOPMENT_STATUS == true){\n $link = mysql_connect(DB_DEV_HOST, DB_DEV_USER, DB_DEV_PASSWORD);\n if (!$link) $returnvalue .= 'Could not connect: ' . mysql_error();\n mysql_select_db(DB_DEV_NAME);\n }else{\n $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n if (!$link) $returnvalue .= 'Could not connect: ' . mysql_error();\n mysql_select_db(DB_NAME);\n }\n $temp = mysql_query(\"UPDATE \" . DB_TABLEPREFIX . \"ARTICLES SET article_content='\" . mysql_real_escape_string($article_content). \"' WHERE id=\" . $id);\n mysql_close();\n if($temp == false) $returnvalue['data'] .= '<br />Nastala chyba pri ukladaní obsahu článku do databázy!';*/\n //potom sa odstrani/////////////////////////////////////////////////////\n\n unset($_SESSION['articles_dirname']);\n\n return $returnvalue;\n }", "public function actionUpdate() {\n $json = file_get_contents('php://input'); //$GLOBALS['HTTP_RAW_POST_DATA'] is not preferred: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data\n $put_vars = CJSON::decode($json, true); //true means use associative array\n switch ($_GET['model']) {\n // Find respective model\n case 'Order':\n $model = Order::model()->findByPk($_GET['id']);\n break;\n case 'Users':\n $model = Users::model()->findByPk($_GET['id']);\n break;\n case 'Product':\n $model = Product::model()->findByPk($_GET['id']);\n break;\n case 'Vendor':\n $model = Vendor::model()->findByPk($_GET['id']);\n break;\n case 'FavoriteProduct':\n $model = FavoriteProduct::model()->findByPk($_GET['id']);\n break;\n case 'Rating':\n $model = Rating::model()->findByPk($_GET['id']);\n break;\n case 'Review':\n $model = Review::model()->findByPk($_GET['id']);\n break;\n case 'UserAddress':\n $model = UserAddress::model()->findByPk($_GET['id']);\n break;\n case 'OrderDetail':\n $model = OrderDetail::model()->findByPk($_GET['id']);\n break;\n default:\n $this->_sendResponse(0, sprintf('Error: Mode update is not implemented for model ', $_GET['model']));\n Yii::app()->end();\n }\n // Did we find the requested model? If not, raise an error\n if ($model === null)\n $this->_sendResponse(0, sprintf(\"Error: Didn't find any model with ID .\", $_GET['model'], $_GET['id']));\n\n // Try to assign PUT parameters to attributes\n unset($_POST['id']);\n foreach ($_POST as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var))\n $model->$var = $value;\n else {\n $this->_sendResponse(0, sprintf('Parameter %s is not allowed for model ', $var, $_GET['model']));\n }\n }\n // Try to save the model\n if ($model->update())\n $this->_sendResponse(1, '', $model);\n else\n $this->_sendResponse(0, $msg);\n // prepare the error $msg\n // see actionCreate\n // ...\n }", "public function editAction() {}", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function actionUpdate($id, $proveedor_codigo)\n {\n $request = Yii::$app->request;\n $model = $this->findModel($id, $proveedor_codigo); \n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n if($request->isGet){\n return [\n 'title'=> \"Update Compra #\".$id, $proveedor_codigo,\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }else if($model->load($request->post()) && $model->save()){\n return [\n 'forceReload'=>'#crud-datatable-pjax',\n 'title'=> \"Compra #\".$id, $proveedor_codigo,\n 'content'=>$this->renderAjax('view', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::a('Edit',['update','id, $proveedor_codigo'=>$id, $proveedor_codigo],['class'=>'btn btn-primary','role'=>'modal-remote'])\n ]; \n }else{\n return [\n 'title'=> \"Update Compra #\".$id, $proveedor_codigo,\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }\n }else{\n /*\n * Process for non-ajax request\n */\n if ($model->load($request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'proveedor_codigo' => $model->proveedor_codigo]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }" ]
[ "0.76676667", "0.6965389", "0.6912887", "0.6692407", "0.66850233", "0.66680074", "0.6642107", "0.6634659", "0.6607492", "0.6596909", "0.65926504", "0.6563988", "0.65273917", "0.6466764", "0.64519805", "0.644165", "0.6422748", "0.64189076", "0.64175564", "0.64175564", "0.64175564", "0.6406832", "0.6402551", "0.63973933", "0.6396037", "0.6395551", "0.63934976", "0.6385076", "0.6383238", "0.6345489", "0.63403714", "0.6336184", "0.6324572", "0.63168794", "0.63168794", "0.63130945", "0.63082284", "0.63042575", "0.63041544", "0.63041544", "0.63041544", "0.63041544", "0.62986475", "0.62931484", "0.62405235", "0.62385684", "0.62302005", "0.62283045", "0.62271714", "0.62256366", "0.6213475", "0.61878985", "0.6186222", "0.61731553", "0.6167068", "0.616564", "0.61583024", "0.61547595", "0.6150666", "0.61319333", "0.6127016", "0.6126214", "0.6125484", "0.6122908", "0.61212915", "0.61064756", "0.6100039", "0.60964435", "0.60910314", "0.6081902", "0.6071268", "0.6069728", "0.6067267", "0.60666335", "0.6064448", "0.60631603", "0.6053364", "0.6053224", "0.6051804", "0.60515356", "0.6043612", "0.6039813", "0.60384685", "0.6032946", "0.60320985", "0.6018997", "0.60100317", "0.6009788", "0.6008667", "0.6007585", "0.6005297", "0.59972036", "0.59921265", "0.5986939", "0.59866256", "0.5983942", "0.59834516", "0.5974343", "0.5972616", "0.5965687" ]
0.632244
33
/ Get item by id / ajax
public function get_item_by_id($id) { if ($this->input->is_ajax_request()) { $item = $this->invoice_items_model->get($id); $item->long_description = nl2br($item->long_description); echo json_encode($item); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getItem() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $id = $params['id'];\n try {\n $item = new Item;\n $item->getItem($id);\n View::renderJson($item);\n } catch (Exception $e) {\n View::renderJson(['status' => 0, 'message' => $e]);\n }\n }", "public function getItem( $id );", "public function getItem ($id);", "public function get( $id );", "public function get( $id ){}", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public abstract function get($id);", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function fetchJsonItem($id) {\n\t\t$this->autoRender = FALSE;\n\t\t$item = $this->Item->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Item.id' => $id\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'Image'\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Item.id as ItemId',\n\t\t\t\t'Item.name as CatalogName', \n\t\t\t\t'Item.max_quantity as CatalogMaxQuantity', \n\t\t\t\t'Item.price as CatalogPrice', \n\t\t\t\t'Item.description as CatalogDescription', \n\t\t\t\t'Item.item_code as CatalogItemCode', \n\t\t\t\t'Item.customer_item_code as CatalogCustomerItemCode',\n\t\t\t\t'Item.quantity as ItemQuantity'\n\t\t\t)\n\t\t));\n\t\t\n\t\t// move the image in and default it if necessary\n\t\t$idir = 'no';\n\t\t$iname = 'image.jpg';\n\t\tif (!empty($item['Image'][0]['img_file'])) {\n\t\t\t$iname = $item['Image'][0]['img_file'];\n\t\t\t$idir = $item['Image'][0]['id'];\n\t\t}\n\t\t$item['Item']['ajaxEditImage']['name'] = $iname;\n\t\t$item['Item']['ajaxEditImage']['dir'] = $idir;\n\t\t\n\t\treturn json_encode($item['Item']);\n//\t\treturn json_encode(array_merge($item, $item['Item']));\n\t}", "function get(string $id);", "public function getItem($id)\n {\n $items = articulo::where('idArticulo', '=', $id)->first();\n return response()->json($items);\n }", "function get($id){ \t\n \tif(isset($id)){\n \t\t$result = $this->model->selectWhere('*',\"id = \".\"'$id'\");\n \t\techo json_encode($result);\n \t}else{\n \t\techo json_encode('failed');\n \t} \t\n }", "public function getItem( $id )\n\t{\n\t\treturn $this->controller->getItem( $id );\n\t}", "public function get(string $id);", "public function getById( $id );", "abstract public function retrieve($id);", "public function show($id)\n {\n return response()->json(Item::find($id));\n }", "public function edit($id)\n {\n $this->load->database();\n $q = $this->db->get_where('items', array('id' => $id));\n echo json_encode($q->row());\n }", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "public function get_item($id) {\n\n //bind date to the statement.\n $this->get_item_statement->bind_param('i', $id);\n\n //execute the statement.\n $this->get_item_statement->execute();\n\n $result = $this->get_item_statement->get_result();\n\n $row = $result->fetch_array(MYSQLI_ASSOC);\n\n if ($row != null) {\n return json_encode($row);\n } else {\n return '{error: \"not a valid item\"}';\n }\n }", "public function get($id){\n }", "public abstract function getById($id);", "public function retrieveItem($id) {\n return $this->itemsDB->retrieve($id);\n }", "public function show($id)\n {\n return $this->commandBus->execute(new \\Sailr\\Item\\GetSingleItemCommand($id));\n }", "public function get($id)\n {\n $item = Item::findOrFail($id);\n\n\n return $item;\n }", "abstract public function getById($id);", "abstract public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "public function get($id) {\n\t}", "public function get( $iId );", "function item($request){\r\n try{\r\n $data= new $this->model;\r\n\r\n\r\n $validate=new Validator();\r\n $validate->validate($request->get,['id'=>'Requierd|Integer']);\r\n\r\n\r\n\r\n $data= $data::find($request->get['id']);\r\n if(!$data){\r\n if($request->UseApi())\r\n {\r\n return json_error(\"Not found item\");\r\n }\r\n header(\"HTTP/1.0 404 Not Found\");\r\n return $this->view(\"Error/index\",['ErrorNumber'=>404]);\r\n }\r\n $data->mode='view';\r\n if($request->UseApi())\r\n {\r\n return json_success(\"Getting success\",$data);\r\n }\r\n\r\n //if($request->isAjax() ){\r\n // return json_success(\"Success\",$data);\r\n // }else{\r\n return $this->view(compact('data'));\r\n //}\r\n }catch(Exception $ex){\r\n if($request->isAjax() ){\r\n return json_error($ex->getMessage());\r\n }\r\n //else{\r\n echo $ex->getMessage();\r\n // }\r\n }\r\n }", "public function show($id)\n {\n //\n try \n {\n $task = Item::findOrFail($id);\n //$task= Item::where('title','Avenger Series')->first();\n return $task;\n }\n catch(ModelNotFoundException $exception)\n {\n return response()->json('Sry No Record Found!',404);\n }\n \n \n }", "public function retrieve(int $id);", "public function get($id)\n {\n }", "public function get($id)\n {\n }", "public function show($id)\n {\n // --\n // Check role/permission\n if (!AdminHelper::can_action(115, 'view')) {\n return response()->json(\"Access denied\", 403);\n }\n\n return $this->itemRepo->findById($id);\n }", "public function show($id)\n {\n $item = Item::findOrFail($id);\n return response()->json( $item, 200);\n }", "function get_item_by_id($id) {\n\tglobal $wpdb;\n\tglobal $webgrain2;\n\t$sql = \"SELECT * FROM \" . $webgrain2->second_menu_table . \" WHERE id = $id\";\n\t$result = $wpdb->get_results($wpdb->prepare($sql, 0));\n\tif(!empty($result)) { foreach($result as $r) { return $r; } }\n}", "public function show($id)\n\t{\n\t\tif (Request::ajax()) {\n\t\t\t$album = Album::with('images')->find($id);\n\t\t\treturn $album;\n\t\t}\n\t}", "public function show($id)\n {\n return Item::find($id);\n }", "public function display_item(Request $request){\n\n $id = $request->item_id;\n $item_id = item::where('id', $id)->first();\n return response()->json($item_id);\n }", "public function display_item(Request $request){\n\n $id = $request->item_id;\n $item_id = item::where('id', $id)->first();\n return response()->json($item_id);\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 getItem($id) {\n $item_url = $this->constructItemUrl($id);\n // Get the JSON object at the specified URL\n $json = $this->loadJSONUrl($item_url);\n if ($json) {\n return $json;\n }\n else {\n $migration = Migration::currentMigration();\n $message = t('Loading of !objecturl failed:', array('!objecturl' => $item_url));\n $migration->getMap()->saveMessage(\n array($id), $message, MigrationBase::MESSAGE_ERROR);\n return NULL;\n }\n }", "public function retrieveById($id);", "public function edit( $id)\n {\n //obtengo el objeto para ser usado en el javascript click edit\n if(request()->ajax())\n {\n $data = TipoItem::findOrFail($id);\n return response()->json(['data' => $data]);\n }\n }", "public function show($id)\n { \n // \\Log::info($request->all());\n $item = Item::findOrFail($id);\n $itemImages = Item::findOrFail($id)->image;\n \n return response([\n 'data' => [\n 'item' => new ItemResource($item),\n 'itemImages' => $itemImages\n ]\n ], Response::HTTP_OK);\n }", "public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where($_table, [$_id => $id])->row_array();\n }else{\n $data = $this->db->get($_table)->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function show($id)\n {\n $item=Item::find($id);\n\n return response()->json($item);\n }", "public function showSingle($id);", "public function actionGet($id) {\n $lang = Yii::app()->language;\n $field = 'title_' . $lang;\n $model = AddressCity::model()->findByPk($id);\n $result = ['id' => $model->id, 'title' => $model->$field];\n $this->renderPartial('//ajax/json', ['body' => json_encode($result, JSON_FORCE_OBJECT)]);\n }", "public function item($id)\n {\n $content = $this->itemRequest($id);\n return $this->apiResponse($content[0]);\n }", "abstract protected function get_item_from_db($item_id);", "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 show($id)\n {\n $item = Item::findOrFail($id);\n\n\n return $item;\n }", "public function show1($id)\n {\n // https://laravel.com/docs/5.5/eloquent\n //dump ($id);\n //dump($item = Item::find($id));\n //if ($item == null) abort(404);\n //try{\n //$item = Item::findOrFail($id);\n //}catch(\\Exception $e){\n //abort(404);\n //}\n //$item = Item::findOrFail($id);\n //dump($item->name);\n //return $item;\n }", "public function show($id)\n {\n $product = Products::find($id);\n\n if (Request::ajax()) {\n $return = [\n 'product' => [\n $product,\n 'unit' => $product->unit\n ]\n ];\n return Response::json($product)->setCallback(Input::get('callback'));\n }\n }", "public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where(\"mobil\", ['id' => $id])->row_array();\n }else{\n $data = $this->db->get(\"mobil\")->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function get_one($id)\n {\n }", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public function show($id)\n\t{\n\n\t\tif($id == 'search')\n\t\t{\n\t\t\treturn $this->searchView();\n\t\t}\n\n\n\t\tif(Request::ajax())\n\t\t{\n\t\t\treturn json_encode(\n\t\t\t\tInventory::where('id','=',$id)\n\t\t\t\t\t\t\t\t->with('itemtype')\n\t\t\t\t\t\t\t\t->select('id','itemtype_id','brand','model','details','warranty','unit','quantity','profileditems')\n\t\t\t\t\t\t\t\t->first()\n\t\t\t\t\t);\n\t\t}\n\n\t\treturn view('inventory.item.show');\n\t}", "public function GetById($id);", "public function GetById($id);", "public function getItemByID($id){\r\n $this->db->query('SELECT *,\r\n items.id as itemID,\r\n categories.id as categoryID,\r\n items.name as itemName,\r\n categories.name as categoryName,\r\n items.user_id as itemUserID,\r\n categories.user_id as categoryUserID,\r\n items.created_at as itemCreated,\r\n categories.created_at as categoryCreated\r\n FROM items\r\n INNER JOIN categories\r\n WHERE items.id = :id');\r\n $this->db->bind(':id', $id);\r\n\r\n $row = $this->db->single();\r\n\r\n return $row;\r\n }" ]
[ "0.7390577", "0.7280987", "0.72175485", "0.70783985", "0.70016056", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69322383", "0.69272584", "0.69023335", "0.69023335", "0.69023335", "0.6768117", "0.67663264", "0.67039084", "0.6703594", "0.66736066", "0.6663781", "0.664915", "0.664268", "0.6627055", "0.65978473", "0.6587584", "0.6574607", "0.65678036", "0.65631634", "0.65621555", "0.65602475", "0.6530624", "0.6529358", "0.6529358", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.65168893", "0.6511444", "0.6507254", "0.6506197", "0.64988196", "0.6485805", "0.647732", "0.6469481", "0.6469481", "0.64493155", "0.6447584", "0.64426976", "0.64414364", "0.643994", "0.64221543", "0.64221543", "0.6420445", "0.6397498", "0.63967586", "0.6385146", "0.6384979", "0.63680756", "0.6367613", "0.636679", "0.63589156", "0.63460225", "0.6341639", "0.63391536", "0.6339008", "0.63267195", "0.63198924", "0.63002425", "0.6299804", "0.62935764", "0.6284575", "0.6272138", "0.6272138", "0.6263738" ]
0.7200874
3
/ Get all items
public function get_all_items_ajax() { if ($this->input->is_ajax_request()) { echo json_encode($this->invoice_items_model->get_all_items_ajax()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll()\n {\n \tif(!$this->isEmpty()){\n \t\treturn $this->items;\n \t}\n }", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function all(){\r\n return $this->items;\r\n }", "protected function all()\n\t{\n\t\treturn $this->items;\n\t}", "public static function getAll() {}", "function getItems();", "function getItems();", "public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}", "public function get_all ();", "public function getAll(){\n\t\t\t//return $this->db->get('item'); \n\t\t}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public final function get_all()\n {\n }", "public abstract function getAll();", "public function all() {\n\t\treturn $this->items;\n\t}", "public static function getAll();", "public static function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function all()\n\t{\n\t\treturn $this->items;\n\t}", "abstract public function getAll();", "abstract public function getAll();", "abstract public function getAll();", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function all()\n {\n return $this->items;\n }", "public function getItems()\n {\n }", "protected function getAll() {}", "public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}", "public function getItems(): array;", "public function getItems(): array;", "public function getItems()\n {\n $items = Item::all();\n return response($items, 200);\n }", "public function getAll()\n {\n return $this->get();\n }", "public function all()\n {\n return $this->item;\n }", "public function all()\n {\n return $this->refresh()->getItems();\n }", "public function getItems() : array;", "public function all()\n {\n $item = new Item;\n $items = $item->all();\n View::renderJson($items);\n }", "public function getAllItems(){\n\n\t\treturn $this->redis_client->keys(\"*\");\n\t}", "public function get_all () {\r\n\t\treturn $this->_data;\r\n\t}", "function getAll()\r\n {\r\n\r\n }", "public function getAll()\n {\n }", "public function all(): array\n {\n return $this->items;\n }", "public function all(): array\n {\n return $this->items;\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function getAll()\n {\n }", "public function itemsQuery()\n {\n return $this->items(null);\n }", "public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }", "public function getAll()\n {\n return parent::getAll();\n }", "public function getAll()\n {\n return parent::getAll();\n }", "public function getAll()\n {\n return parent::getAll();\n }", "public function getAll()\n {\n return parent::getAll();\n }", "public static function getAll(): array;", "public function getAll(): array;", "public function getAll(): array;", "public function getAll(): array;", "function getAll();", "function getAll();" ]
[ "0.8440427", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.82528967", "0.8200573", "0.8119566", "0.80795264", "0.8062162", "0.8062162", "0.80440855", "0.8031877", "0.7991638", "0.7990963", "0.7990963", "0.7990963", "0.7990364", "0.7990364", "0.79591054", "0.79200083", "0.7860204", "0.7854463", "0.7854463", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7840006", "0.7835804", "0.7822038", "0.7822038", "0.7822038", "0.7790648", "0.7790648", "0.7790648", "0.7790648", "0.7790648", "0.7790648", "0.7764659", "0.7741548", "0.77383775", "0.76705194", "0.76705194", "0.76676756", "0.76586425", "0.76480806", "0.7606829", "0.75853103", "0.7551288", "0.75383", "0.74912405", "0.74464285", "0.74432623", "0.74212235", "0.74212235", "0.74198705", "0.74198705", "0.74198705", "0.74198705", "0.74198705", "0.74198705", "0.74198705", "0.74198705", "0.74095607", "0.7401714", "0.73912024", "0.73912024", "0.73912024", "0.73912024", "0.73785824", "0.7371426", "0.7371426", "0.7371426", "0.7367455", "0.7367455" ]
0.0
-1
TODO: Actually implement this.
public function findAtomByRef(DivinerAtomRef $ref) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "final private function __construct() {}", "final private function __construct() {}", "protected final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __() {\n }", "final private function __construct(){\r\r\n\t}", "private function __construct()\t{}", "private function __construct () {}", "final private function __construct() {\n\t\t\t}", "private final function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "private function __construct() {}", "private function __construct() {}", "protected function __construct () {}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "final private function __construct()\n\t{\n\t}", "final private function __construct()\n {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}" ]
[ "0.6160534", "0.59430444", "0.59430444", "0.58803374", "0.5865156", "0.5865156", "0.5865156", "0.5773414", "0.5770559", "0.5755509", "0.5740756", "0.5731984", "0.57191294", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57152593", "0.57150555", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57146615", "0.57124937", "0.57124937", "0.56710994", "0.5650211", "0.5641305", "0.561915", "0.5617242", "0.5611777", "0.5611777", "0.5611777", "0.5611777", "0.56110764", "0.56110764", "0.56110764", "0.56110764" ]
0.0
-1
Run the database seeds.
public function run() { $faker = Faker\Factory::create('vi_VN'); $limit = 10; DB::table('users')->truncate(); for($i = 0; $i < $limit; $i++) { DB::table('users')->insert([ 'id' => $i++, 'email' => $faker->unique()->email, 'full_name' => $faker->name, 'family_name' => $faker->lastName, 'given_name' => $faker->name(10), 'avatar' => $faker->text(20), 'password' => $faker->text(20), //'password' => '1234567', ]); } }
{ "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
Seed the application's database.
public function run() { // $this->call(UsersTableSeeder::class); $this->call(ExamSubjectSeeder::class); $this->call(ActivitiesSeeder::class); $this->call(CountriesSeeder::class); $this->call(StatesSeeder::class); $this->call(StudentSchoolNameSeeder::class); $this->call(WriteitDetailSeeder::class); $this->call(WriteitPersonalSeeder::class); $this->call(WriteitQuestionSeeder::class); $this->call(Collegeyears::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\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 seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\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(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\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 # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "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 DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\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 DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\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\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\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 \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\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 $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\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 $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\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 {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\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 {\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 // \\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->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\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 }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\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 DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\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\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\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 Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\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 $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \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 $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "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 $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 Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\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 Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801", "0.6789746", "0.6788733", "0.6788008", "0.6786291", "0.67765796", "0.67742485", "0.677106", "0.67651874", "0.6761959", "0.675823", "0.67337847", "0.6733437", "0.67295784", "0.67290515", "0.6724652", "0.67226326", "0.6722267", "0.6721339", "0.6715842", "0.67070943", "0.67060536", "0.67031103", "0.6702514", "0.6702361", "0.67017967", "0.6695973", "0.6693496", "0.66868156", "0.66837406", "0.6678434", "0.66755766", "0.66726524", "0.666599", "0.664943", "0.6640641", "0.663921", "0.66387916", "0.6636016", "0.6633116", "0.6629787", "0.6627134", "0.6625862", "0.661699", "0.66093796", "0.6602538", "0.65996546", "0.659914", "0.6596484", "0.6596383", "0.65922767", "0.65922284", "0.65913564", "0.65889347", "0.65812707", "0.65811145", "0.6579546", "0.6578819", "0.6575912", "0.65749073", "0.6574314", "0.657148", "0.65696406", "0.6568972", "0.65624833", "0.6560332", "0.6559092", "0.6557491", "0.65555155", "0.6554255", "0.65509576", "0.6548099", "0.65479296", "0.6545845", "0.65443295", "0.65434265", "0.65432936", "0.654295", "0.65426385", "0.6541781", "0.6539325" ]
0.0
-1
User Login end point
public function login(Request $request) { try { Log::info('Access Login'); $notValid = $this->helpers->loginRequestValidator($request); if ($notValid) { Log::error("Validation Error."); return response()->json([ "responseDescription" => "Invalid Request.", "responseCode" => "", "responseMessage" => "", "meta" => [ "content" => $notValid, ], ], 200); } $student = Students::where([ ["status", "=", "1"], ["MSISDN","=",$request->MSISDN] ])->first(); if ($student) { //if status 0 not active if ($student->status==1) { Log::info('Validating credentials.'); $login = $this->helpers->loginProcessor($student, $request->password); if ($login) { Log::info('Successfully logged in.'.$student); return response()->json([ "responseDescription" => "Success.", "responseCode" => "100", "responseMessage" => "Success", "meta" => [ "content" => $student, ], ], 200); } else { Log::error('Invalid Credentials.'.$request->MSISDN); return response()->json([ "responseDescription" => "Invalid Credentials.", "responseCode" => "101", "responseMessage" => "Invalid Credentials.", "meta" => [ "content" => null, ], ], 200); } }else{ Log::error('User is not active.'); return response()->json([ "responseDescription" => "User not active.", "responseCode" => "103", "responseMessage" => "Inactive user.", "meta" => [ "content" => null, ], ], 200); } } else { Log::error('Invalid Credentials.'.$request->MSISDN); return response()->json([ "responseDescription" => "Invalid Credentials.", "responseCode" => "101", "responseMessage" => "Invalid Credentials.", "meta" => [ "content" => null, ], ], 200); } } catch (Exception $ex) { Log::error("Application . Exception : " . $ex->getMessage()); return response()->json($ex->getMessage(), 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login();", "public function login();", "private function login(){\n \n }", "public function login()\n {\n }", "public function login()\n {\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function login(){\n\n }", "public function login()\n {\n /* validation requirement */\n $validator = $this->validation('login', request());\n\n if ($validator->fails()) {\n\n return $this->core->setResponse('error', $validator->messages()->first(), NULL, false , 400 );\n }\n\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n\n return $this->core->setResponse('error', 'Please check your email or password !', NULL, false , 400 );\n }\n\n return $this->respondWithToken($token, 'login');\n }", "public function postLoginAction()\n {\n //get input\n $inputs = $this->getPostInput();\n\n //define default\n $default = [\n 'status' => 'active'\n ];\n\n // Validate input\n $params = $this->myValidate->validateApi($this->userLogin, $default, $inputs);\n\n if (isset($params['validate_error']))\n {\n //Validate error\n return $this->responseError($params['validate_error'], '/users');\n }\n\n //process user login\n $result = $this->userService->checkLogin($params);\n\n //Check response error\n if (!$result['success'])\n {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n return $this->response($encoder, $result['data']);\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "public function login(){\n\n $this->checkOptionsAndEnableCors();\n\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n $user = $this->repository->findByEmailAndPassword($email, $password);\n\n if($user){\n echo json_encode($user);\n } else {\n http_response_code(401);\n }\n }", "public function loginAction() {\n $auth = $this->app->container[\"settings\"][\"auth\"];\n\n // Note: There is no point to check whether the user is authenticated, as there is no authentication\n // check for this route as defined in the config.yml file under the auth.passthrough parameter.\n\n $request = $this->app->request;\n $max_exptime = strtotime($auth[\"maxlifetime\"]);\n $default_exptime = strtotime($auth[\"lifetime\"]);\n $exptime = $default_exptime;\n\n if ( $request->isFormData() )\n {\n $username = $request->post(\"username\");\n $password = $request->post(\"password\");\n $exptime = self::getExpirationTime($request->post(\"expiration\"), $default_exptime, $max_exptime);\n }\n\n if ( preg_match(\"/^application\\\\/json/i\", $request->getContentType()) )\n {\n $json = json_decode($request->getBody(), true);\n if ( $json !== NULL )\n {\n $username = $json[\"username\"];\n $password = $json[\"password\"];\n $exptime = self::getExpirationTime(isset($json[\"expiration\"])?$json[\"expiration\"]:null, $default_exptime, $max_exptime);\n }\n }\n\n if ( empty($username) || empty($password) ) {\n $this->renderUnauthorized();\n return;\n }\n\n /**\n * @var \\PDO\n */\n $pdo = $this->app->getPDOConnection();\n $user = $pdo->select()\n ->from(\"tbl_user\")\n ->where(\"username\", \"=\", $username)\n ->where(\"password\", \"=\", sha1($password))\n ->where(\"status\", \">\", 0)\n ->execute()\n ->fetch();\n\n if ( empty($user) )\n {\n $this->renderUnauthorized();\n return;\n }\n\n $pdo->update(array(\"lastlogin_time\"=>gmdate(\"Y-m-d H:i:s\")))\n ->table(\"tbl_user\")\n ->where(\"id\", \"=\", $user[\"id\"])\n ->execute();\n\n $this->app->setAuthData(Factory::createAuthData($user, $exptime));\n\n $this->render(200);\n }", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }", "public function actionLogin() {\n \n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "abstract protected function doLogin();", "public function login($userName, $password);", "public function login(){\n\n }", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db fpr this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token\n FROM users\n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the db, it means login failed\n if(!$token) {\n\n Router::redirect(\"/users/login/error\");\n \n\n # But if we did, login succeeded!\n } else {\n\n \n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n \n\n # Send them to the main page - or wherevr you want them to go\n Router::redirect(\"/\");\n # Send them back to the login page\n }\n }", "public function loginAction() {\n\n\n $login = $this->getRequest()->getPost();\n if (!isset($login['username']) || !isset($login['password'])) {\n return $this->showMsg(-1, '用户名或者密码不能为空.');\n }\n\n\n $ret = Admin_Service_User::login($login['username'], $login['password']);\n\n\n if (Common::isError($ret)) return $this->showMsg($ret['code'], $ret['msg']);\n if (!$ret) $this->showMsg(-1, '登录失败.');\n $this->redirect('/Admin/Index/index');\n }", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function postLogin()\n {\n \t$params = array(\n 'username' => Input::get('username'),\n 'password' => Input::get('password'),\n );\n \n \t$user = User::where(array('username'=>$params['username'],'password'=>$params['password'])) ->count();\n if ($user >0) {\n // if next is present, redirect to that url\n $next = Input::get('next');\n if ($next) return Redirect::to($next);\n return Redirect::route('home');\n }\n return Redirect::route('auth.getLogin')\n ->with('message', 'Wrong username or password');\n }", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function login()\n {\n $credentials = request(['email', 'password']);\n\n// if (!$token = auth('api')->attempt($credentials)) {\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n return $this->respondWithToken($token);\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "public function doAuthentication();", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "public function postLogin() {\n\n\t\t// get input parameters\n\t\t//\n\t\t$username = Input::get('username');\n\t\t$password = Input::get('password');\n\n\t\t// validate user\n\t\t//\n\t\t$user = User::getByUsername($username);\n\t\tif ($user) {\n\t\t\tif (User::isValidPassword($password, $user->password)) {\n\t\t\t\tif ($user->hasBeenVerified()) {\n\t\t\t\t\tif ($user->isEnabled()) {\n\t\t\t\t\t\t$userAccount = $user->getUserAccount();\n\t\t\t\t\t\t$userAccount->penultimate_login_date = $userAccount->ultimate_login_date;\n\t\t\t\t\t\t$userAccount->ultimate_login_date = gmdate('Y-m-d H:i:s');\n\t\t\t\t\t\t$userAccount->save();\n\t\t\t\t\t\t$res = Response::json(array('user_uid' => $user->user_uid));\n\t\t\t\t\t\tSession::set('timestamp', time());\n\t\t\t\t\t\tSession::set('user_uid', $user->user_uid);\n\t\t\t\t\t\treturn $res;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn Response::make('User has not been approved.', 401);\n\t\t\t\t} else\n\t\t\t\t\treturn Response::make('User email has not been verified.', 401);\n\t\t\t} else\n\t\t\t\treturn Response::make('Incorrect username or password.', 401);\n\t\t} else\n\t\t\treturn Response::make('Incorrect username or password.', 401);\n\n\t\t/*\n\t\t$credentials = array(\n\t\t\t'username' => $username,\n\t\t\t'password' => $password\n\t\t);\n\n\t\tif (Auth::attempt($credentials)) {\n\t\t\treturn Response::json(array(\n\t\t\t\t'user_uid' => $user->uid\n\t\t\t));\n\t\t} else\n\t\t\treturn Response::error('500');\n\t\t*/\n\t}", "public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t}", "public function executeLogin()\n {\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "public function loginUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$login = Application_Model_User::loginUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($login) {\n\t\t\t\t\t\techo json_encode($login);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t# Prevent SQL injection attacks by sanitizing user entered data\n\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t$q = \"SELECT token\n\tFROM users\n\tWHERE email = '\".$_POST['email'].\"'\n\tAND password = '\".$_POST['password'].\"'\n\t\";\n\n\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t#login failed\n\tif($token == \"\" || $_POST['email'] == \"\" || $_POST['password'] == \"\"){\n\n\n\n\tRouter::redirect(\"/users/login/error\");\n\t# send back to login page - should add indication what went wrong\n\t}\n\t#login successful\n\telse{\t\n\n\t\techo \"if we find a token, the user is logged in. Token:\".$token;\n\n\t\t#store token in a cookie\n\t\tsetcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\n\t\t#send them to the main page\n\t\tRouter::redirect(\"/issues\");\n\n\t\t#token name value and how long should last\n\t\t#send back to index page\n\t\t#authenticate baked into base controller\n\t\t#gets users credentials this->user->firstname\n\t}\n}", "public function actionUserLogin()\n {\n $result = array();\n if (!$this->_checkAuth())\n {\n $result['status'] = 'Error';\n $result['message'] = '邮箱或密码错误';\n }\n else\n {\n // TODO: using transactions\n $user = User::model()->find('LOWER(email)=?', array(strtolower($_SERVER['HTTP_USERNAME'])));\n\n $result['status'] = 'OK';\n $result['user'] = $user;\n }\n\n echo CJSON::encode($result);\n Yii::app()->end();\n }", "public function authenticate()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('login', Input::only('email', 'password'));\n\n\t\t# if the user was authenticated\n\t\tif(isset($response['success']))\n\t\t{\t\n\t\t\t# save the returned user object to the session for later use\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# we got here from a redirect. if they came via a new account registration then reflash the \n\t\t\t# session so we can use the data on the next page load\n\t\t\tif(Session::has('success')) {\n\t\t\t\tSession::reflash();\n\t\t\t}\t\t\t\n\n\t\t\tif(Input::get('redirect') && ! Session::has('ignoreRedirect')) {\n\t\t\t\treturn Redirect::to(Input::get('redirect'));\n\t\t\t}\n\n\t\t\t# and show the profile page\n\t\t\treturn Redirect::to('profile');\t\n\t\t}\n\t\t# auth failed. return to the log in screen and display an error\n\t\telse \n\t\t{ \n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('login-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the log in page again\n\t\t\treturn Redirect::to('login');\n\t\t}\n\t}", "#[Route('login', name: \"_user_login\", methods: ['POST'])]\n public function login(): JsonResponse\n {\n $user = $this->getUser();\n\n return $this->json([\n 'username' => $user->getUserIdentifier(),\n 'roles' => $user->getRoles()\n ]);\n }", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function login()\n {\n $credentials = request(['email', 'password']);\n if (!$token = auth()->attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n /*echo json_encode(auth()->user());\n echo json_encode($this->respondWithToken($token));*/\n\t $response = array();\n\t if(auth()->user()->privilegios == '1'){\n\t\t \n\t\t\t$response = $this->allAccess($token);\t\t\n\t\t\n\t }else{\n\t\t \n\t\t $response = $this->ConfigurableAccess($token);\n\t\t \n\t }\t \n //return $this->respondWithToken($token);\n return response()->json($response);\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function actionLogin()\n {\n \\Yii::$app->response->format = Response::FORMAT_JSON;\n\n if(Yii::$app->request->isPost) {\n\n $model = new LoginForm();\n\n\n if ($model->load(Yii::$app->getRequest()->getBodyParams(), '') && $model->login()) {\n\n return ['status'=> 'success', 'access_token' => Yii::$app->user->identity->getAuthKey()];\n } else {\n\n return ['status' => 'error', 'message' => 'Wrong username or password'];;\n }\n\n }\n\n\n return ['status' => 'wrong', 'message' => 'Wrong HTTP method, POST needed'];\n }", "public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }", "public function processLogin(): void;", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "public function doLogin()\n {\n $rules = array(\n 'email' => 'required|email',\n 'password' => 'required|alphaNum|min:3'\n );\n \n // validate inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n \n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n return Redirect::to('/')\n ->withErrors($validator)\n ->withInput(Input::except('password'));\n } else {\n // create our user data for the authentication\n $userdata = array(\n 'email' => Input::get('email'),\n 'password' => Input::get('password')\n );\n \n // attempt to do the login\n $response = $this->requestLoginApi($userdata);\n\n if ($response->status == true) {\n // validation successful, save cookie!\n return Redirect::to('showsearch')\n ->withCookie(Cookie::make('accessToken', $response->data->accessToken, 60))\n ->with('message', 'Auth OK! (Token created)');\n \n } else {\n // validation fail, send back to login form\n return Redirect::to('/')\n ->withErrors(\"Invalid credentials\")\n ->withInput(Input::except('password'));\n }\n }\n }", "function login() {\n $params = $this->objService->get_request_params();\n $isSuccess = $this->objQuery->count('user','email= ? AND password = ?', array($params->email,$params->password));\n echo $isSuccess;\n }", "public function login(Request $request);", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "public function login()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $email = SCMUtility::stripTags( (isset($_POST['email'])) ? $_POST['email'] : '' );\n $password = SCMUtility::stripTags( (isset($_POST['password'])) ? $_POST['password'] : '' );\n\n if( ! Session::Auth($email,$password) )\n {\n SCMUtility::setFlashMessage('Invalid email/password.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "function login_post()\n {\n if(!$this->post('user') || !$this->post('pass')){\n $this->response(NULL, 400);\n }\n\n $this->load->library('authentication');\n $array = array(\n 'user' => $this->post('user'),\n 'pass' => $this->post('pass')\n );\n $auth_result = $this->authentication->authenticate($array);\n \n if($auth_result['success'] == 1){\n $this->response(array('status' => 'success'));\n }else{\n $this->response(array('status' => 'failed'));\n }\n }", "public function action_login() {\n try {\n $i = Input::post();\n $auth = new \\Craftpip\\OAuth\\Auth();\n $auth->logout();\n if (\\Auth::instance()\n ->check()\n ) {\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n $user = $auth->getByUsernameEmail($i['email']);\n if (!$user) {\n throw new \\Craftpip\\Exception('The Email or Username is not registered with us.');\n }\n $auth->setId($user['id']);\n\n $a = $auth->login($i['email'], $i['password']);\n if ($a) {\n $isVerified = $auth->getAttr('verified');\n if (!$isVerified) {\n $auth->logout();\n throw new \\Craftpip\\Exception('Your account is not activated, please head to your Email & activate your Gitftp account.');\n }\n\n $response = array(\n 'status' => true,\n 'redirect' => dash_url,\n );\n }\n else {\n throw new \\Craftpip\\Exception('The username & password did not match.');\n }\n }\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function login() {\n return $this->run('login', array());\n }", "public function loginUser()\n {\n $validate = $this->loginValidator->validate();\n $user = $this->userRepository->getUserWithEmail($validate[\"email\"]);\n\n if ($this->userCorrect($validate, $user)) {\n $user['api_token'] = $this->getToken();\n $user->save();\n\n return $this->successResponse('user', $user, 200)\n ->header('Token', $user['api_token']);\n }\n }", "public function login()\n {\n $login = new Login();\n\n $path = '/inloggen';\n if (CSRF::validate() && $login->check()) {\n // try to send the user to the reservation form or sign up for meet the expert page\n $path = Session::get('path');\n unset($_SESSION['path']);\n\n if (empty($path)) {\n $path = '/';\n }\n }\n\n return new RedirectResponse($path);\n }", "public function login($username, $password);", "public function login()\n {\n\n $credentials = request(['email', 'password']);\n if (! $token = auth()->attempt($credentials)) {\n return response()->json(['status'=>false,'error' => 'Invalid Credentials'], 200);\n }\n\n return $this->respondWithToken($token);\n }", "public function doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "public function index() {\n $this->login();\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "protected function LoginAuthentification()\n {\n \n $tokenHeader = apache_request_headers();\n\n //isset Determina si una variable esta definida y no es NULL\n\n if(isset($tokenHeader['token']))\n { \n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm); \n //var_dump($datosUsers);\n if(isset($datosUsers->nombre) and isset($datosUsers->password))\n { \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n\n if($username == $datosUsers->nombre and $password == $datosUsers->password)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n } \n \n }", "public function login(string $email, string $password);", "public function login()\n\t{\t\t\n\t\t$credentials['email'] = Input::get('email');\n\t\t$credentials['password'] = Input::get('password');\n\t\t$remember = (is_null(Input::get('remember'))?false:true);\t\t\n\n\t\t$user = $this->repo->login($credentials, $remember);\t\t\n\t\tif (!$user)\n\t\t{\n\t\t\tRedirect::route('login')->withInput(Input::except('password'));\n\t\t}\n\t\tif(Session::has('redirect'))\n\t\t{\n\t\t\t$url = Session::get('redirect');\n\t\t\tSession::forget('redirect');\t\t\t\n\t\t\treturn Redirect::to(Session::get('redirect'))->with('afterlogin', true);\t\n\t\t}\n\t\treturn Redirect::route('home')->with('afterlogin', true);\n\t}", "public function login() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['password'])) {\n session_write_close();\n header(\"Location: \".app::site_url(array(config::get('default_controller'), 'index')));\n exit(0);\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array(\n 'flash' => $flash,\n 'title' => 'Login'\n );\n }", "public function postLogin()\n\t{\n\n\t\t$input = array(\n\t\t 'email' => \\Input::get( 'email' ),\n\t\t 'password' => \\Input::get( 'password' ),\n\t\t 'remember' => \\Input::get( 'remember' ),\n\t\t);\n\n\t\t// If you wish to only allow login from confirmed users, call logAttempt\n\t\t// with the second parameter as true.\n\t\t// logAttempt will check if the 'email' perhaps is the username.\n\t\tif ( \\Confide::logAttempt( $input, true ) ) \n\t\t{\n\t\t return \\Redirect::intended('/company'); \n\t\t}\n\t\telse\n\t\t{\n\t\t $user = new \\User;\n\n\t\t // Check if there was too many login attempts\n\t\t if( \\Confide::isThrottled( $input ) )\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.too_many_attempts');\n\t\t }\n\t\t elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.not_confirmed');\n\t\t }\n\t\t else\n\t\t {\n\t\t $err_msg = \\Lang::get('confide::confide.alerts.wrong_credentials');\n\t\t }\n\n\t\t return \\Redirect::action('controllers\\company\\AuthController@getLogin')\n\t\t ->withInput(\\Input::except('password'))\n\t\t ->with( 'error', $err_msg );\n\t\t}\n\n\t}", "public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }", "public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }", "public function loginuser(){\n $user = Auth::user();\n return response(['user'=>$user]);\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function login()\n {\n// в качестве проверемого именпи можно использовать name или email\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n $this->setBindExchangeRabbitMQ($credentials['email'], 'bind');\n return $this->respondWithToken($token);\n }", "protected function loginIfRequested() {}", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function login()\n {\n if (!empty($_SESSION['user_id'])) {\n return redirect()->to('/');\n }\n // Working with form data if POST request\n if ($this->request->getPost()) {\n $data = $this->request->getPost();\n $validation = Services::validation();\n $validation->setRules(\n [\n 'password' => 'required|min_length[6]',\n 'email' => 'required',\n ]\n );\n // Checking reCAPTCHA\n if (empty($data['g-recaptcha-response'])) {\n $validation->setError('g-recaptcha-response', 'Please activate recaptcha');\n return $this->renderPage('login', $validation->listErrors());\n }\n // Data validation\n if ($validation->withRequest($this->request)->run()) {\n unset($data['g-recaptcha-response']);\n $result = User::checkUser($data);\n // Logging in if user with such data exists\n if ($result) {\n $_SESSION['user_id'] = $result;\n return redirect()->to('/');\n } else {\n $validation->setError('email', 'Invalid parameters');\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Data validation fails, return with validation errors\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Render page if GET request\n return $this->renderPage('login');\n }\n }", "public function postLogin()\n {\n $input = array(\n 'email' => Input::get( 'email' ), // May be the username too\n 'username' => Input::get( 'email' ), // so we have to pass both\n 'password' => Input::get( 'password' ),\n 'remember' => Input::get( 'remember' ),\n );\n\n // If you wish to only allow login from confirmed users, call logAttempt\n // with the second parameter as true.\n // logAttempt will check if the 'email' perhaps is the username.\n if ( Confide::logAttempt( $input ) )\n {\n // If the session 'loginRedirect' is set, then redirect\n // to that route. Otherwise redirect to '/'\n $r = Session::get('loginRedirect');\n if (!empty($r))\n {\n Session::forget('loginRedirect');\n return Redirect::to($r);\n }\n\n return Redirect::to('/'); // change it to '/admin', '/dashboard' or something\n }\n else\n {\n $user = new User;\n\n // Check if there was too many login attempts\n if( Confide::isThrottled( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');\n }\n elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.not_confirmed');\n }\n else\n {\n $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');\n }\n\n return Redirect::to('user/login')\n ->withInput(Input::except('password'))\n ->with( 'error', $err_msg );\n }\n }", "function loginUser($username,$password,$return=true);", "public function actionLogin() {\n $sample_code = Yii::$app->request->post('sample_code');\n $collector_code = Yii::$app->request->post('collector_code');\n $full_name = Yii::$app->request->post('full_name');\n $password = Yii::$app->request->post('password');\n $user = new User();\n\n if(is_null($password)) {\n $user->scenario = User::SCENARIO_USER;\n $result = $user->loginOrCreate($sample_code,$collector_code,$full_name);\n } else {\n $user->scenario = User::SCENARIO_OPERATOR;\n $result = $user->loginOrCreate($sample_code,$collector_code,$password);\n }\n if(array_key_exists('error',$result))\n throw new \\yii\\web\\HttpException(400, 'An error occurred:'. json_encode($result['error']));\n return $result;\n }", "public function postLogin()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n // Check validate login of input data\n $validate = $this->Client->newEntity($input, ['validate' => 'login']);\n\n // Check this validate had error or not\n if ($validate->errors()) {\n $this->set($validate->errors());\n // Check login by account of Shop and redirect to Index page if success\n } else if ($shop = $this->Shop->checkLoginForShop($input) != null) {\n // Change to Model Shop to check authenticate.\n $this->Auth->config('authenticate', [\n 'Form' => ['userModel' => 'Shop']\n ]);\n\n $shop = $this->Auth->identify();\n $this->Auth->setUser($shop);\n\n return $this->redirect(['controller' => 'Pages', 'action' => 'index']);\n // Check login by account of Client and redirect to Index page if success\n } else if ($client = $this->Auth->identify()) {\n $this->Auth->setUser($client);\n return $this->redirect(['controller' => 'Pages', 'action' => 'home']);\n } else {\n $this->Flash->error('Username or password are not correct..');\n }\n $this->login();\n }\n }", "public function login()\n {\n $strUsername = !empty($_POST['username']) ? $_POST['username'] : null;\n $strPassword = !empty($_POST['password']) ? $_POST['password'] : null;\n if( is_null($strUsername) || is_null($strPassword) )\n {\n header('HTTP/1.1 422 Unprocessable Entity');\n return ['error' => \"Both a username and a password are required.\"];\n }\n $oRet = $this->oUserModel->checkLogin($strUsername, $strPassword);\n if( $oRet->HasFailure() )\n {\n header('HTTP/1.1 403 Forbidden');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $_SESSION['user_id'] = $oRet->Get();\n $oRet = $this->oUserModel\n ->getUser(['user_id' => $oRet->Get()]);\n if( $oRet->HasFailure() )\n {\n unset($_SESSION['user_id']);\n header('HTTP/1.1 500 Internal Server Error');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $aRet = ['success' => true, 'user' => $oRet->Get()[0]];\n }\n }\n return $aRet;\n }", "public function handleLogin( ){\n\t\t// Filter allowed data\n\t\t$data = Request::only([ 'uid', 'password' ]);\n\n\t\t// Validate user input\n\t\t$validator = Validator::make(\n\t\t\t$data,\n\t\t\t[\n\t\t\t\t'uid' => 'required',\n\t\t\t\t'password' => 'required',\n\t\t\t]\n\t\t);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$data[$key] = $this->sanitizeLDAP( $value );\n\t\t}\n\n\t\tif($validator->fails()){\n\t\t\t// If validation fails, send back with errors\n\t\t\treturn Redirect::route('login')->withErrors( $validator )->withInput( );\n\t\t}\n\n\t\tif( Auth::attempt( [ 'uid' => $data['uid'], 'password' => $data['password']], true ) ){\n\t\t\t// If login is successful, send them to home\n\t\t\treturn Redirect::route( 'home' );\n\t\t} else {\n\t\t\t// Otherwise, tell them they're wrong\n\t\t\treturn Redirect::route( 'login' )\n\t\t\t\t\t\t ->withErrors([ \n\t\t\t\t\t\t\t\t'message' => 'I\\'m sorry, that username and password aren\\'t correct.' \n\t\t\t\t\t\t\t]);\n\t\t}\n\n\t\treturn Redirect::route( 'login' )->withInput( );\n\t}", "function login();", "public function postLogin()\n {\n $data = [\n 'username' => Input::get('username'),\n 'password' => Input::get('password')\n ];\n\n // Verify Data\n if (Auth::attempt($data, Input::get('remember'))) // Remember me?\n {\n\t Session::put('user', $data);\n // User Data is correct\n return Redirect::intended('/');\n }\n // Error\n return Redirect::back()->with('error_message', 'Error: Username or password invalid')->withInput();\n }" ]
[ "0.81558937", "0.81558937", "0.7901106", "0.76768", "0.76768", "0.76687133", "0.7628183", "0.76060665", "0.75957173", "0.7588646", "0.75645846", "0.75588083", "0.754707", "0.7538342", "0.75318664", "0.7521889", "0.75211847", "0.75089604", "0.7499023", "0.7497952", "0.7491672", "0.7488987", "0.74726546", "0.74726546", "0.74726546", "0.74632794", "0.74550194", "0.74493647", "0.7391388", "0.73855275", "0.7379376", "0.73766553", "0.73604906", "0.7358528", "0.73541135", "0.732492", "0.7319773", "0.73179054", "0.7314092", "0.730217", "0.72708267", "0.7268826", "0.72676843", "0.7261437", "0.7253458", "0.7233298", "0.72328395", "0.72292215", "0.7226645", "0.7225664", "0.7225353", "0.72205395", "0.72176564", "0.72153574", "0.7199009", "0.71966183", "0.7187364", "0.71872455", "0.71822685", "0.71773344", "0.71766704", "0.7160469", "0.7157179", "0.71566534", "0.7155461", "0.7152707", "0.71463454", "0.71462935", "0.7145301", "0.71278673", "0.7126629", "0.71196705", "0.7114629", "0.7109509", "0.7104901", "0.70987856", "0.7096836", "0.70945793", "0.7093082", "0.7092571", "0.70923597", "0.7092082", "0.70919454", "0.7090135", "0.70872235", "0.70837516", "0.7082174", "0.7079317", "0.70764875", "0.7075917", "0.7073737", "0.707091", "0.70662576", "0.70510954", "0.7045427", "0.70418984", "0.70330906", "0.703129", "0.7030515", "0.7026975", "0.70246476" ]
0.0
-1
Replaces spaces with full text search wildcards
protected function fullTextWildcards($term) { return str_replace(' ', '*', $term) . '*'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "public static function escapeMatchPattern($text){\r\n\t\t$text = str_replace('*', '', trim($text));\r\n\t\tif(mb_strlen($text)>=3){\r\n\t\t\tif(!strstr($text,'\"')){\r\n\t\t\t\tif(!strstr($text,\"'\")){\r\n\t\t\t\t\t//not exact phrase\r\n\t\t\t\t\tif(!strstr($text,' ')){\r\n\t\t\t\t\t\t//one word\r\n\t\t\t\t\t\t$text.='*';//truncation\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\treturn self::escape($text);\r\n\t}", "function str_replace_whole_word($search, $replace, $subject) {\r\n\t\t//$test_string = preg_replace('/\\bSUMMARY\\b/s', 'Summary', $test_string);\r\n\t\t//var_dump($test_string);exit(0);\r\n\t\t$count = 1;\r\n\t\twhile($count > 0) {\r\n\t\t\t//$subject = preg_replace('/([^a-zœàáâãäåæçèéêëìíîïðñòóôõöøùúûüý]|&oelig;|&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;|&aelig;|&ccedil;|&egrave;|&eacute;|&ecirc;|&euml;|&igrave;|&iacute;|&icirc;|&iuml;|&eth;|&ntilde;|&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&divide;|&oslash;|&ugrave;|&uacute;|&ucirc;|&uuml;|&yacute;)' . $search . '([^a-zœàáâãäåæçèéêëìíîïðñòóôõöøùúûüý]|&oelig;|&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;|&aelig;|&ccedil;|&egrave;|&eacute;|&ecirc;|&euml;|&igrave;|&iacute;|&icirc;|&iuml;|&eth;|&ntilde;|&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&divide;|&oslash;|&ugrave;|&uacute;|&ucirc;|&uuml;|&yacute;)/s', '$1' . $replace . '$2', $subject, -1, $count);\r\n\t\t\t$subject = preg_replace('/([^a-zA-ZœàáâãäåæçèéêëìíîïðñòóôõöøùúûüýŒÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ])' . $search . '([^a-zA-ZœàáâãäåæçèéêëìíîïðñòóôõöøùúûüýŒÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ])/s', '$1' . $replace . '$2', $subject, -1, $count);\r\n\t\t}\r\n\t\treturn $subject;\r\n\t}", "protected function toLikeSearchString($text)\n {\n $str = preg_replace('#[\\s%]+#', '%', $text);\n\n // Remove all wildcard character at the head and tail\n $str = preg_replace('#^%+#', '', $str);\n $str = preg_replace('#%+$#', '', $str);\n \n return $str;\n }", "function censor_words($output)\n {\n foreach ($_SESSION['pgo_word_censor'] as $find => $replace)\n {\n $output = preg_replace(\"/\\b$find\\b/i\", $replace, $output);\n }\n return $output;\n }", "function wp_spaces_regexp()\n {\n }", "function bad_words($text)\n\t\t\t{\n\t\t\t\t$swearWords = array('motherfucking', 'motherfucker', 'fucker', 'fuck', 'bitch', 'shit', 'pussy', 'nigger', 'slut', 'cunt');\n\n\t\t\t\t$replaceWith = array('m****rf*****g', 'm****rf***r', 'f****r', 'f**k', 'b***h', 's**t', 'p***y', 'n****r', 's**t', 'c**t');\n\n\t\t\t\t$text = str_ireplace($swearWords, $replaceWith, $text);\n\n\t\t\t\treturn $text;\n\t\t\t}", "public function wordFilter($text = '', $exact = TRUE) {\n\t\tif (!isset($this->bad_words)) {\n\t\t\t$this->fetchBadWords();\n\t\t} // end if\n\n\t\tif ($exact === TRUE) {\n\t\t\treturn strtr($text, $this->bad_words);\n\t\t} // end if\n\n reset($this->bad_words);\n while(list($word, $replace) = each($this->bad_words)) {\n $text = mb_ereg_replace('/(^|\\b)' . $word . '(\\b|!|\\?|\\.|,|$)/i', $replace, $text);\n } // end while\n\t\treturn $text;\n\t}", "function _culturefeed_search_ui_sanitize_query_term($term) {\n // Replace special characters with normal ones.\n $term = culturefeed_search_transliterate($term);\n\n // Replace AND to a space.\n $term = str_replace(' AND ', ' ', $term);\n\n $query_parts = explode(' OR ', $term);\n array_walk($query_parts, function(&$search_string) {\n\n // Strip of words between quotes. The spaces don't need to be replaced to AND for them.\n preg_match_all('/\".*?\"/', $search_string, $matches);\n foreach ($matches[0] as $match) {\n $search_string = str_replace($match, '', $search_string);\n }\n\n $search_string = str_replace(' ', ' ', $search_string);\n\n // Put words with a special character between quotes.\n $words = explode(' ', trim($search_string));\n $parts = array();\n $special_characters = '-!?&/';\n foreach ($words as $word) {\n if (strpbrk($word, $special_characters)) {\n $word = '\"' . $word . '\"';\n }\n $parts[] = $word;\n }\n\n // Replace spaces between multiple search words by 'AND'.\n $search_string = implode(' AND ', $parts);\n\n // Add back the words between quotes.\n if (!empty($matches[0])) {\n if (empty($search_string)) {\n $search_string .= implode(' AND ', $matches[0]);\n }\n else {\n $search_string .= ' AND ' . implode(' AND ', $matches[0]);\n }\n }\n\n });\n\n return implode(' OR ', $query_parts);\n}", "function qoute_replacment($phrase){\r\n\t$find = array(\"\\’\", \"’\", \"\\‘\", \"‘\", \"\\'\", \"'\", \"—\", '\\”', '”', '\\“', '“', '\\\"', '\"',\"\\n\",\"\\r\",\"…\");\r\n\t//defince what to replace the find array with\r\n\t$replace = array(\"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"-\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\",\"&nbsp;\",\"&nbsp;\",\"...\");\r\n\t//html entities code incase you want that\r\n\t#$replace = array(\"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\",\"—\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\");\r\n\t//do the replacing\r\n\t$newphrase = str_replace($find, $replace, $phrase);\r\n \t//return the replacing for output\r\n\treturn $newphrase;\r\n}", "function acf_str_replace($string = '', $search_replace = array())\n{\n}", "function cleanSearchTerms($arg) {\r\n return explode(\" \", preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", strtolower(trim($arg))));\r\n}", "function doclean($samy)\n\t {\n\n\t $samyb = trim($samy);\n\t $samyb = @ereg_replace(\"%([A-Za-z]+)%\",\"\",$samyb);\n\t $samyb = str_replace(\"=\",\"\",$samyb);\n\t $samyb = str_replace(\"--\",\"\",$samyb);\n\t $samyb = str_replace(\";\",\"\",$samyb);\n\t $samyb = str_replace(\"..\",\"\",$samyb);\n\t $samyb = str_replace(\"?\",\"\",$samyb);\n\t $samyb = str_replace(\" OR \",\"\",$samyb);\n\t $samyb = str_replace(\" LIKE \",\"\",$samyb);\n\n\t return $samyb;\n\n\t }", "function find_replace($request) {\r\n\r\n $content = $request['content'];\r\n $keywords = $request['keywords'];\r\n\r\n foreach ($keywords as $keyword) {\r\n $content = str_replace($keyword['find'], $keyword['replace'], $content);\r\n }\r\n\r\n return $content;\r\n}", "function swap_bad_words($string)\n{\n global $gbBadWords;\n\n foreach ($gbBadWords as $bad_word)\n {\n $pattern = '/(\\W|^)(' . $bad_word . ')(\\W|$)/iu';\n\n //just get the first letter of bad_word into good_word\n $good_word = substr($bad_word, 0, 1);\n\n //fill out good_word with *s\n for ($i = 1; $i < strlen($bad_word); $i++)\n {\n $good_word .= '*';\n }\n //we replace the bad_word with good word including anything immediately adjacent\n //such as a comma, space, period or start/end of string.\n $replacement = '$1' . $good_word . '$3';\n $string = preg_replace($pattern, $replacement, $string);\n }\n\n //convert back to UTF-8\n return $string;\n\n}", "public function getUnicodeReplaceGreedy();", "function search_excerpt_highlight() {\n $excerpt = get_the_excerpt();\n $keys = implode('|', explode(' ', get_search_query()));\n $excerpt = preg_replace('/(' . $keys . ')/iu', '<strong class=\"search-highlight\">\\0</strong>', $excerpt);\n\n echo '<p>' . $excerpt . '</p>';\n}", "function replaceWordInText($strText, $mixWord, $strReplaceContent)\n{\n global $boolDebug;\n if(!is_array($mixWord))\n $mixWord = array($mixWord);\n\n foreach ($mixWord as $strWord)\n $strText = preg_replace(\"/(?<![ÄäÜüÖößA-Za-z0-9\\-])(\".regex_real_string($strWord).\")(?![ÄäÜüÖößA-Za-z0-9\\-\\>]|\\!\\?\\.[ÄäÜüÖößA-Za-z0-9])/ui\", $strReplaceContent, $strText);\n\n return $strText;\n}", "function highlight_this($text, $words)\n\t{\n\t\t$words = trim($words);\n\t\t$the_count = 0;\n\t\t$wordsArray = explode(' ', $words);\n\t\t\tforeach($wordsArray as $word) {\n\t\t\t if(strlen(trim($word)) != 0)\n\t\t\t\n\t\t\t //exclude these words from being replaced\n\t\t\t $exclude_list = array(\"word1\", \"word2\", \"word3\");\n\t\t\t// Check if it's excluded\n\t\t\tif($word!=\"\")\n\t\t\t{\n\t\t\tif ( in_array( strtolower($word), $exclude_list ) ) {\n\t \n\t\t\t} else {\n\t\t\t\t//$text = str_replace($word, \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text, $count);\n\t\t//\t\t$text = str_replace($word, \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text);\n\t\t\t\t$text = preg_replace ( \"/\".$word.\"/i\", \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text );\n\t\t\t\t//$the_count = $count + $the_count;\n\t\t\t\t}\n\t\t\t}\n\t\t\t \n\t\t}\n\t\t//added to show how many keywords were found\n\t\t//echo \"<br><div class=\\\"emphasis\\\">A search for <strong>\" . $words. \"</strong> found <strong>\" . $the_count . \"</strong> matches within the \" . $the_place. \".</div><br>\";\n\t \n\t\treturn $text;\n\t}", "public function StringSearchForAllWords()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_string_all_words;\n }", "function cf_search_where( $where ) {\n global $pagenow, $wpdb;\n if ( is_search() ) {\n $where = preg_replace(\n \"/\\(\\s*\".$wpdb->posts.\".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\".$wpdb->posts.\".post_title LIKE $1) OR (\".$wpdb->postmeta.\".meta_value LIKE $1)\", $where );\n }\n return $where;\n}", "private function sanitizeSearchQuery($query)\n {\n return $query;\n //return preg_replace('/[^[:alnum:] ]/', '', trim(preg_replace('/[[:space:]]+/', ' ', $query)));\n }", "function ssSearchRegexFilter( $where ) {\n if( !empty( $this->ss_input_post_title ) ) {\n $where .= \" AND wp_posts.post_title != '\" . $this->ss_input_post_title_origin . \"' AND wp_posts.post_title REGEXP '.[[:<:]]\" . implode( '[[:>:]]|.[[:<:]]', $this->ss_input_post_title ) . \"[[:>:]]' \"; \n }\n\n return $where;\n }", "public function highlightMatches(string $query, string $text): string\n\t{\n\t\t$queryWords = str_word_count($query, 1, implode('', $this->specialChars));\n\t\t$snippetWords = str_word_count(str_replace('-', ' ', $text), 1, implode('', $this->specialChars));\n\t\t$replaces = [];\n\t\tforeach ($queryWords as $word) {\n\t\t\tforeach ($snippetWords as $snippetWord) {\n\t\t\t\t// case-insensitive matching. accent-insensitive matching\n\t\t\t\tif (strtolower(str_replace($this->specialChars, $this->specialReplaces, $word)) ===\n\t\t\t\t\tstrtolower(str_replace($this->specialChars, $this->specialReplaces, $snippetWord))) {\n\t\t\t\t\t$replaces['/\\b' . preg_quote($snippetWord, '/') . '\\b/'] = str_replace('%word%', $snippetWord, $this->highlightTemplate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn preg_replace(array_keys($replaces), array_values($replaces), $text);\n\t}", "function refine_title($string) {\n\n\t\t// replace underscores with spaces\n\t\t$string = preg_replace(\"(_)\", \" \", $string);\n\n\t\t// replace '%20' with space\n\t\t$string = preg_replace(\"(%20)\", \" \", $string);\n\n\t\t// replace multiple spaces with single space\n\t\t$string = preg_replace(\"([ ]{2,})\", \" \", $string);\n\n\t\treturn trim(ucwords(strtolower($string)));\n\t}", "function BadWordFunc ($RemoveBadWordText) {\n\t$RemoveBadWordText = eregi_replace(\"fuc?k|[kc]unt|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k\", \"****\", $RemoveBadWordText);\n \treturn $RemoveBadWordText;\n}", "function tagspaces($t)\r\n{\r\n $tolkiens = array(' ', '(', ')', '-', '+');\r\n $result = str_replace($tolkiens, '%', $t);\r\n return $result;\r\n}", "function get_sanitized_search_query($search_query)\n\t{\n\t\t$lowercase_search_query = strtolower(substr($search_query,0,20000));\t\n\t\t$trimed_search_query = trim($lowercase_search_query);\t\n\t\t$santizied_search_query = preg_replace('/[^[:alnum:]\\- ]/i', '', $trimed_search_query);\n\t\t\n\t\treturn $santizied_search_query;\n\t}", "function cf_search_where( $where ) {\n global $pagenow, $wpdb;\n\n if ( is_search() ) {\n $where = preg_replace(\n \"/\\(\\s*\".$wpdb->posts.\".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\".$wpdb->posts.\".post_title LIKE $1) OR (\".$wpdb->postmeta.\".meta_value LIKE $1)\", $where );\n }\n\n return $where;\n}", "function _filterStopWords($query) {\n\t\t$query = preg_replace_callback(\"#\\\"(.*)\\\"#U\",array($this, '_removeStopWords'), $query);\n\t\treturn $query;\n\t}", "function replace( $search, $replace ) {\n\treturn partial( 'str_replace', $search, $replace );\n}", "function normalizeText( $text, $isMetaData = false )\n {\n //include_once( 'lib/ezi18n/classes/ezchartransform.php' );\n $trans = eZCharTransform::instance();\n $text = $trans->transformByGroup( $text, 'search' );\n\n // Remove quotes and asterix when not handling search text by end-user\n if ( $isMetaData )\n {\n $text = str_replace( array( \"\\\"\", \"*\" ), array( \" \", \" \" ), $text );\n }\n\n return $text;\n }", "function content_search_highlight( $text, $highlight )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$highlight = $this->parse_clean_value( urldecode( $highlight ) );\n\t\t$loosematch = strstr( $highlight, '*' ) ? 1 : 0;\n\t\t$keywords = str_replace( '*', '', str_replace( \"+\", \" \", str_replace( \"++\", \"+\", str_replace( '-', '', trim($highlight) ) ) ) );\n\t\t$keywords\t= str_replace( '\\\\', '&#092;', $keywords );\n\t\t$word_array = array();\n\t\t$endmatch = \"(.)?\";\n\t\t$beginmatch = \"(.)?\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Go!\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $keywords )\n\t\t{\n\t\t\tif ( preg_match(\"/,(and|or),/i\", $keywords) )\n\t\t\t{\n\t\t\t\twhile ( preg_match(\"/,(and|or),/i\", $keywords, $match) )\n\t\t\t\t{\n\t\t\t\t\t$word_array = explode( \",\".$match[1].\",\", $keywords );\n\t\t\t\t\t$keywords = str_replace( $match[0], '' ,$keywords );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( strstr( $keywords, ' ' ) )\n\t\t\t{\n\t\t\t\t$word_array = explode( ' ', str_replace( ' ', ' ', $keywords ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$word_array[] = $keywords;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! $loosematch )\n\t\t\t{\n\t\t\t\t$beginmatch = \"(^|\\s|\\>|;)\";\n\t\t\t\t$endmatch = \"(\\s|,|\\.|!|<br|&|$)\";\n\t\t\t}\n\t\n\t\t\tif ( is_array($word_array) )\n\t\t\t{\n\t\t\t\tforeach ( $word_array as $keywords )\n\t\t\t\t{\n\t\t\t\t\tpreg_match_all( \"/{$beginmatch}(\".preg_quote($keywords, '/').\"){$endmatch}/is\", $text, $matches );\n\t\t\t\t\t\n\t\t\t\t\tfor ( $i = 0; $i < count($matches[0]); $i++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t$text = str_replace( $matches[0][$i], $matches[1][$i].\"<span class='searchlite'>\".$matches[2][$i].\"</span>\".$matches[3][$i], $text );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $text;\n\t}", "private function sanitizeSearchQuery(string $query): string\n {\n return trim(preg_replace('/[[:space:]]+/', ' ', $query));\n }", "protected function prepare_term_regex( $term ) {\n $term = str_replace('\\\\\\'', '\\'', $term);\n $term = preg_quote( $term, '/' );\n $search = array( ' ', '&', ',' );\n $replace = array( '\\s', '\\&', '\\,' );\n\t $term = str_replace( $search, $replace, $term );\n return preg_replace( '/(\\\"|\\\\\\'|\\“|\\”|\\‘|\\’|\\«|\\»)/i', '[\\\"\\\\\\'\\“\\”\\‘\\’\\«\\»]', $term );\n }", "private function _getSearchStringQuery()\n {\n $words = [];\n //split string depend on quote\n preg_match_all('/\"(?:\\\\\\\\.|[^\\\\\\\\\"])*\"|\\S+/', Input::get('search.value'), $matches);\n if (!empty($matches[0])) {\n //remove quote in each part\n foreach ($matches[0] as $key => $word) {\n $words[$key] = preg_replace('/\"|\\'/', '', $word);\n if (empty($words[$key])) {\n unset($words[$key]);\n }\n }\n //create query with each search column\n foreach ($this->column_search as $item) {\n // create query with each part of search string\n $this->query->where( function($q) use($item, $words) {\n $q->where($item, 'like', '%'.$words[0].'%');\n $wordNumb = count($words);\n for ($i = 1; $i < $wordNumb; $i++) {\n $q->orWhere($item, 'like', '%'.$words[$i].'%');\n }\n });\n }\n }\n // store to hightligh matching word in title of document\n $this->sSearch = $words;\n }", "function clean_for_aiml_match($text)\n{\n\t$otext = $text;\n\t$text= remove_allpuncutation($text); //was not all before\n\t$text= whitespace_clean($text);\n\t$text= captialise($text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\t\n\treturn $text;\n}", "function _scanner_batch_execute_search_and_replace($search, $replace) {\n // Set up the Session values that Scanner module needs.\n $_SESSION['scanner_preceded'] = NULL;\n $_SESSION['scanner_followed'] = NULL;\n $_SESSION['scanner_mode'] = variable_get('scanner_mode', 0);\n $_SESSION['scanner_wholeword'] = variable_get('scanner_wholeword', 0);\n $_SESSION['scanner_published'] = variable_get('scanner_published', 0);\n $_SESSION['scanner_regex'] = variable_get('scanner_regex', 0);\n unset($_SESSION['scanner_search']);\n\n // Allow other modules to alter the search value.\n // Use this in case, you want to programmatically modify the\n // search or replace string value.\n module_invoke_all('example_thingy', $search, $replace);\n drupal_alter('scanner_batch_modify_strings', $search, $replace);\n\n\n // Set Session variables for search and replace values.\n $_SESSION['scanner_search'] = $search;\n $_SESSION['scanner_replace'] = $replace;\n\n // Run Search and Replace.\n $results = scanner_execute('search');\n\n // Return True if Scanner was successful.\n if ($results = scanner_execute('replace')) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n}", "function smarty_modifier_myreplace($string, $search) {\n\tif (count($search) > 0) {\n\t\t$newstring = strtr($string, $search);\n\t\treturn $newstring;\n\t} else {\n\t\treturn $string;\n\t}\n}", "function set_keywords_from_search_query()\n\t{\n\t\t$santizied_search_query = $this->get_sanitized_search_query($this->search_query);\n\t\n\t\t$keywords_to_search_for = explode(' ',$santizied_search_query);\n\t\t$unique_keywords = array_unique($keywords_to_search_for);\n\t\t\n\t\t$this->keywords_to_search_for = $this->remove_ignored_keywords_from_array($unique_keywords);\n\t}", "function apachesolr_clean_text($text) {\r\n // Add spaces before stripping tags to avoid running words together.\r\n $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());\r\n // Decode entities and then make safe any < or > characters.\r\n return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');\r\n}", "function replace($text){\n\t\t\t\t\t\t\t\t\t\t$arrayText = array('TRUONG TIEU HOC','TRUONG THCS', 'TRUONG THPT');\n\t\t\t\t\t\t\t\t\t\t$str = \"\";\n\t\t\t\t\t\t\t\t\t\tfor ($i=0; $i < 3 ; $i++) { \n\t\t\t\t\t\t\t\t\t\t\tif (strpos($text, $arrayText[$i]) !== false) {\n\t\t\t\t\t\t\t\t\t\t\t\t$str = str_replace($arrayText[$i],\"\",$text);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn $str;\n\t\t\t\t\t\t\t\t\t}", "function verifyTextSearchReplaceAll(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE));\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function CleanFullTextString($searchstring)\n\t{\n\t\treturn $searchstring;\n\t}", "public static function filter($str, $censorWords, $replacement = '*', $word = true) {\n\t\tif (! $word)\n\t\t\treturn str_ireplace ( $censorWords, $replacement, $str );\n\t\t\n\t\tforeach ( $censorWords as $c )\n\t\t\t$str = preg_replace ( \"/\\b(\" . str_replace ( '\\*', '\\w*?', preg_quote ( $c ) ) . \")\\b/i\", $replacement, $str );\n\t\t\n\t\treturn $str;\n\t}", "function check_searchword($string){\n\t\t//white list\n\t\tif(\t$GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] !== 'utf-8'){\n\t\t\t$searchword_pattern = utf8_decode('/^[A-Za-z0-9äöüÄÖÜß\\- ]*$/');\n\t\t}else{\n\t\t\t$searchword_pattern = '/^[A-Za-z0-9äöüÄÖÜß\\- ]*$/';\n\t\t}\n\n\t\tif(!preg_match($searchword_pattern, $string)){\n\t\t\t//collect all occurring illegal characters\n\t\t\t#$arr_bad_chars=array();\n\t\t\tforeach (count_chars($string, 1) as $i => $val) {\n\t\t\t\tif(!preg_match($searchword_pattern, chr($i))){\n\t\t\t\t\t#$arr_bad_chars[]=chr($i);\n\t\t\t\t\t$string = str_replace(chr($i),\"\",$string);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $string;\n\t}", "public function stripWildcards($word)\n {\n return str_replace($this->wildcard, '%', trim($word, $this->wildcard));\n }", "function prepareSearchTerms($terms) {\n $terms = ucwords($terms); // Capitalise each word.\n return $terms;\n}", "public function filter($pat, $replacement=\"\") {\r\n $this->contents = preg_replace($pat, $replacement, $this->contents);\r\n //$this->contents = preg_filter($pat, $replacement, $this->contents);\r\n }", "function censorText($text){\n\t\tglobal $_JC_CONFIG;\n\t\t\n\t\tif ($_JC_CONFIG->get('censoredWords')) {\n\t\t\t$censoredWords = explode(\",\", $_JC_CONFIG->get('censoredWords'));\n\t\t\tarray_walk($censoredWords, \"jctrim\");\n\t\t\t$replaceWords = $censoredWords;\n\t\t\t$count = 0;\n\t\t\tforeach ($replaceWords as $word) {\n\t\t\t\t$cword = \"\";\n\t\t\t\t$word = trim($word);\n\t\t\t\t\n\t\t\t\t// Only word longer than 2 character wil be censored\n\t\t\t\tif(isset($word) && strlen($word) > 2){\n\t\t\t\t\tfor ($i = 0; $i < @strlen($word); $i++)\n\t\t\t\t\t\t$cword .= \"*\";\n\t\n\t\t\t\t\t$cword[0] = @$word[0];\n\t\t\t\t\t$cword[strlen($word) - 1] = @$word[strlen($word) - 1];\n\t\t\t\t\t$replaceWords[$count] = $cword;\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$count = 0;\n\t\t\tforeach ($censoredWords as $word) {\n\t\t\t\t$word = trim($word);\n\t\t\t\t\n\t\t\t\t// Only word longer than 2 character wil be censored\n\t\t\t\tif(isset($word) && @strlen($word) > 2){\n\t\t\t\t\t$censoredWords[$count] = $word;\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($text)){\n\t\t\t\tfor($i = 0; $i < count($i); $i++){\n\t\t\t\t\t$text[$i] = str_ireplace($censoredWords, $replaceWords, $text[$i] );\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$text = str_ireplace($censoredWords, $replaceWords, $text);\n\t\t}\n\t\t\n\t\treturn $text;\n\t}", "public static function replaceSpecialChars($_input, $_replaceWhitespace = true)\n {\n $search = array('ä', 'ü', 'ö', 'ß', 'é', 'è', 'ê', 'ó' ,'ô', 'á', 'ź', 'Ä', 'Ü', 'Ö', 'É', 'È', 'Ê', 'Ó' ,'Ô', 'Á', 'Ź');\n $replace = array('ae', 'ue', 'oe', 'ss', 'e', 'e', 'e', 'o', 'o', 'a', 'z', 'Ae', 'Ue', 'Oe', 'E', 'E', 'E', 'O', 'O', 'a', 'z');\n \n $output = str_replace($search, $replace, $_input);\n\n if ($_replaceWhitespace) {\n $pattern = '/[^a-zA-Z0-9._\\-]/';\n } else {\n $pattern = '/[^a-zA-Z0-9._\\-\\s]/';\n }\n return preg_replace($pattern, '', $output);\n }", "function replace($text){\n\t\treturn preg_replace('/[^a-z A-Z]/','',strtolower(czech::autoCzech($text,'asc')));\n\t}", "function obtain_word_list(&$orig_word, &$replacement_word)\n{\n\tglobal $db;\n\n\t//\n\t// Define censored word matches\n\t//\n\t$sql = \"SELECT word, replacement\n\t\tFROM \" . WORDS_TABLE;\n\tif( !($result = $db->sql_query($sql)) )\n\t{\n\t\tmessage_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);\n\t}\n\n\tif ( $row = $db->sql_fetchrow($result) )\n\t{\n\t\tdo \n\t\t{\n\t\t\t$orig_word[] = '#\\b(' . str_replace('\\*', '\\w*?', preg_quote($row['word'], '#')) . ')\\b#i';\n\t\t\t$replacement_word[] = $row['replacement'];\n\t\t}\n\t\twhile ( $row = $db->sql_fetchrow($result) );\n\t}\n\n\treturn true;\n}", "private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }", "public static function escapeLikePattern($text){\r\n\t\t\t$text = str_replace('\\\\', '', $text);//apparently a backslash is ignored when using the LIKE operator\r\n\t\t\t$text = self::escape($text);\r\n\t\t\tif($text !==false){\r\n\t\t\t\t$text = str_replace('%', '\\%', $text);\r\n\t\t\t\t$text = str_replace('_', '\\_', $text);\r\n\t\t\t\tif(mb_strlen($text)>=3) $text .= '%';\r\n\t\t\t}\r\n\t\t\treturn $text;\r\n\t\t}", "function capital_P_dangit( $text ) {\n\t$current_filter = current_filter();\n\tif ( 'the_title' === $current_filter || 'wp_title' === $current_filter )\n\t\treturn str_replace( 'Wordpress', 'WordPress', $text );\n\t// Still here? Use the more judicious replacement\n\tstatic $dblq = false;\n\tif ( false === $dblq ) {\n\t\t$dblq = _x( '&#8220;', 'opening curly double quote' );\n\t}\n\treturn str_replace(\n\t\tarray( ' Wordpress', '&#8216;Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),\n\t\tarray( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),\n\t$text );\n}", "function simulated_wildcard_match($context, $word, $full_cover = false)\n{\n $rexp = str_replace('%', '.*', str_replace('_', '.', str_replace('\\\\?', '.', str_replace('\\\\*', '.*', preg_quote($word)))));\n if ($full_cover) {\n $rexp = '^' . $rexp . '$';\n }\n\n return preg_match('#' . str_replace('#', '\\#', $rexp) . '#i', $context) != 0;\n}", "function remove_words($input,$replace,$words_array = array(),$unique_words = true)\r\n\r\n{\r\n\r\n\t //separate all words based on spaces\r\n\r\n\t $input_array = explode(' ',$input);\r\n\r\n\t //create the return array\r\n\r\n\t $return = array();\r\n\r\n\t\r\n\r\n\t //loops through words, remove bad words, keep good ones\r\n\r\n\t foreach($input_array as $word)\r\n\r\n\t {\r\n\r\n\t\t//if it's a word we should add...\r\n\r\n\t\tif(!in_array($word,$words_array) && ($unique_words ? !in_array($word,$return) : true))\r\n\r\n\t\t{\r\n\r\n\t\t $return[] = $word;\r\n\r\n\t\t}\r\n\r\n\t }\r\n\r\n\t\r\n\r\n\t //return good words separated by dashes\r\n\r\n\t return implode($replace,$return);\r\n\r\n}", "private function escapeMultiwords($query) {\n $query = ' ' . $query . ' ';\n for ($i = count($this->context->dictionary->multiwords); $i--;) {\n $multiword = $this->context->dictionary->multiwords[$i];\n $query = str_replace(' ' . $multiword . ' ', ' \"' . $multiword . '\" ', $query);\n }\n return trim($query);\n }", "private function searchAndReplace()\n {\n foreach ($this->objWorksheet->getRowIterator() as $row)\n\t\t{\n\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\tforeach ($cellIterator as $cell)\n\t\t\t{\n\t\t\t\t$cell->setValue(str_replace($this->_search, $this->_replace, $cell->getValue()));\n\t\t\t}\n\t\t}\n }", "function wildcardify($s, $wrap = '%') {\n\n\n $result = '';\n $escape = false;\n $len = strlen($s);\n $foundWildcard = false;\n\n for($i = 0; $i < $len; $i++) {\n\n $c = substr($s, $i, 1);\n\n if ($escape) {\n $result .= $c;\n $escape = false;\n continue;\n } else if ($c === '\\\\') {\n $escape = true;\n continue;\n }\n\n if ($c === '%') $c = '\\\\%';\n if ($c === '_') $c = '\\\\_';\n\n $foundWildcard = $foundWildcard || ($c === '*' || $c === '?');\n\n if ($c === '*') $c = '%';\n if ($c === '?') $c = '_';\n\n $result .= $c;\n }\n\n if ($wrap && !$foundWildcard) {\n $result = \"{$wrap}{$result}{$wrap}\";\n }\n\n return $result;\n }", "function filter($word)\r\n{\r\n $word = trim($word);\r\n $word = preg_replace('/[^A-Za-z0-9\\-]/','', $word);\r\n return strtolower($word);\r\n}", "function wp_wikipedia_excerpt_substitute($match){\n #Mike Lay of http://www.mikelay.com/ suggested query.\n return '<a href=\"http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search='.urlencode($match[1]).'\">'.$match[1].'</a>';\n}", "function decode_highlight_search_results( $text ) {\n if ( is_search() ) {\n \t$sr = get_search_query();\n\t\t$keys = implode( '|', explode( ' ', get_search_query() ) );\n\t\tif ($keys != '') { // Check for empty search, and don't modify text if empty\n\t\t\t$text = preg_replace( '/(' . $keys .')/iu', '<mark class=\"search-highlight\">\\0</mark>', $text );\n\t\t}\n }\n return $text;\n}", "function regexspacecleaner ($text, $chartocleanaround=\"\", $spacereplacement=\" \"){\n\t$regex_pattern=\"/&nbsp;|&#0160;|&#xa0;/i\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn breaks into a single space\n\t$regex_pattern=\"/<\\s*br\\s*\\/\\s*>/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn tabs, newlines, and form feeds into a single space\n\t$regex_pattern=\"/\\t|\\r|\\n|\\f|\\v/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's turn all runs of white space into a single space\n\t$regex_pattern=\"/\\s{2,}/\";\n\t$text = preg_replace($regex_pattern, \" \", $text);\n\t\n\t//let's get rid of beginning and trailing spaces\n\t$regex_pattern=\"/^\\s|\\s$/\";\n\t$text = preg_replace($regex_pattern, \"\", $text);\n\t\n\t//get rid of spaces around $chartocleanaround\n\tif($chartocleanaround!==\"\"){\n\t\t$regex_pattern=\"/\\s*$chartocleanaround\\s*/\";\n\t\t$text = preg_replace($regex_pattern, \"$chartocleanaround\", $text);\n\t\t//get rid of any runs of the $chartocleanround\n\t\t$regex_pattern=\"/$chartocleanaround+/\";\n\t\t$text = preg_replace($regex_pattern, \"$chartocleanaround\", $text);\n\t}\n\t\n\t//replace remaining spaces with $spacereplacement\n\tif($spacereplacement!==\" \"){\n\t\t$regex_pattern=\"/\\s+/\";\n\t\t$text = preg_replace($regex_pattern, \"$spacereplacement\", $text);\n\t}\n\t\n\treturn $text;\n}", "public static function contains($word)\n {\n return '%' . str_replace(' ', '%', $word) . '%';\n }", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "function clean_word_formatting($string){\n $search = array(chr(145), chr(146), chr(147), chr(148), chr(151));\n $replace = array(\"'\", \"'\", '\"', '\"', '-');\n return str_replace($search, $replace, $string);\n}", "public function getSearchText();", "function purge_searchtrm($search){\n\t\t$search = mysqli_escape_string($search);\n\t\t$search = str_replace('-', '', $search);\n\t\treturn $search;\n\t}", "public function getSearchPattern();", "public function getSearchPattern();", "public function Filter_fulltext($searchWords, $negate = false) {\r\n\t\t$searchWords= trim($searchWords);\r\n\t\t$searchWords= TodoyuArray::trimExplode(' ', $searchWords);\r\n\t\t$queryParts\t= false;\r\n\r\n\t\tif( sizeof($searchWords) > 0 ) {\r\n\t\t\t$searchInFields\t= array(\r\n\t\t\t\tself::TABLE . '.id',\r\n\t\t\t\tself::TABLE . '.title',\r\n\t\t\t\tself::TABLE . '.description',\r\n\t\t\t\t'ext_contact_company.title',\r\n\t\t\t\t'ext_contact_company.shortname'\r\n\t\t\t);\r\n\r\n\t\t\t$tables\t= array(\r\n\t\t\t\t'ext_contact_company'\r\n\t\t\t);\r\n\t\t\t$where\t= TodoyuSql::buildLikeQueryPart($searchWords, $searchInFields);\r\n\t\t\t$join\t= array(\r\n\t\t\t\tself::TABLE . '.id_company\t= ext_contact_company.id'\r\n\t\t\t);\r\n\r\n\t\t\t$queryParts = array(\r\n\t\t\t\t'tables'=> $tables,\r\n\t\t\t\t'where'\t=> $where,\r\n\t\t\t\t'join'\t=> $join\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $queryParts;\r\n\t}", "function usingRegExp()\r\n{ echo \"<br>\";\r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 5) Replace any word from the string using Regular Expression.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n\r\n echo \"Before replacing\".\"<br>\";\r\n $str = \"Php Hypertext Preprocessor\";\r\n echo $str.\"<br><br>\".\"After Replacing\".\"<br>\";\r\n $pattern = \"/Php/i\";\r\n echo preg_replace($pattern, \"PHP\", $str);\r\n}", "function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }", "function _deep_replace( $search, $subject ) {\n\t$subject = (string) $subject;\n\n\t$count = 1;\n\twhile ( $count ) {\n\t\t$subject = str_replace( $search, '', $subject, $count );\n\t}\n\n\treturn $subject;\n}", "private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function replace_original_search_query() {\n\t\tglobal $wp_query;\n\n\t\tif ( ! empty( $this->original_query ) ) {\n\t\t\t$wp_query->set( 's', $this->original_query );\n\t\t}\n\t}", "public function singularize($word)\n {\n $result = array_search($word, $this->specials, true);\n if ($result !== false) {\n return $result;\n }\n foreach ($this->singulars as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n\n return $word;\n }", "protected static function removeWord( $name, $pattern, $replacement = '' )\n {\n return trim( preg_replace( $pattern , $replacement, $name ) );\n }", "public function censor(string $text): string\n {\n $prohibited = Comparator::search($text, $this->dictionary->getWords(), $this->exactMatch);\n\n if (empty($prohibited)) {\n return $text;\n }\n\n usort($prohibited, function ($a, $b) {\n return mb_strlen($b) - mb_strlen($a);\n });\n\n return str_replace($prohibited, '***', $text);\n }", "function kickstart_search_text( $text ) {\n\t$search_text = __( 'Search', 'lean-kickstart' );\n\n\treturn $search_text;\n}", "static private function borkify( $text )\n {\n $textBlocks = preg_split( '/(%[^ ]+)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE );\n $newTextBlocks = array();\n foreach ( $textBlocks as $text )\n {\n if ( strlen( $text ) && $text[0] == '%' )\n {\n $newTextBlocks[] = (string) $text;\n continue;\n }\n\n $orgtext = $text;\n\n $searchMap = array(\n '/au/', '/\\Bu/', '/\\Btion/', '/an/', '/a\\B/', '/en\\b/',\n '/\\Bew/', '/\\Bf/', '/\\Bir/', '/\\Bi/', '/\\bo/', '/ow/', '/ph/',\n '/th\\b/', '/\\bU/', '/y\\b/', '/v/', '/w/', '/ooo/',\n );\n $replaceMap = array(\n 'oo', 'oo', 'shun', 'un', 'e', 'ee',\n 'oo', 'ff', 'ur', 'ee', 'oo', 'oo', 'f',\n 't', 'Oo', 'ai', 'f', 'v', 'oo',\n );\n $text = preg_replace( $searchMap, $replaceMap, $text );\n\n if ( $orgtext == $text && count( $newTextBlocks ) )\n {\n $text .= '-a';\n }\n $newTextBlocks[] = (string) $text;\n }\n $text = implode( '', $newTextBlocks );\n $text = preg_replace( '/([:.?!])(.*)/', '\\\\2\\\\1', $text );\n return \"[$text]\";\n }", "function cleanTitleString($string)\n{\n $count = count($string);\n\n for ($i=0; $i < $count; ++$i)\n {\n if ($string[$i] == '\\'')\n $string[$i] = '%';\n }\n\n return $string;\n}", "function our_str_replace($find, &$replacements, $subject)\n\n{\n\n $l = strlen($find);\n\n // allocate some memory\n\n $new_subject = str_repeat(' ', strlen($subject));\n\n $new_subject = '';\n\n foreach($replacements as $r)\n\n {\n\n if(($pos = strpos($subject, $find)) === false) break;\n\n $new_subject .= substr($subject, 0, $pos).$r;\n\n $subject = substr($subject, $pos+$l);\n\n // the above appears to be the fastest method\n\n //$subject = substr_replace($subject, $r, $pos, $l);\n\n //$subject = substr($subject, 0, $pos).$r.substr($subject, $pos+strlen($find));\n\n }\n\n $new_subject .= $subject;\n\n return $new_subject;\n\n}", "function alaya_filter_mark($text){ \n\tif(trim($text)=='')return ''; \n\t$text=preg_replace(\"/[[:punct:]\\s]/\",' ',$text); \n\t$text=urlencode($text); \n\t$text=preg_replace(\"/(%7E|%60|%21|%40|%23|%24|%25|%5E|%26|%27|%2A|%28|%29|%2B|%7C|%5C|%3D|\\-|_|%5B|%5D|%7D|%7B|%3B|%22|%3A|%3F|%3E|%3C|%2C|\\.|%2F|%A3%BF|%A1%B7|%A1%B6|%A1%A2|%A1%A3|%A3%AC|%7D|%A1%B0|%A3%BA|%A3%BB|%A1%AE|%A1%AF|%A1%B1|%A3%FC|%A3%BD|%A1%AA|%A3%A9|%A3%A8|%A1%AD|%A3%A4|%A1%A4|%A3%A1|%E3%80%82|%EF%BC%81|%EF%BC%8C|%EF%BC%9B|%EF%BC%9F|%EF%BC%9A|%E3%80%81|%E2%80%A6%E2%80%A6|%E2%80%9D|%E2%80%9C|%E2%80%98|%E2%80%99|%EF%BD%9E|%EF%BC%8E|%EF%BC%88)+/\",' ',$text); \n\t$text=urldecode($text); \n\treturn trim($text); \n}", "function replace_leading_spaces($string)\n{\n return preg_replace('/\\G /', '&nbsp;', $string);\n}", "private function _str_replace($p_str){\n\t\t// $to = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');\n\n\t\t// $str = explode(',',str_replace($from, $to, $p_str));\n\n\t\t// return str_replace('/\\s+/', ' ', word_limiter($str[0],7,''));\n\t\treturn preg_replace('/\\s+/', ' ',$p_str);\n\t}", "function remove_words($input, $replace, $words_array = array(), $unique_words = true) {\n //separate all words based on spaces\n $input_array = explode(' ', $input);\n ////create the return array\n $return = array();\n ////loops through words, remove bad words, keep good ones\n foreach ($input_array as $word) {\n //if it's a word we should add...\n if (!in_array($word, $words_array) && ($unique_words ? !in_array($word, $return) : true)) {\n $return[] = $word;\n }\n }\n //return good words separated by dashes\n return implode($replace, $return);\n }", "function __only1whitespace($text) {\n $text = preg_replace('!\\s+!', ' ', $text);\n return $text;\n }", "function preg_wildcard($pat) {\n return str_replace(array('*', '?', '/'),array('.*', '.', '\\/'), $pat);\n}", "public function word($value, $allow_whitespaces = false)\n\t{\n\t\treturn $allow_whitespaces ? preg_replace('/[^\\w\\s]/', '', $value)\n\t\t\t: preg_replace('/[^\\w]/', '', $value);\n\t}", "public static function reorederWordsInQuery($query, $searchField = null){\n $tokens = LuceneHelper::tokenize($query);\n $morphy = new MorphyFilter();\n $lucene = LuceneHelper::getInstance();\n $fieldNames = $searchField?\n array($searchField):\n array_diff($lucene->getFieldNames(true), array(\n 'PK',\n 'post_type',\n 'user_id',\n 'vip_search_status'\n ));\n foreach($tokens as $token){\n $normalized = $morphy->normalizeWord($token->text);\n $numDocs = 0;\n foreach($fieldNames as $fieldName){\n $term = new Zend_Search_Lucene_Index_Term($normalized, $fieldName);\n $numDocs += $lucene->docFreq($term);\n }\n $token->numDocs = $numDocs;\n }\n \n usort($tokens, array('SearchHelper', 'cmpTokens'));\n $words = array();\n foreach($tokens as $token){\n $words[]=$token->text;\n }\n return implode(' ', $words);\n }", "function clean_str( $text )\n\t{ // tomreyn says: I'm afraid this function is more likely to cause to trouble than to fix stuff (you have mysql escaping and html escaping elsewhere where it makes more sense, but strip off < and > here already, but then you don't filter non-visible bytes here)\n\t\t//$text=strtolower($text);\n\t\t//$code_entities_match = array('!','@','#','$','%','^','&','*','(',')','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",',','/','*','+','~','`','=');\n\t\t//$code_entities_replace = array('','','','','','','','','','','','','','','','','','','','','');\n\t\t$code_entities_match = array('$','%','^','&','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",'/','+','~','`','=');\n\t\t$code_entities_replace = array('','','','','','','','','','','','','');\n \n\t\t$text = str_replace( $code_entities_match, $code_entities_replace, $text );\n\t\treturn $text;\n\t}", "function like_escape($text)\n {\n }", "static function strReplace($search, array $replace, $subject) {\n foreach ($replace as $value) {\n $subject = preg_replace(\"/$search/\", $value, $subject, 1);\n }\n\n return $subject;\n }", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\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\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\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\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "private function prepareSearchString($searchString)\n {\n $searchString = preg_replace('/[^a-zA-Z0-9\\-\\.\\(\\)\\pL\\s]/u', '', $searchString);\n $searchString = trim($searchString);\n\n return $searchString;\n }", "public function sanitizeFreeText()\n {\n if ($this->locations) {\n foreach ($this->locations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->virtualLocations) {\n foreach ($this->virtualLocations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->links) {\n foreach ($this->links as $id => $lin) {\n $lin->sanitizeFreeText();\n }\n }\n if ($this->recurrenceOverrides) {\n foreach ($this->recurrenceOverrides as $id => $rec) {\n $rec->sanitizeFreeText();\n }\n }\n\n $this->title = AdapterUtil::reencode($this->title);\n $this->description = AdapterUtil::reencode($this->description);\n $this->keywords = AdapterUtil::reencode($this->keywords);\n }" ]
[ "0.6662183", "0.64149714", "0.61172026", "0.60683316", "0.59295064", "0.589712", "0.5817518", "0.578583", "0.5681057", "0.5548434", "0.5538875", "0.55084175", "0.55063283", "0.5474026", "0.54662937", "0.5466179", "0.5456904", "0.5448339", "0.5430218", "0.5429804", "0.5419971", "0.5382253", "0.5367437", "0.5361595", "0.533556", "0.5314338", "0.5311424", "0.52936196", "0.52779454", "0.52720076", "0.52679247", "0.5255411", "0.5247664", "0.5243041", "0.5232279", "0.52240676", "0.5218601", "0.5197869", "0.5195363", "0.519238", "0.5168257", "0.5150613", "0.5145405", "0.5137813", "0.51262635", "0.5096994", "0.5079635", "0.5071994", "0.50718224", "0.5068303", "0.5068066", "0.5052786", "0.5046604", "0.504535", "0.5033205", "0.50319815", "0.50188106", "0.50128835", "0.5006398", "0.49833676", "0.49832642", "0.49768394", "0.49731815", "0.49667457", "0.49613982", "0.49582803", "0.4956699", "0.4931635", "0.49131387", "0.48988205", "0.4874406", "0.48718205", "0.48718205", "0.4868238", "0.48649165", "0.4864449", "0.485929", "0.48441437", "0.48429316", "0.48425207", "0.48355207", "0.48312166", "0.4812851", "0.4795424", "0.47938657", "0.47928527", "0.47917327", "0.47874504", "0.47849417", "0.47830623", "0.47803846", "0.47801262", "0.4770179", "0.47662318", "0.4766223", "0.47645018", "0.4762172", "0.47563517", "0.47499356", "0.47486493" ]
0.6870011
0
Scope a query that matches a full text search of a term.
public function scopeSearch($query, $term) { $columns = implode(',',$this->searchable); $query->whereRaw("MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)" , $this->fullTextWildcards($term)); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeSearch($query, $term);", "public function scopeMatchingTerm($query, $term)\n {\n if ($term == '')\n return $query;\n else\n return $query->where('name', 'like', '%' . $term . '%')\n ->orWhere('description', 'like', '%' . $term . '%');\n }", "public function scopeSearch($query, $term): mixed\n {\n if (!is_null($term)) {\n return $query->where('name', 'ILIKE', \"%$term%\")\n ->orWhere('description', 'ILIKE', \"%$term%\");\n }\n\n return $query;\n }", "public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }", "public function scopeTerm($query, $term)\n {\n $query->where('term', $term);\n }", "public function scopeSearch($query, $term, $callback = null)\n {\n if(isset($this->searchable) && is_array($this->searchable) && count($this->searchable) > 0){\n\n $columns = implode(',',$this->searchable);\n\n $filters = [];\n $term = $this->extractFilterFromTerm($term, $filters);\n\n if(strlen($term) > 0)\n $query->whereRaw(\"MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)\", $this->fullTextWildcards($term));\n\n if(count($filters) > 0 && is_callable($callback))\n call_user_func_array($callback, [ $filters ]);\n\n return $query;\n\n }\n }", "public function scopeSearch($query, $terms)\n {\n foreach (Str::of($terms)->explode(' ') as $term) {\n $query->orWhere('title', 'LIKE', $term)\n ->orWhere('content', 'LIKE', $term);\n }\n\n return $query;\n }", "public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "public function scopeSearch($query)\n {\n $keyword = request('q');\n if ($keyword) {\n $model = $query->getModel();\n $searchable = $model->searchable;\n\n $local = Arr::where($searchable, function ($value, $key) {\n return is_numeric($key);\n });\n\n foreach ($local ?? [] as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query = $query->{$where}($field, 'like', \"%$keyword%\");\n }\n\n $relations = Arr::where($searchable, function ($value, $key) {\n return is_string($key);\n });\n\n foreach ($relations ?? [] as $key => $field) {\n $fields = Arr::wrap($field);\n $whereHas = empty($local) && $key == 0 ? 'whereHas' : 'orWhereHas';\n $query = $query->{$whereHas}($key, function ($query) use ($fields, $keyword) {\n foreach ($fields as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query->{$where}($field, 'like', \"%$keyword%\");\n }\n });\n }\n\n return $query;\n }\n }", "public function search($term = null);", "public function findBySearchTerm($query, $term = '', $facetConfiguration = [], $searchConfiguration = []);", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "public function scopeFilter($query, $term)\n {\n $term = '%' . $term . '%';\n\n return $query->where('first_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('email', 'LIKE', $term);\n }", "public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }", "public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function scopeFilterBySearchWord( $query )\n {\n $word = request() -> get( 'search' );\n $word = strtolower($word);\n\n if( $word )\n {\n $query \n -> where( 'id', 'like', '%'. $word .'%' )\n -> orWhereHas( 'charger_connector_type.charger', function( $q ) use( $word ) {\n $q \n -> where( 'code', 'like', '%'. $word .'%')\n -> orWhereRaw(\"lower(location->>'$.ka') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.en') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.ru') like '%{$word}%'\");\n })\n -> orWhereHas( 'user', function( $q ) use( $word ) {\n $q \n -> whereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\");\n });\n\n }\n }", "public function set_query($term = '') {\n if (!empty($term)) {\n $this->term = $term;\n }\n\n if (empty($this->term)) {\n $this->validquery = false;\n } else {\n $this->validquery = true;\n }\n\n if ($this->validquery and $this->validindex) {\n $this->results = $this->get_results();\n } else {\n $this->results = array();\n }\n }", "public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }", "public function scopeOfSearch($query, $keyword)\n {\n return $query->where('name','like','%'.$keyword.'%');\n }", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "protected function fullTextWildcards($term)\n {\n return str_replace(' ', '*', $term) . '*';\n \n }", "public function scopeSearch($query, $keyword)\n {\n return $query->shortCode($keyword)->orWhere(function (Builder $query) use ($keyword) {\n $query->contactName($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactNumber($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactEmail($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->product($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->services($keyword);\n });\n }", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function modifyQuery($query, SearchTerm $search);", "public function searchByKeyword($query);", "public function scopeSearch($query, $search) {\n $searchAlt = str_replace(' ', '_', $search);\n\n if(empty($search)) {\n return $query;\n } else {\n return $query\n ->where('filename', 'like', '%' . $search . '%')\n ->Orwhere('filename', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $search . '%');\n }\n }", "public function scopeSearch($query, string $q): Builder\n {\n return $query\n ->where('title', 'LIKE', \"%{$q}%\")\n ->orWhere('desc', 'LIKE', \"%{$q}%\");\n }", "public function scopeSearch($query, $search)\n\t{\n\t\treturn $query->where('address', 'like', '%' . $search . '%')\n\t\t\t->orWhere('city', 'like', '%' . $search . '%')\n\t\t\t->orWhere('zip', 'like', '%' . $search . '%')\n\t\t\t->orWhere('title', 'like', '%' . $search . '%')\n\t\t\t->orWhere('description', 'like', '%' . $search . '%')\n\t\t\t->get();\n\t}", "public function scopeSearched($query)\n {\n $search = request()->query('search');\n\n if (!$search && $search != 0) {\n return $query;\n }\n\n return $query->where('number', 'LIKE', \"%{$search}\");\n }", "public function query($term) {\n $matches = $this->getMatchesService('vienna',$term,array('showSyn'=>false,'NearMatch'=>false,'includeCommonNames'=>true));\n return $matches;\n }", "public function scopeSearch(Builder $query)\n {\n $search = app('request')->input('search', null);\n\n if($search && static::SEARCH)\n {\n $fields = static::SEARCH;\n return $query->where(function(Builder $query) use ($search, $fields){\n foreach ($fields as $field) {\n $query = $query->orWhere( $field, \"LIKE\", \"%{$search}%\" );\n }\n return $query;\n });\n }\n\n return $query;\n }", "public function searchByTerm($term)\n {\n //objet qui permet de crée des requete SQL pour une table donné\n $queryBuilder = $this->createQueryBuilder('article');\n\n // requete sql mais en language PHP qui permet d'aller dans article et de chercher ce qu'on veux en fonction de term\n $query = $queryBuilder\n ->select('article')\n\n ->where('article.content LIKE :term')\n ->setParameter('term', '%'.$term.'%')\n\n //transforme la sorte de requette sql en vrai requette sql\n ->getQuery();\n\n return $query->getResult();\n }", "public function basicSearch($term)\n {\n return $this->client->search([\n 'index' => $this->index,\n 'type' => $this->type,\n 'body' => [\n 'query' => [\n 'query_string' => [\n 'query' => $term\n ]\n ]\n ]\n ]);\n }", "public function scopeLikeTitle($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('title', 'like', \"%$text%\");\n }", "private function addQueryScopeForSearch(Builder $query, $value) {\n $query->matchesSearchQuery($value);\n }", "public function scopeSearch($query, $input) {\n \n if (isset($input['s'])) {\n $query->whereRaw('customer_name LIKE \"%'. array_get($input, 's', '') .'%\"');\n }\n\n return $query;\n }", "public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)\n {\n return false;\n }", "public function search($q);", "function _culturefeed_search_ui_sanitize_query_term($term) {\n // Replace special characters with normal ones.\n $term = culturefeed_search_transliterate($term);\n\n // Replace AND to a space.\n $term = str_replace(' AND ', ' ', $term);\n\n $query_parts = explode(' OR ', $term);\n array_walk($query_parts, function(&$search_string) {\n\n // Strip of words between quotes. The spaces don't need to be replaced to AND for them.\n preg_match_all('/\".*?\"/', $search_string, $matches);\n foreach ($matches[0] as $match) {\n $search_string = str_replace($match, '', $search_string);\n }\n\n $search_string = str_replace(' ', ' ', $search_string);\n\n // Put words with a special character between quotes.\n $words = explode(' ', trim($search_string));\n $parts = array();\n $special_characters = '-!?&/';\n foreach ($words as $word) {\n if (strpbrk($word, $special_characters)) {\n $word = '\"' . $word . '\"';\n }\n $parts[] = $word;\n }\n\n // Replace spaces between multiple search words by 'AND'.\n $search_string = implode(' AND ', $parts);\n\n // Add back the words between quotes.\n if (!empty($matches[0])) {\n if (empty($search_string)) {\n $search_string .= implode(' AND ', $matches[0]);\n }\n else {\n $search_string .= ' AND ' . implode(' AND ', $matches[0]);\n }\n }\n\n });\n\n return implode(' OR ', $query_parts);\n}", "public function scopeSearch(Builder $query, string $name): Builder\n {\n return $query->where('title', 'ILIKE', \"%$name%\")\n ->orWhere('description', 'ILIKE', \"%$name%\");\n }", "function search($term, $fields=array(), $limit=array()) { /* {{{ */\n\t\t$querystr = '';\n\t\t$term = trim($term);\n\t\tif($term) {\n\t\t\t$querystr = substr($term, -1) != '*' ? $term.'*' : $term;\n\t\t}\n\t\tif(!empty($fields['owner'])) {\n\t\t\tif(is_string($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= 'owner:'.$fields['owner'];\n\t\t\t} elseif(is_array($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= '(owner:';\n\t\t\t\t$querystr .= implode(' OR owner:', $fields['owner']);\n\t\t\t\t$querystr .= ')';\n\t\t\t}\n\t\t}\n\t\tif(!empty($fields['category'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(category:';\n\t\t\t$querystr .= implode(' OR category:', $fields['category']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['status'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$status = array_map(function($v){return $v+10;}, $fields['status']);\n\t\t\t$querystr .= '(status:';\n\t\t\t$querystr .= implode(' OR status:', $status);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['user'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(users:';\n\t\t\t$querystr .= implode(' OR users:', $fields['user']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\ttry {\n\t\t\t$result = $this->index->find($querystr, $limit);\n\t\t\t$recs = array();\n\t\t\tforeach($result[\"hits\"] as $hit) {\n\t\t\t\t$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);\n\t\t\t}\n\t\t\treturn array('count'=>$result['count'], 'hits'=>$recs, 'facets'=>array());\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "protected function modelQueryBuilder()\n {\n $queryTerm = $this->queryTerm();\n\n return Occasion::\n oldest('rank')->\n\n keywordBy($queryTerm['keyword_by'],\n $queryTerm['keyword'])->\n active($queryTerm['active']);\n }", "public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }", "public function querySpellingSuggestions($query){\n\t\t\treturn $this->query('SpellingSuggestions',$query);\n\t\t}", "public function findBySearchTerm($searchterm = '') {\n\n\t\t\t// create the query object\n\t\t$query = $this->createQuery();\n\n\t\t\t// break up the searchterm into searchwords\n\t\t$searchwords = Tx_Catalogueraisonne_Utility_Search::wordSplit($searchterm);\n\n\t\t\t// create constraints if multiple searchwords\n\t\tif (count($searchwords) > 0) {\n\t\t\tforeach ($searchwords as $searchword) {\n\t\t\t\t$searchword = '%' . $searchword. '%';\n\t\t\t\t$autConstraints[] = $query->like('aut', $searchword);\n\t\t\t\t$titelConstraints[] = $query->like('titel', $searchword);\n\t\t\t\t$seriesConstraints[] = $query->like('series', $searchword);\n\t\t\t}\n\t\t\t$query->matching(\n\t\t\t\t$query-> logicalOr(\n\t\t\t\t\t$query->logicalAnd($autConstraints),\n\t\t\t\t\t$query->logicalAnd($titelConstraints),\n\t\t\t\t\t$query->logicalAnd($seriesConstraints)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t\t// result order\n\t\t$query->setOrderings(\n\t\t\tarray('aut' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING),\n\t\t\tarray('titel' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)\n\t\t);\n\n\t\t\t// go\n\t\treturn $query->execute();\n\t}", "private function Sql($term) {\r\n $query = trim($term);\r\n $query = trim(preg_replace(\"/(\\\\s+)+/\", \" \", $query));\r\n $keywords = array_unique(explode(' ', $query));\r\n\r\n // Array containing a list of all field names\r\n $all = array();\r\n // Get a full list of field names\r\n foreach($this->config as $item) {\r\n $all = array_merge($all, array_keys($item['select']));\r\n }\r\n $all = array_unique($all);\r\n // Generate the SQL\r\n $unions = array();\r\n $params = array();\r\n foreach($this->config as $table => $item) {\r\n $selects = array('? AS `__table`');\r\n $params[] = $table;\r\n $ifs = array();\r\n // Select clause\r\n foreach($all as $fieldName) {\r\n if (!array_key_exists($fieldName, $item['select'])) {\r\n $selects[] = sprintf('NULL AS `%s`', $fieldName);\r\n continue;\r\n } elseif (empty($item['select'][$fieldName]['subquery'])) {\r\n $selects[] = sprintf('`%s`', $fieldName);\r\n } else {\r\n $selects[] = sprintf('(%s) AS `%s`', $item['select'][$fieldName]['subquery'], $fieldName);\r\n $params = array_merge($params, $item['select'][$fieldName]['params']);\r\n }\r\n }\r\n foreach($all as $fieldName) {\r\n // Search score\r\n if (!array_key_exists($fieldName, $item['index'])) continue;\r\n if (empty($item['select'][$fieldName]['subquery'])) {\r\n // Exact match\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) = LOWER(?), ?, 0)\";\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $query . '%';\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $kw . '%';\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n } else {\r\n // Exact match\r\n $subquery = sprintf('(%s)', $item['select'][$fieldName]['subquery']);\r\n $subparams = $item['select'][$fieldName]['params'];\r\n $ifs[] = \"IF(LOWER({$subquery}) = LOWER(?), ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $query . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $kw . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n }\r\n }\r\n $unions[] = sprintf('SELECT %s, %s AS `__score` FROM `%s`', implode(', ', $selects), (empty($ifs) ? '0' : implode(' + ', $ifs)), $table);\r\n }\r\n $this->sql[$term] = implode(' UNION ', $unions);\r\n $this->params = $params;\r\n }", "public function scopeSearch(Builder $query, ?string $search)\n { \n\n if( $search )\n {\n return $query\n ->where('casestudies.title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.description', 'like', '%'.$search.'%')\n ->orWhere('casestudies.content', 'like', '%'.$search.'%')\n ->orWhere('casestudies.casestudy_by', 'like', '%'.$search.'%')\n ->orWhere('casestudies.company', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_description', 'like', '%'.$search.'%')\n ->orwhereHas('category', \n function ($query) use ($search) {\n $query->Where('categories.title','like', '%'.$search.'%');\n })\n ->orwhereHas('createdBy', \n function ($query) use ($search) {\n $query->Where('users.name','like', '%'.$search.'%');\n });\n }\n return;\n }", "public function search($query);", "public function search($searchText) {\n\t\t$this->searchTerm = $searchText;\n\t\treturn $this;\n\t}", "function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }", "public function scopeLikeDetails($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('details', 'like', \"%$text%\");\n }", "public function setSearchTerm($term)\n {\n $this->searchTerm = $term;\n }", "public function findFulltext($query, $key = 'text')\n {\n if ( empty($query) ) {\n return null;\n }\n return $this\n ->findAll()\n ->where(\n \"(`name` LIKE ?) OR (LOWER(`\" . $key . \"`) LIKE ?)\",\n \"%\" . strtolower($query) . \"%\",\n \"%\" . strtolower($query) . \"%\"\n );\n }", "public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "function the_search_query()\n {\n }", "public function scopeSearch(Builder $query, $name)\n {\n return $query->where('name', '=', $name);\n }", "public function searchGlobalTerm ($term){\n $json = new JsonFile ($this->host. '/api/key/' . $term );\n $json->parse();\n \n return $json;\n }", "public function searchByName($query);", "public function search_result(string $term)\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news WHERE title LIKE '%{$term}%') as news,\n (SELECT COUNT(*) FROM accounts WHERE username LIKE '%{$term}%' OR email LIKE '%{$term}%') as accounts,\n (SELECT COUNT(*) FROM blog WHERE title LIKE '%{$term}%') as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "function search($term, $location) {\r\n $url_params = array();\r\n \r\n $url_params['term'] = $term;\r\n $url_params['location'] = $location;\r\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\r\n \r\n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\r\n }", "abstract protected function createQuickSearchFilter($searchTerm);", "public function setSearchTerm(string $term): self\n {\n $this->searchTerm = $term;\n $this->setSearchPattern(\n '/' . str_replace(\n '\\\\000',\n '.*',\n preg_quote(\n str_replace(\n '*',\n \"\\0\",\n $term\n ),\n '/'\n )\n ) . '/i'\n );\n\n return $this;\n }", "public function getByFullTextSearch($searchText, $showEmbargoed = false);", "public function search( $text ) {\n\t\t$this->params[ \"text_search\" ] = $text;\n\t\treturn $this;\n\t}", "function performSearch($sessionID, $table, $field, $term, $order){\r\n\t\tif($this->userCanPerformSearch('', $table)){\r\n\t\t\t//Allow user to search by sensitive or normal for level\r\n\t\t\tif($table == 'issues' && $field == 'Level'\r\n\t\t\t && $term!='A' && $term!='a' && $term!='B' && $term!='b'){\r\n\t\t\t\tif(strstr('sensitive', $term))\r\n\t\t\t\t\t$term = 'A';\r\n\t\t\t\telseif(strstr('normal', $term))\r\n\t\t\t\t\t$term = 'B';\r\n\t\t\t}\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\tif(!$this->fieldInTable($table, $field)){\r\n\t\t\t\t\tif($this->fieldInTable('X_PNSY_STUDENT', $field))\r\n\t\t\t\t\t\t$table = 'X_PNSY_STUDENT';\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$table = 'X_PNSY_ADDRESS';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s where s.$field like '%$term%' AND s.StudentID IN\r\n\t\t\t\t\t\t\t(SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID) AND s.StudentID = ss.ID GROUP BY s.StudentID\";\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_ADDRESS'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE s.$field LIKE '%$term%'AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) \r\n\t\t\t\t\t\t\tAND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\tif($field == 'STREET'){\r\n\t\t\t\t//\"SELECT ID, CONCAT(FirstName, ' ', MiddleIn, ' ', LastName) AS FullName FROM students WHERE\r\n\t\t\t\t//\tCONCAT(FirstName, ' ', MiddleIn, ' ', LastName) LIKE '%$name%'\";\r\n\t\t\t\t\r\n\t\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE (s.STREET_1 LIKE '%$term%' OR s.STREET_2 LIKE '%$term%'\r\n\t\t\t\t\t\t\tOR s.STREET_3 LIKE '%$term%' OR s.STREET_4 LIKE '%$term%' OR s.STREET_5 LIKE '%$term%') AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) AND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_STUDENT' && $field == 'ADVISOR'){\r\n\t\t\t\t$table = 'X_PNSY_FACULTY';\r\n\t\t\t\t$query = \"SELECT s . * FROM X_PNSY_STUDENT s, $table ss WHERE (CONCAT(ss.FIRST_NAME, ' ',\r\n\t\t\t\t\t\t\t ss.LAST_NAME) LIKE '%$term%') AND s.$field IN (SELECT ID FROM $table WHERE ID = s.$field)\r\n\t\t\t\t\t\t\tAND s.$field = ss.ID GROUP BY s.$field, s.ID\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$query = \"SELECT * FROM $table WHERE $field like '%$term%'\";\r\n// Michael Thompson * 12/07/2005 * Added Below line to tack order onto sql sentence\r\n if ($order != \"\") $query .= \" ORDER BY $order\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$return[$i] = $results;\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}", "public function scopeSearch($query, $key)\n {\n return $query->where('transaction_code', 'like', '%'.$key.'%')\n ->orWhere('description', 'like', '%'.$key.'%')\n ->orWhere('total', 'like', '%'.$key.'%');\n }", "public function scopeRamSearch($query, $search)\n {\n \t$brand = strtoupper($search);\n return $query = DB::table('rams')\n ->join('brands', 'rams.brand_id', '=', 'brands.id')\n ->select('rams.*', 'rams.type as Rtype', 'rams.id AS Rid', 'brands.id AS Bid', 'brands.name AS brand', 'rams.registered')\n ->where([ ['rams.type', 'LIKE', \"%$search%\"], ['rams.deleted_at', '=', null] ])\n ->orWhere([ ['brands.name', 'LIKE', \"%$brand%\"], ['rams.deleted_at', '=', null] ])\n ->orderBy('id', 'desc')\n ->paginate(25);\n }", "public function search(Query $query);", "function findObject($term, $filter) {\n\t\tglobal $conf;\n\n\t\t/*about escaping:\n\t\t * SET standard_conforming_string is not available before 8.2\n\t\t * So we must use PostgreSQL specific notation :/\n\t\t * E'' notation is not available before 8.1\n\t\t * $$ is available since 8.0\n\t\t * Nothing specific from 7.4\n\t\t **/\n\n\t\t// Escape search term for ILIKE match\n\t\t$term = str_replace('_', '\\\\_', $term);\n\t\t$term = str_replace('%', '\\\\%', $term);\n\t\t$this->clean($term);\n\t\t$this->clean($filter);\n\n\t\t// Exclude system relations if necessary\n\t\tif (!$conf['show_system']) {\n\t\t\t// XXX: The mention of information_schema here is in the wrong place, but\n\t\t\t// it's the quickest fix to exclude the info schema from 7.4\n\t\t\t$where = \" AND pn.nspname NOT LIKE 'pg\\\\\\\\_%' AND pn.nspname != 'information_schema'\";\n\t\t\t$lan_where = \"AND pl.lanispl\";\n\t\t}\n\t\telse {\n\t\t\t$where = '';\n\t\t\t$lan_where = '';\n\t\t}\n\n\t\t// Apply outer filter\n\t\t$sql = '';\n\t\tif ($filter != '') {\n\t\t\t$sql = \"SELECT * FROM (\";\n\t\t}\n\n\t\t$sql .= \"\n\t\t\tSELECT 'SCHEMA' AS type, oid, NULL AS schemaname, NULL AS relname, nspname AS name\n\t\t\t\tFROM pg_catalog.pg_namespace pn WHERE nspname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT CASE WHEN relkind='r' THEN 'TABLE' WHEN relkind='v' THEN 'VIEW' WHEN relkind='S' THEN 'SEQUENCE' END, pc.oid,\n\t\t\t\tpn.nspname, NULL, pc.relname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn\n\t\t\t\tWHERE pc.relnamespace=pn.oid AND relkind IN ('r', 'v', 'S') AND relname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT CASE WHEN pc.relkind='r' THEN 'COLUMNTABLE' ELSE 'COLUMNVIEW' END, NULL, pn.nspname, pc.relname, pa.attname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn,\n\t\t\t\tpg_catalog.pg_attribute pa WHERE pc.relnamespace=pn.oid AND pc.oid=pa.attrelid\n\t\t\t\tAND pa.attname ILIKE '%{$term}%' AND pa.attnum > 0 AND NOT pa.attisdropped AND pc.relkind IN ('r', 'v') {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'FUNCTION', pp.oid, pn.nspname, NULL, pp.proname || '(' || pg_catalog.oidvectortypes(pp.proargtypes) || ')' FROM pg_catalog.pg_proc pp, pg_catalog.pg_namespace pn\n\t\t\t\tWHERE pp.pronamespace=pn.oid AND NOT pp.proisagg AND pp.proname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'INDEX', NULL, pn.nspname, pc.relname, pc2.relname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn,\n\t\t\t\tpg_catalog.pg_index pi, pg_catalog.pg_class pc2 WHERE pc.relnamespace=pn.oid AND pc.oid=pi.indrelid\n\t\t\t\tAND pi.indexrelid=pc2.oid\n\t\t\t\tAND NOT EXISTS (\n\t\t\t\t\tSELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c\n\t\t\t\t\tON (d.refclassid = c.tableoid AND d.refobjid = c.oid)\n\t\t\t\t\tWHERE d.classid = pc2.tableoid AND d.objid = pc2.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p')\n\t\t\t\t)\n\t\t\t\tAND pc2.relname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'CONSTRAINTTABLE', NULL, pn.nspname, pc.relname, pc2.conname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn,\n\t\t\t\tpg_catalog.pg_constraint pc2 WHERE pc.relnamespace=pn.oid AND pc.oid=pc2.conrelid AND pc2.conrelid != 0\n\t\t\t\tAND CASE WHEN pc2.contype IN ('f', 'c') THEN TRUE ELSE NOT EXISTS (\n\t\t\t\t\tSELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c\n\t\t\t\t\tON (d.refclassid = c.tableoid AND d.refobjid = c.oid)\n\t\t\t\t\tWHERE d.classid = pc2.tableoid AND d.objid = pc2.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p')\n\t\t\t\t) END\n\t\t\t\tAND pc2.conname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'CONSTRAINTDOMAIN', pt.oid, pn.nspname, pt.typname, pc.conname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn,\n\t\t\t\tpg_catalog.pg_constraint pc WHERE pt.typnamespace=pn.oid AND pt.oid=pc.contypid AND pc.contypid != 0\n\t\t\t\tAND pc.conname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'TRIGGER', NULL, pn.nspname, pc.relname, pt.tgname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn,\n\t\t\t\tpg_catalog.pg_trigger pt WHERE pc.relnamespace=pn.oid AND pc.oid=pt.tgrelid\n\t\t\t\t\tAND ( pt.tgisconstraint = 'f' OR NOT EXISTS\n\t\t\t\t\t(SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c\n\t\t\t\t\tON (d.refclassid = c.tableoid AND d.refobjid = c.oid)\n\t\t\t\t\tWHERE d.classid = pt.tableoid AND d.objid = pt.oid AND d.deptype = 'i' AND c.contype = 'f'))\n\t\t\t\tAND pt.tgname ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'RULETABLE', NULL, pn.nspname AS schemaname, c.relname AS tablename, r.rulename FROM pg_catalog.pg_rewrite r\n\t\t\t\tJOIN pg_catalog.pg_class c ON c.oid = r.ev_class\n\t\t\t\tLEFT JOIN pg_catalog.pg_namespace pn ON pn.oid = c.relnamespace\n\t\t\t\tWHERE c.relkind='r' AND r.rulename != '_RETURN' AND r.rulename ILIKE '%{$term}%' {$where}\n\t\t\tUNION ALL\n\t\t\tSELECT 'RULEVIEW', NULL, pn.nspname AS schemaname, c.relname AS tablename, r.rulename FROM pg_catalog.pg_rewrite r\n\t\t\t\tJOIN pg_catalog.pg_class c ON c.oid = r.ev_class\n\t\t\t\tLEFT JOIN pg_catalog.pg_namespace pn ON pn.oid = c.relnamespace\n\t\t\t\tWHERE c.relkind='v' AND r.rulename != '_RETURN' AND r.rulename ILIKE '%{$term}%' {$where}\n\t\t\";\n\n\t\t// Add advanced objects if show_advanced is set\n\t\tif ($conf['show_advanced']) {\n\t\t\t$sql .= \"\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT CASE WHEN pt.typtype='d' THEN 'DOMAIN' ELSE 'TYPE' END, pt.oid, pn.nspname, NULL,\n\t\t\t\t\tpt.typname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn\n\t\t\t\t\tWHERE pt.typnamespace=pn.oid AND typname ILIKE '%{$term}%'\n\t\t\t\t\tAND (pt.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = pt.typrelid))\n\t\t\t\t\t{$where}\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT 'OPERATOR', po.oid, pn.nspname, NULL, po.oprname FROM pg_catalog.pg_operator po, pg_catalog.pg_namespace pn\n\t\t\t\t\tWHERE po.oprnamespace=pn.oid AND oprname ILIKE '%{$term}%' {$where}\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT 'CONVERSION', pc.oid, pn.nspname, NULL, pc.conname FROM pg_catalog.pg_conversion pc,\n\t\t\t\t\tpg_catalog.pg_namespace pn WHERE pc.connamespace=pn.oid AND conname ILIKE '%{$term}%' {$where}\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT 'LANGUAGE', pl.oid, NULL, NULL, pl.lanname FROM pg_catalog.pg_language pl\n\t\t\t\t\tWHERE lanname ILIKE '%{$term}%' {$lan_where}\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT DISTINCT ON (p.proname) 'AGGREGATE', p.oid, pn.nspname, NULL, p.proname FROM pg_catalog.pg_proc p\n\t\t\t\t\tLEFT JOIN pg_catalog.pg_namespace pn ON p.pronamespace=pn.oid\n\t\t\t\t\tWHERE p.proisagg AND p.proname ILIKE '%{$term}%' {$where}\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT DISTINCT ON (po.opcname) 'OPCLASS', po.oid, pn.nspname, NULL, po.opcname FROM pg_catalog.pg_opclass po,\n\t\t\t\t\tpg_catalog.pg_namespace pn WHERE po.opcnamespace=pn.oid\n\t\t\t\t\tAND po.opcname ILIKE '%{$term}%' {$where}\n\t\t\t\";\n\t\t}\n\t\t// Otherwise just add domains\n\t\telse {\n\t\t\t$sql .= \"\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT 'DOMAIN', pt.oid, pn.nspname, NULL,\n\t\t\t\t\tpt.typname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn\n\t\t\t\t\tWHERE pt.typnamespace=pn.oid AND pt.typtype='d' AND typname ILIKE '%{$term}%'\n\t\t\t\t\tAND (pt.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = pt.typrelid))\n\t\t\t\t\t{$where}\n\t\t\t\";\n\t\t}\n\n\t\tif ($filter != '') {\n\t\t\t// We use like to make RULE, CONSTRAINT and COLUMN searches work\n\t\t\t$sql .= \") AS sub WHERE type LIKE '{$filter}%' \";\n\t\t}\n\n\t\t$sql .= \"ORDER BY type, schemaname, relname, name\";\n\n\t\treturn $this->selectSet($sql);\n\t}", "public function scopeSpaceName($query, $name)\n {\n if (!$name) return $query;\n return $query->where('name', 'like', \"%{$name}%\")\n ->orWhere('code', 'like', \"%{$name}%\");\n }", "public function search($text, QueryBuilder $qb = null)\n {\n return $this;\n }", "public function scopeSearch($query, $fields, $searches, $multiple = true)\n {\n $searches = is_array($searches) ? $searches : explode(' ', $searches);\n $searches = array_filter(array_map('trim', $searches));\n\n $func = $multiple === true ? 'orLike' : 'like';\n\n return $query->where(function ($query) use ($fields, $searches, $func) {\n $query->like($fields, array_shift($searches));\n\n foreach ($searches as &$search) {\n $query->$func($fields, $search);\n }\n });\n }", "function fullTextSearch($client, $html, $query)\n{\n if ($html) {echo \"<h2>Documents containing $query</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed(\n 'https://docs.google.com/feeds/documents/private/full?q=' . $query);\n\n printDocumentsFeed($feed, $html);\n}", "function search( $queryText, $offset, $limit, &$SearchTotalCount, $params = array() )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $queryText = $db->escapeString( $queryText );\r\n\r\n $query = new eZQuery( \"eZForum_Word.Word\", $queryText );\r\n $query->setIsLiteral( true );\r\n $query->setStopWordColumn( \"eZForum_Word.Frequency\" );\r\n $searchSQL = $query->buildQuery();\r\n\r\n $groupString = \"eZForum_Forum.GroupID=0\";\r\n\r\n $user =& eZUser::currentUser();\r\n if ( $user )\r\n {\r\n $groups =& $user->groups( false );\r\n $i = 0;\r\n\r\n foreach ( $groups as $userGroup )\r\n {\r\n $groupString .= \" OR \";\r\n\r\n $groupString .= \"eZForum_Forum.GroupID='\" . $userGroup . \"'\";\r\n $i++;\r\n }\r\n }\r\n\r\n // special search for MySQL, mimic subselects ;)\r\n if ( $db->isA() == \"mysql\" )\r\n {\r\n $queryArray = explode( \" \", trim( $queryText ) );\r\n\r\n $db->query( \"CREATE TEMPORARY TABLE eZForum_SearchTemp( MessageID int )\" );\r\n\r\n $count = 1;\r\n foreach ( $queryArray as $queryWord )\r\n {\r\n $queryWord = trim( $queryWord );\r\n\r\n $searchSQL = \" ( eZForum_Word.Word = '$queryWord' AND eZForum_Word.Frequency < '0.9' ) \";\r\n\r\n $queryString = \"INSERT INTO eZForum_SearchTemp ( MessageID )\r\n SELECT DISTINCT eZForum_Message.ID AS MessageID\r\n FROM eZForum_Message,\r\n eZForum_MessageWordLink,\r\n eZForum_Word,\r\n eZForum_Forum\r\n WHERE $searchSQL AND\r\n ( eZForum_Message.ID=eZForum_MessageWordLink.MessageID\r\n AND eZForum_MessageWordLink.WordID=eZForum_Word.ID ) AND\r\n eZForum_Message.ForumID=eZForum_Forum.ID AND\r\n ($groupString)\r\n ORDER BY eZForum_MessageWordLink.Frequency\";\r\n\r\n $db->query( $queryString );\r\n // check if this is a stop word\r\n $queryString = \"SELECT Frequency FROM eZForum_Word WHERE Word='$queryWord'\";\r\n\r\n $db->query_single( $WordFreq, $queryString, array( \"LIMIT\" => 1 ) );\r\n\r\n if ( $WordFreq[\"Frequency\"] <= 0.7 )\r\n $count += 1;\r\n }\r\n $count -= 1;\r\n\r\n $queryString = \"SELECT MessageID, Count(*) AS Count FROM eZForum_SearchTemp GROUP BY MessageID HAVING Count='$count'\";\r\n\r\n $db->array_query( $message_array, $queryString );\r\n $SearchTotalCount = count( $message_array );\r\n $message_array =& array_slice( $message_array, $offset, $limit );\r\n\r\n $db->query( \"DROP TABLE eZForum_SearchTemp\" );\r\n }\r\n else\r\n {\r\n $queryString = \"SELECT DISTINCT eZForum_Message.ID AS MessageID\r\n FROM eZForum_Message,\r\n eZForum_MessageWordLink,\r\n eZForum_Word,\r\n eZForum_Forum\r\n WHERE\r\n $searchSQL\r\n AND\r\n ( eZForum_Message.ID=eZForum_MessageWordLink.MessageID\r\n AND eZForum_MessageWordLink.WordID=eZForum_Word.ID )\r\n eZForum_Message.ForumID=eZForum_Forum.ID AND\r\n ($groupString)\r\n ORDER BY eZForum_MessageWordLink.Frequency\";\r\n\r\n $db->array_query( $message_array, $queryString );\r\n $SearchTotalCount = count( $message_array );\r\n $message_array =& array_slice( $message_array, $offset, $limit );\r\n }\r\n\r\n for ( $i = 0; $i < count( $message_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZForumMessage( $message_array[$i][$db->fieldName( \"MessageID\" )], false );\r\n }\r\n\r\n return $return_array;\r\n }", "public function search($query, $year = null, $language = null);", "public function scopeName($query, $name)\n {\n return $query->orWhere('name', 'LIKE', '%'.$name.'%');\n }", "public function search($term)\n {\n try {\n $list = (self::MODEL)\n ::with('enderecos')\n ->where('nome', 'LIKE', \"%{$term}%\")\n ->orWhere('taxvat', 'LIKE', \"%{$term}%\")\n ->get();\n\n return $this->listResponse(ClientTransformer::directSearch($list));\n } catch (\\Exception $exception) {\n return $this->listResponse([]);\n }\n }", "public function scopeSearchChamber($query, string $scope = 'where', $chamber)\n {\n return $query->$scope('companyActivity', 'LIKE', '%'.$chamber.'%'); \n }", "public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }", "public function scopeSimilarMatch($query, $name) {\n return $query->opened()->where('name', 'REGEXP', '[' . $name . ']');\n }", "public function search(Request $request, RepoHost $rh, $term)\n {\n $args = $request->all();\n\n $maxhits = isset($args['maxhits']) ? $args['maxhits'] : 25;\n $page = isset($args['page']) ? $args['page'] : 0;\n $sort = isset($args['sort']) ? $args['sort'] : 'score';\n\n return $rh->search($term, $maxhits, $page, $sort);\n\n }", "public function find(string $term, string $namespace) : array;", "function search_query($query){\n\t\tglobal $bBlog;\n\t\t$query = $this->replace($query);\n\t\t$words = explode(' ', $query);\n\t \n\t\t$sql = '';\n\t\tforeach ($words as $word){\n\t\t\t$this->make_tmp($word);\n\t\t\t$sql .= \" OR `string` = '\".$word.\"'\";\n\t\t}\n\t\treturn $bBlog->db->get_results(\"\n\t \tSELECT \n\t\t\t`article_id` AS `id`,\n\t\t\tSUM(points) AS points_sum\n\t\tFROM `\".T_SEARCH_TMP.\"`\n\t\tWHERE 0 \".$sql.\"\n\t\tGROUP BY `id`\n\t\tORDER BY `points_sum` DESC\n\t\tLIMIT 20;\n\t\t\");\n\t}", "public function search($phrase='', $limit = true, $additional = false){\n global $Core;\n\n if(empty($this->tableFields)){\n $this->getTableFields();\n }\n\n $phrase = trim($Core->db->real_escape_string($phrase));\n if(!empty($phrase)){\n if($this->autocompleteField && $this->autocompleteObjectId){\n $q = \"SELECT `autocomplete`.`object_id`, TRIM(`autocomplete`.`phrase`) AS 'phrase'\";\n $q .= \" FROM `{$Core->dbName}`.`autocomplete`\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" INNER JOIN `{$Core->dbName}`.`{$this->tableName}` ON `{$Core->dbName}`.`autocomplete`.`object_id` = `{$Core->dbName}`.`{$this->tableName}`.`id`\";\n }\n $q .= \" WHERE `autocomplete`.`type`={$this->autocompleteObjectId} AND `autocomplete`.`phrase` LIKE '%$phrase%'\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" AND (`{$this->tableName}`.`hidden` IS NULL OR `{$this->tableName}`.`hidden` = 0)\";\n }\n if($additional){\n $q .= ' AND '.$additional;\n }\n $q .= ' GROUP BY `autocomplete`.`object_id` ORDER BY `autocomplete`.`phrase` ASC, `autocomplete`.`id` ASC';\n }\n else if($this->searchByField){\n if($this->returnPhraseOnly){\n $q = \"SELECT `id` AS 'object_id',`{$this->searchByField}` AS 'phrase'\";\n }\n else{\n $q = \"SELECT *\";\n }\n $q .= \" FROM `{$Core->dbName}`.`{$this->tableName}`\";\n $q .= \" WHERE `{$this->searchByField}` LIKE '%$phrase%'\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" AND (`{$this->tableName}`.`hidden` IS NULL OR `{$this->tableName}`.`hidden` = 0)\";\n }\n if($additional){\n $q .= ' AND '.$additional;\n }\n\n $q .= \" ORDER BY `\".((!empty($this->orderByField)) ? $this->orderByField : $this->searchByField).\"` {$this->orderType}, `id` ASC\";\n if($this->additionalOrdering){\n $q .= ', '.$this->additionalOrdering;\n }\n }\n else throw new Exception(\"In order to use the search function, plesae define autocompleteField and autocompleteObjectId or searchByField!\");\n\n if($limit){\n if(is_numeric($limit)){\n $q.= \" LIMIT \".(($Core->rewrite->currentPage - 1) * $limit).','.$limit;\n }\n else{\n $q.= \" LIMIT \".(($Core->rewrite->currentPage - 1) * $Core->itemsPerPage).','.$Core->itemsPerPage;\n }\n }\n\n if($this->returnPhraseOnly){\n if($Core->db->query($q,$Core->cacheTime,'fillArraySingleField',$result,'object_id','phrase')){\n return $result;\n }\n }\n else{\n if($Core->db->query($q,$Core->cacheTime,'fillArray',$result,'id')){\n return $result;\n }\n }\n return array();\n }\n else{\n $all = $this->getAll(false,false,$limit,false,false,$additional);\n if(empty($all)){\n return array();\n }\n $result = array();\n foreach($all as $k => $v){\n if($this->autocompleteField && $this->autocompleteObjectId){\n if($this->returnPhraseOnly){\n if(is_array($this->autocompleteField)){\n $result[$k] = array();\n foreach($this->autocompleteField as $f){\n if(!empty($v[$f])){\n $result[$k][] = $v[$f];\n }\n }\n $result[$k] = implode($this->autocompleteSeparator,$result[$k]);\n }\n else{\n $result[$k] = $v[$this->autocompleteField];\n }\n }\n else return $all;\n }\n else if($this->searchByField){\n if($this->returnPhraseOnly){\n $result[$k] = $v[$this->searchByField];\n }\n else return $all;\n }\n else throw new Exception(\"In order to use the search function, please define autocompleteField and autocompleteObjectId or searchByField!\");\n }\n unset($all);\n return $result;\n }\n }", "public function scopeSearchByInput($query, $string = '')\n {\n if ($string) {\n $searchable = self::getSearchableColums();\n $query->where(function ($query) use ($searchable, $string) {\n $string_parts = explode(\" \", $string);\n foreach ($string_parts as $part) {\n $query->where(function ($query) use ($searchable, $part) {\n foreach ($searchable as $column => $value) {\n $query->orWhere($column, 'like', '%'.$part.'%');\n }\n });\n }\n });\n }\n\n return $query;\n }", "public function scopeIncludes( $query, $search )\n { \n return $query->where( 'namespace', 'like', '%' . $search );\n }", "static function searchCaseInsensitive($query, $column, $searchTerm) {\n $query->orWhere($column['name'], 'ILIKE', '%'.$searchTerm.'%');\n }", "public function setTerm($term) {\n $this->_term = $term;\n return $this;\n }", "public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }", "public function getFulltextQuery()\n {\n return $this->getRequest()->getParam('query');\n }", "function FullText($fields=null, $searchstring=null, $booleanmode=false)\n\t{\n\t\tif ($fields === null || $searchstring === null) {\n\t\t\treturn false;\n\t\t}\n\t\t$query = '';\n\t\t$subqueries = array();\n\t\t$counter = 1;\n\t\tforeach ($fields as $field) {\n\t\t\tif ($booleanmode) {\n\t\t\t\t$subqueries[]= ' CONTAINS('.$field.', \\''.$this->Quote($searchstring).'\\', '.$counter++.') > 0 ';\n\t\t\t} else {\n\t\t\t\t$subqueries[]= ' CONTAINS('.$field.', \\''.$this->Quote($searchstring).'\\', '.$counter++.') > 0 ';\n\t\t\t}\n\t\t}\n\t\t$query = implode(' OR ', $subqueries);\n\n\t\treturn $query;\n\t}", "public function scopeMatches($query, $search)\n {\n return $query->where('email', $search);\n }", "public function applySearch (\n QueryBuilder $queryBuilder,\n ?string $query,\n array $fields,\n bool $mode = self::MODE_PREFIX\n ) : QueryBuilder\n {\n $query = \\trim((string) $query);\n\n if (\"\" === $query)\n {\n return $queryBuilder;\n }\n\n $tokenized = $this->tokenizer->transformToQuery($query, $mode);\n $expr = new Orx();\n\n foreach ($fields as $field)\n {\n $expr->add(\n new Comparison($field, \"LIKE\", \":__searchTerm\")\n );\n }\n\n return $queryBuilder\n ->andWhere($expr)\n ->setParameter(\"__searchTerm\", $tokenized);\n }", "public function getAll($searchTerm);", "public function findWith($phrase)\n {\n $qb = $this->repository->createQueryBuilder('t');\n $qb->select('t', 'p', 'a')\n ->leftJoin('t.posts', 'p')\n ->leftJoin('t.author', 'a')\n ->where($qb->expr()->orX(\n $qb->expr()->like('t.name', ':phrase'),\n $qb->expr()->like('t.description', ':phrase'),\n $qb->expr()->like('p.description', ':phrase')\n ))\n ->setParameters(array(\n 'phrase' => '%' . $phrase . '%',\n ));\n\n $query = $qb->getQuery();\n\n return $query;\n }", "function createTextQuery($field, $searchValue) {\n\t\tSpotTiming::start(__FUNCTION__);\n\n\t\t//\n\t\t// FIXME \n\t\t// Sorteeren op rank, zie http://www.postgresql.org/docs/8.3/static/textsearch-controls.html\n\t\t//\n\t\t$queryPart = \" to_tsvector('Dutch', \" . $field . \") @@ '\" . $this->safe(strtolower($searchValue)) . \"' \";\n\n\t\tSpotTiming::stop(__FUNCTION__, array($field,$searchValue));\n\t\t\n\t\treturn array('filter' => $queryPart,\n\t\t\t\t\t 'sortable' => false); \n\t}" ]
[ "0.808432", "0.7413824", "0.7222598", "0.72054404", "0.7191608", "0.71395236", "0.64251107", "0.6399057", "0.6366055", "0.63552713", "0.62934667", "0.6277461", "0.62724614", "0.62619597", "0.6256577", "0.624123", "0.6213066", "0.62068313", "0.62060946", "0.61942387", "0.6185627", "0.610771", "0.60064983", "0.59896696", "0.5921099", "0.5902511", "0.5878781", "0.5803862", "0.57343656", "0.56947875", "0.56841755", "0.56764793", "0.56734496", "0.56724674", "0.56623435", "0.5648537", "0.5622703", "0.56019264", "0.5596562", "0.5580117", "0.55727476", "0.55681187", "0.5540553", "0.552383", "0.5517783", "0.55164087", "0.5501766", "0.5481215", "0.54442805", "0.5431135", "0.5427487", "0.5415946", "0.5403114", "0.539677", "0.5391488", "0.5371656", "0.5366907", "0.5357563", "0.5354684", "0.5346314", "0.53421396", "0.53291094", "0.5321393", "0.5320357", "0.5308647", "0.5304576", "0.5302024", "0.52963436", "0.52882653", "0.5283355", "0.5278654", "0.5278241", "0.52731985", "0.5261429", "0.5240811", "0.5230583", "0.5205751", "0.52057165", "0.5203113", "0.5188012", "0.51809376", "0.5180349", "0.51711243", "0.51710737", "0.51705277", "0.51647455", "0.516242", "0.51588833", "0.5150546", "0.51422", "0.5130753", "0.5126808", "0.51240736", "0.5120101", "0.5113943", "0.5103819", "0.51024944", "0.5090177", "0.50900394", "0.50742275" ]
0.7715841
1
Get the user model by principal URI
private function _getUser($principalUri) { $username = basename($principalUri); return \GO\Base\Model\User::model()->findSingleByAttribute('username', $username); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUserModel()\n {\n $config = $this->app->make('config');\n\n if (is_null($guard = $config->get('auth.defaults.guard'))) {\n return null;\n }\n\n if (is_null($provider = $config->get(\"auth.guards.{$guard}.provider\"))) {\n return null;\n }\n\n $model = $config->get(\"auth.providers.{$provider}.model\");\n\n // The standard auth config that ships with Laravel references the\n // Eloquent User model in the above config path. However, users\n // are free to reference anything there - so we check first.\n if (is_subclass_of($model, EloquentModel::class)) {\n return $model;\n }\n }", "public function getUserModel()\n {\n return $this->getController()->getServiceLocator()->get('User\\Model\\User');\n }", "function userModel() { \n $model = config('auth.model');\n return new $model;\n }", "public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }", "private function _getUser($args)\n {\n try\n {\n $componentLoader = new MIDAS_ComponentLoader();\n $authComponent = $componentLoader->loadComponent('Authentication', 'api');\n }\n catch (Zend_Exception $e)\n {\n $authComponent = MidasLoader::loadComponent('Authentication');\n }\n return $authComponent->getUser($args, null);\n }", "public function loadUser()\n {\n if ($this->_model === null) {\n if (Yii::app()->user->id)\n $this->_model = Yii::app()->controller->module->user();\n if ($this->_model === null)\n $this->redirect(Yii::app()->controller->module->loginUrl);\n }\n return $this->_model;\n }", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser()\n\t{\n\t\tif ($this->_user === false) {\n\t\t\t$model = User::findIdentityByEmail($this->email);\n\n\t\t\tif ($model and ($model->role == User::ROLE_USER or $model->role == User::ROLE_ADMINISTRATOR)) {\n\t\t\t\t$this->_user = $model;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_user;\n\t}", "public function userProviderModel()\n {\n $config = $this->laravel['config'];\n\n $provider = $config->get('auth.guards.'.$config->get('auth.defaults.guard').'.provider');\n\n return $config->get(\"auth.providers.{$provider}.model\");\n }", "public function getUserModel() {\n\t\treturn ($this->isAdmin()) ? Mage::getSingleton('admin/user') : Mage::getSingleton('customer/customer');\n\t}", "public function user() : Authenticatable|null\n {\n // All routes that need to be authenticated should use AttachBroker middleware\n // Otherwise need a workaround with exception on pages, that not uses this middleware\n //\n if(is_null($this->user) && !$this->broker->isAttached()) {\n return null;\n }\n\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n if ($payload = $this->broker->profile($this->request)) {\n $this->user = $this->loginFromPayload($payload);\n }\n\n return $this->user;\n }", "public function resolveUser() {\n $user = User::model()->findByAttributes(array('emailAddress' => $this->email));\n if(!($user instanceof User)){\n $profile = Profile::model()->findByAttributes(array('emailAddress' => $this->email));\n if($profile instanceof Profile) {\n $user = $profile->user;\n }\n }\n return $user;\n }", "function getApprover() {\n return user_load($this->approver_uid);\n }", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}", "public function getUserFromAuth() {\n\n $auth = Zend_Auth::getInstance();\n $identity = $auth->getIdentity();\n\n return $identity;\n }", "public function user()\n {\n return $this->belongsTo(Config::get('odotmedia.advertisements.user.model'));\n }", "public function loadUser()\r\n\t{\r\n\t\tif($this->_model===null)\r\n\t\t{\r\n\t\t\tif(Yii::app()->user->id)\r\n\t\t\t\t$this->_model=Yii::app()->controller->module->user();\r\n\t\t\tif($this->_model===null)\r\n\t\t\t\t$this->redirect(Yii::app()->controller->module->loginUrl);\r\n\t\t}\r\n\t\treturn $this->_model;\r\n\t}", "private function getUser() {\n\t\t$account = $this->authenticationManager->getSecurityContext()->getAccount();\n\t\t$user = $account->getParty();\n\t\treturn $user;\n\t}", "protected function getUserModel()\n\t{\n\t\t$userModel = Config::get('maclof/revisionable::user_model', 'User');\n\n\t\tif(!class_exists($userModel))\n\t\t{\n\t\t\tthrow new ModelNotFoundException('The model ' . $userModel . ' was not found.');\n\t\t}\n\n\t\treturn new $userModel;\n\t}", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function user() {\n\t\tif (!Auth::check()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn Auth::getUser();\n\t}", "private function getUser()\n {\n return $this->user->getUser();\n }", "public function user()\n {\n $class = GetCandy::getUserModel();\n\n return $this->belongsTo($class);\n }", "public function getUser() {\n\t\treturn User::newFromName( $this->params['user'], false );\n\t}", "public function getUser()\n {\n return $this->controller->getUser();\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'author']);\n }", "public function user()\n {\n return $this->belongsTo(config('auth.model'), 'user_id');\n }", "public function loadModel()\n\t{\n\t\tif( $this->_model === null ) {\n\t\t\tif( Yii::app()->user->isAuthenticated() ) { // если пользователь авторизирован\n\t\t\t\t$this->_model = User::model()->findbyPk(Yii::app()->user->id);\n\t\t\t}\n\t\t\tif( $this->_model === null ) {\n\t\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\t\t}\n }\n return $this->_model;\n }", "function user()\n {\n return isset($_SESSION['user']) ? \\Models\\User::find($_SESSION['user']) : null;\n }", "public function user()\n {\n return call_user_func($this->getUserResolver());\n }", "protected function loadUser()\n {\n $sixreps = new Sixreps(Yii::app()->params['api_host']);\n\n try {\n list($body, $info) = $sixreps->get('/users/me', array(\n 'access_token' => Yii::app()->user->user_token,\n ));\n }\n catch (Exception $e) {}\n\n $this->_model = $body;\n\n return $this->_model;\n }", "public function user()\n {\n return $this->la->user();\n }", "public function loadUser()\n\t{ \n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(Yii::app()->user->id)\n {\n $this->_model=Yii::app()->controller->module->user();\n }\n \n if(!empty($_GET['username']))\n {\n $this->_model = User::model()->find(\"username = '\".$_GET['username'].\"'\");\n if(empty($this->_model) || ($_GET['username'] != Yii::app()->user->name))\n {\n throw new Exception(\"Invalid username\",404);\n }\n \n }\n\t\t\tif($this->_model===null)\n {\n $this->redirect(Yii::app()->controller->module->loginUrl);\n }\n\t\t} \n\t\treturn $this->_model;\n\t}", "function get_user($userName){\n return get_user_object($userName);\n}", "public static function getUser();", "public static function userModel()\n {\n return static::$userModel;\n }", "public function user()\n {\n return $this->belongsTo(config('forum.user.model'));\n }", "public function getUserProperty(): Authenticatable|null\n {\n return Auth::user();\n }", "public function user()\n {\n return $this->belongsTo(\n $this->getUserModelClassName(),\n 'user_id',\n $this->getUserModelPrimaryKey()\n );\n }", "public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}", "public function getUser(): User;", "public static function getUserModel() {\n return self::$_userModel;\n }", "public function user()\n {\n\n //Check if the user exists\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n //Retrieve token from request and authenticate\n return $this->getTokenForRequest();\n }", "protected function getUserModel() {\n return new User();\n }", "public static function user()\n {\n if (Session::has('user')) {\n $userModel = Config::get('user');\n $model = new $userModel();\n\n return $model->find(Session::get('user'));\n }\n return false;\n }", "protected function getPrincipal() {\n\t\t$webSession = WebSession::getInstance();\n\t\treturn $webSession->getPrincipal();\n\t}", "public function user()\n {\n if (!Auth::check()) {\n return null;\n }\n\n return Auth::getUser();\n }", "public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }", "public function getUser()\n {\n $attributes = $this->getUserAttributes();\n\n // Try to load user by ldap id attribute\n if ($this->idAttribute !== null && isset($attributes['authclient_id'])) {\n $user = User::findOne(['authclient_id' => $attributes['authclient_id'], 'auth_mode' => $this->getId()]);\n if ($user !== null) {\n return $user;\n }\n }\n\n return $this->getUserAuto();\n }", "public function getUser() {\n\t\treturn $this->getTable('User')->find($this->user_id);\n\t}", "protected function _getUser()\n {\n $log = \"Get user from token storage: \";\n $token = $this->getTokenStorage()->getToken();\n if (null === $token)\n throw new ControllerException($log . \"token is null\");\n\n $user = $token->getUser();\n if ($user instanceof User)\n return $user;\n throw new ControllerException($log . \"not found\");\n }", "function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }", "function getUser() {\n return user_load($this->uid);\n }", "public function getUser()\n\t{\n\t\tif(isset($this->user))\n\t\t{\n\t\t\treturn $this->user;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->user = ColoCrossing_Object_Factory::createObject($this, null, $content['user'], 'user');\n\t}", "public function getUser()\n {\n if (!$this->security) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->security->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function user()\n {\n if (!$this->user && ($redaxoUser = $this->getRedaxoUser())) {\n $this->user = $this->retrieveUserByRedaxoUser($redaxoUser);\n }\n\n return $this->user;\n }", "public static function getUserModel()\n {\n return static::getModel('Users');\n }", "public function getUser()\n {\n $this->getParam('user');\n }", "public function user()\n {\n if ( ! Auth::check()) {\n return null;\n }\n\n return Auth::getUser();\n }", "public function user()\n {\n $this->checkTimeouts();\n\n if (! $this->session->has('socialite_token')) return null;\n if ($this->session->has('google_guard_user')) return $this->session->get('google_guard_user');\n\n try {\n $user = Socialite::driver('google')->userFromToken($this->session->get('socialite_token'));\n } catch (\\Exception $e) {\n }\n\n if (! isset($user) || ! $user) return $this->flushSession();\n\n $userModel = $this->hydrateUserModel($user);\n $this->session->put('google_guard_user', $userModel);\n\n return $userModel;\n }", "protected function getUser()\n {\n return $this->user_provider->getHydratedUser();\n }", "private function getUser()\n {\n $userObj = new Core_Model_Users;\n return $userObj->profile();\n }", "public function getUser() {\n\t\treturn $this->hasOne(User::className(), ['id' => 'user_id']);\n\t}", "public function getUser() {\n\t\treturn $this->Session->read('UserAuth');\n\t}", "abstract protected function getUser();", "function user()\n {\n return eZUser::fetch( $this->UserID );\n }", "public function getAuthenticatedUser()\n {\n // get the web-user\n $user = Auth::guard()->user();\n\n // get the api-user\n if(!isset($user) && $user == null) {\n $user = Auth::guard('api')->user();\n }\n return $user;\n }", "public function user()\n\t{\n\t\tif (is_null($this->user) and $this->session->has(static::$key))\n\t\t{\n\t\t\t$this->user = call_user_func(Config::get('auth.by_id'), $this->session->get(static::$key));\n\t\t}\n\n\t\treturn $this->user;\n\t}", "protected function getUser()\n {\n return $this->loadUser(array(\n 'user_name' => $this->context['admin'],\n ));\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'userId'])->one();\n }", "public function get_user()\n {\n Session::_start();\n return (object) Session::_get(\"user\");\n\n }", "public function user()\n {\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n return FALSE;\n }\n //If user is logged in\n return Zend_Auth::getInstance()->getIdentity();\n }", "public function getUser()\n {\n if (!$this->stokenStorage) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->stokenStorage->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return;\n }\n\n return $user;\n }", "private function getUser()\n {\n if ($this->userData['id']) {\n $user = gateway('northstar')->asClient()->getUser($this->userData['id']);\n\n if ($user && $user->id) {\n info('Found user by id', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if ($this->userData['email']) {\n $user = gateway('northstar')->asClient()->getUserByEmail($this->userData['email']);\n\n if ($user && $user->id) {\n info('Found user by email', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if (! isset($this->userData['mobile'])) {\n return null;\n }\n\n $user = gateway('northstar')->asClient()->getUserByMobile($this->userData['mobile']);\n\n if ($user && $user->id) {\n info('Found user by mobile', ['user' => $user->id]);\n\n return $user;\n }\n\n return null;\n }", "protected function getSimulatingUser()\n {\n // Ideally, return Profile\n }", "public function user(): User\n {\n return User::load('https://fiken.no/api/v1/whoAmI');\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'uid']);\n }", "public function user()\n {\n if ($this->user !== null) {\n return $this->user;\n }\n\n try{\n if ($token = $this->handle->getToken()) {\n $this->user = $this->provider->retrieveById($token->getId());\n if(get_class($this->user()) !== $token->getClass()){\n $this->user = null;\n }\n }\n }catch (TokenException $exception){\n\n }\n\n\n return $this->user;\n }", "public static function getUser()\n\t{\n\t\tif(isset($_SESSION['user_id'])){\n\t\t\t\n\t\t\treturn User::findByID($_SESSION['user_id']);\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\treturn static::loginFromRememberCookie();\n\t\t\n\t\t}\n\t}", "public function getUserInstance()\n {\n $entity = null;\n\n if ($this instanceof \\User) {\n $entity = $this;\n } elseif ($this instanceof \\PortalUser) {\n $this->setPortalId();\n $entity = $this->getRelated('User');\n } else {\n $entity = $this->getPortalUser()->getRelated('User');\n }\n\n $this->checkJoin($this, $entity);\n\n return $entity;\n }", "public function getUser()\n\t{\n\t\treturn $this->hasOne(User::className(), ['id' => 'user_id'])->asArray()->one();\n\t}", "public function getPrincipal() {\n return $this->principal;\n }", "public function getUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "private function _getUser($args)\n {\n return $this->ModuleComponent->Authentication->getUser($args, $this->userSession->Dao);\n }", "public function getUser()\n {\n $identity = $this->session->get('auth-identity');\n if (isset($identity['id'])) {\n $user = Users::findFirstById($identity['id']);\n if ($user == false) {\n // throw new Exception('The user does not exist');\n }\n\n return $user;\n }\n\n return false;\n }", "public function user()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsTo($classMapper->getClassMapping('user'), 'user_id');\n }", "public function getAuthenticatedUser()\n {\n try {\n if ( !$user = JWTAuth::parseToken()->authenticate() ) {\n return response()->json(['user_not_found'], 404);\n }\n } catch ( TokenExpiredException $e ) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch ( TokenInvalidException $e ) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch ( JWTException $e ) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n\n // The token is valid and we have found the user via the sub claim\n return $user;\n }", "public function getUser()\n\t{\n\t\tif (!isset($this->_r_user)) {\n\t\t\t$filters = [];\n\t\t\tif(!is_null($v = $this->getUserId())){\n\t\t\t\t$filters['user_id'] = $v;\n\t\t\t}\n\t\t\tif (empty($filters)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$m = new OZUsersControllerRealR();\n\t\t\t$this->_r_user = $m->getItem($filters);\n\t\t}\n\n\t\treturn $this->_r_user;\n\t}", "public function user()\n {\n return $this->belongsTo(config(\"binshopsblog.user_model\"), 'user_id');\n }", "public function authenticate(Request $request): ?User;" ]
[ "0.6329774", "0.6171094", "0.6139268", "0.6118511", "0.60709256", "0.60309404", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.5990263", "0.59812427", "0.59791493", "0.59632057", "0.595907", "0.5937105", "0.59332234", "0.59317803", "0.5920369", "0.5919846", "0.5916029", "0.5885953", "0.5871604", "0.5867854", "0.5867854", "0.5867854", "0.5867854", "0.5865967", "0.58631814", "0.58595335", "0.5857245", "0.5832678", "0.58302253", "0.5828004", "0.5822735", "0.5816272", "0.58148366", "0.5810939", "0.58083665", "0.5807495", "0.5801209", "0.5789478", "0.57802355", "0.5777817", "0.5770764", "0.5770676", "0.57693875", "0.5766593", "0.57592094", "0.57496", "0.57465804", "0.5742616", "0.57342964", "0.57315916", "0.57305944", "0.57272404", "0.57199174", "0.57100224", "0.57069725", "0.5704251", "0.57034457", "0.5697475", "0.56962115", "0.56915104", "0.5684484", "0.5682987", "0.5679905", "0.56560457", "0.5655747", "0.5653428", "0.5652718", "0.5650644", "0.5649642", "0.5647661", "0.56476146", "0.56464934", "0.56444526", "0.56436986", "0.5641171", "0.564075", "0.56275743", "0.5624555", "0.56221443", "0.56216264", "0.5619601", "0.56100005", "0.5606395", "0.56008446", "0.55976164", "0.55927956", "0.5591713", "0.55899465", "0.55841464", "0.558361", "0.55773544", "0.5575816", "0.55717695" ]
0.7263936
0
Returns a list of calendars for a principal
public function getCalendarsForUser($principalUri) { \GO::debug("c:getCalendarsForUser($principalUri)"); if(!isset($this->_cachedCalendars[$principalUri])){ $user = $this->_getUser($principalUri); $findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl() ->joinModel(array( 'model' => 'GO\Sync\Model\UserCalendar', 'localTableAlias' => 't', //defaults to "t" 'localField' => 'id', //defaults to "id" 'foreignField' => 'calendar_id', //defaults to primary key of the remote model 'tableAlias' => 'l', //Optional table alias )) ->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('user_id', $user->id, '=', 'l')); $stmt = \GO\Calendar\Model\Calendar::model()->find($findParams); if(!$stmt->rowCount()){ //If the sync settings dialog for this user is never opened no default settings are created \GO\Sync\Model\Settings::model()->findForUser($user); //create default settings $stmt = \GO\Calendar\Model\Calendar::model()->find($findParams); } $this->_cachedCalendars[$principalUri] = array(); while ($calendar = $stmt->fetch()) { $this->_cachedCalendars[$principalUri][] = $this->_modelToDAVCalendar($calendar, $principalUri); } } \GO::debug($this->_cachedCalendars[$principalUri]); return $this->_cachedCalendars[$principalUri]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchAllForCalendarHome(string $principalUri): array;", "public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }", "protected function getSortedCalendars(string $principalUri): array {\n\t\t$calendars = $this->backend->getCalendarsForUser($principalUri);\n\t\t$calendarsById = [];\n\t\tforeach ($calendars as $calendar) {\n\t\t\t$calendarsById[(int) $calendar['id']] = $calendar;\n\t\t}\n\n\t\treturn $calendarsById;\n\t}", "public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }", "public function getCalendars(User $user = null);", "function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}", "public function calendars()\n {\n return $this->hasMany('App\\Models\\Calendar');\n }", "public function getCalendars($where = null)\n {\n $result = [];\n $byParent = [];\n $values = [];\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n $stmt = $this->db->prepare('select * from calendars ' . $cond);\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get calendars list.'), E_APP_GET_CALENDARS);\n }\n\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\n $e['intervals'] = $this->getCalendarIntervals(['calendar' => @$e['id']]);\n $e['daysPerMonth'] = intval($e['daysPerMonth']);\n $e['daysPerWeek'] = intval($e['daysPerWeek']);\n $e['hoursPerDay'] = intval($e['hoursPerDay']);\n\n if (!$where) {\n $parentId = $e['parentId'] ? $e['parentId'] : '';\n\n if (!isset($byParent[$parentId])) {\n $byParent[$parentId] = [];\n }\n\n $byParent[$parentId][] = $e;\n } else {\n $result[] = $e;\n }\n }\n\n return $where ? $result : self::buildTree($byParent, '');\n }", "public static function getSharedCalendarsForUser($a_usr_id = 0)\r\n\t{\r\n\t\tglobal $ilDB,$ilUser,$rbacreview;\r\n\t\t\r\n\t\tif(!$a_usr_id)\r\n\t\t{\r\n\t\t\t$a_usr_id = $ilUser->getId();\r\n\t\t}\r\n\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_USR ,'integer').\" \".\r\n\t\t\t\"AND obj_id = \".$ilDB->quote($a_usr_id ,'integer').\" \".\r\n\t\t\t\"ORDER BY create_date\";\r\n\t\t$res = $ilDB->query($query);\r\n\t\t$calendars = array();\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$calendars[] = $row->cal_id; \r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($ilUser->getId());\r\n\t\t\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_ROLE ,'integer').\" \".\r\n\t\t\t\"AND \".$ilDB->in('obj_id',$assigned_roles,false ,'integer');\r\n\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\tif(in_array($row->cal_id,$calendars))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(ilCalendarCategories::_isOwner($ilUser->getId(),$row->cal_id))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\treturn $shared ? $shared : array();\r\n\t\t// TODO: return also role calendars\r\n\t\t\r\n\t}", "function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }", "public function getCalendar()\n {\n $result = new stdClass;\n $all_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS);\n if (!isset($all_calendars[$this->vars->cal]) && !$GLOBALS['conf']['share']['hidden']) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n } elseif (!isset($all_calendars[$this->vars->cal])) {\n // Subscribing to a \"hidden\" share, check perms.\n $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares');\n $share = $kronolith_shares->getShare($this->vars->cal);\n if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n }\n $calendar = new Kronolith_Calendar_Internal(array('share' => $share));\n } else {\n $calendar = $all_calendars[$this->vars->cal];\n }\n\n $result->calendar = $calendar->toHash();\n return $result;\n }", "public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}", "function getCalendarsForAdmin() {\n //\n // http://dev4.krubner.com/admin.php?page=admin_calendar\n //\n // this brings back 2 months worth of days to show in a calendar\n\n global $controller; \n\n $today = new DateTime(date('Y-m-d'));\n\n //Get Calendar for this week\n if(!isset($_GET['ym'])){\n $top_month = date('Y-m');\n } else {\n $top_month = $_GET['ym'];\n }\n\n $firstDayOfMonthDateTime = new DateTime($top_month.\"-01\");\n $lastDayOfMonthDateTime = clone $firstDayOfMonthDateTime;\n $lastDayOfMonthDateTime->modify(\"+1 month\");\n $lastDayOfMonthDateTime->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime, $lastDayOfMonthDateTime); \n\n $calendars = array();\n $calendars[$top_month] = $arrayOfDaysForThisMonth;\n\n $firstDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime;\n $firstDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime2;\n $lastDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime2, $lastDayOfMonthDateTime2); \n\n $calendars[$lastDayOfMonthDateTime2->format('Y-m')] = $arrayOfDaysForThisMonth;\n\n return $calendars; \n}", "public function getCalendarFor($name);", "public function getCalendarInfo()\n\t{\n\t\t\n\t\t//get URL to calendar page\n\t\t$url = $this->calendarLink;\n\t\t//Get the sourcecode\t\t\t\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//find all links to each person\n\t\t$query = \"//a\";\n\t\t$aTagNodes = $this->curl-> getDOMData($data,$query);\n\t\t\n\t\t$calendarDates = new CalendarDateRepository();\n\t\t//loop through each link, representing a person\n\t\tforeach ($aTagNodes as $at)\n\t\t{\n\t\t\t//get the href to that persons calendar\n\t\t\t$calURL =$at->getAttribute(\"href\");\n\t\t\t//get the sourcecode of that page\n\t\t\t$data = $this->curl->curlGetReq($url.$calURL);\n\t\t\t//get the table header containing name of the days\n\t\t\t$query = \"//th\";\n\t\t\t$days = $this->curl->getDOMData($data,$query);\n\t\t\t//get the table data containing availability\n\t\t\t$query = \"//td\";\n\t\t\t$availibility = $this->curl->getDOMData($data,$query);\t\t\t\n\n\t\t\t$dates = array();\n\t\t\t/*\n\t\t\t* loop table data, if the availability of that day is ok\n\t\t\t* save that data.\n\t\t\t*/\n\t\t\tfor ($i=0; $i < $days->length ; $i++)\n\t\t\t{ \n\t\t\t\t$availibilityStr =$availibility[$i]->nodeValue;\n\t\n\t\t\t\tif(strtolower($availibilityStr) === \"ok\")\n\t\t\t\t{\t\n\t\t\t\t\t//$calendarDates->add($days[$i]->nodeValue);\n\t\t\t\t\t$dates[] = new Day($days[$i]->nodeValue);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$calendarDates->add($dates);\n\t\t\t\n\t\t }\n\t\t\n\t\treturn $calendarDates; \n\t}", "public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}", "public function index()\n {\n $principal = Principal::all();\n return $principal;\n }", "public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;", "public function index()\n {\n return Calendar::all();\n }", "public function actionCalendar()\n {\n // Get current ID of logined user\n $userId = Yii::$app->user->getId() ?: '1000';\n $profile = (new UsersProfile())->getProfile();\n\n // Fill array keyes with [1, .., date(\"t\")].\n // date(\"t\") - count of days in current month\n $calendar = array_fill_keys(range(1, date(\"t\")), []);\n $model = new TaskQuery(Task::class);\n\n foreach ($model->getByCurrentMonth($userId)->all() as $task) {\n // Get current $task->date and create new DateTime object\n // $date->format(\"j\") -- Day of the month: 1, 2, .., 31\n // Fill array $calender with $task objects\n $date = \\DateTime::createFromFormat(\"Y-m-d H:i:s\", $task->deadline);\n $calendar[$date->format(\"j\")][] = $task;\n }\n\n return $this->render('calendar', \\compact('calendar', 'profile'));\n }", "public function findCalendarsByUser(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->where('c.createdBy = :user');\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->execute();\r\n }", "public function getUserCalendar(User $user): array\n {\n $calendarsURL = $user->getCalendars();\n\n $calendars = [];\n foreach ($calendarsURL as $calendar) {\n array_push($calendars, $this->fetchEvents($calendar->getURL()));\n }\n return $calendars;\n }", "public static function ObtenerCalendario()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM calendario\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "function createCalendar($principalUri, $calendarUri, array $properties) {\n\n return null;\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function createCalendar($principalUri, $calendarUri, array $properties) {}", "public function getCalendar() {\n return $this->calendar;\n }", "protected function get_calendar()\n\t{\n\t\treturn $this->calendars['gregorian'];\n\t}", "public function getCalendarPage();", "public function calendarPayroll($data)\n\t{\n\t\t// Formato fecha y-m-d\n\t\t$start = $data['start'];\n\t\t$end = $data['end'];\n\t\t\t\n\t\t// Formato a fecha d-m-y\n\t\t$startDate = date(\"d-m-Y\",strtotime($start));\n\t\t$endDate = date(\"d-m-Y\",strtotime($end));\n\t\t\t\n\t\t// Convertir a arreglo fechas\n\t\t$sDate = explode('-', $startDate);\n\t\t$eDate = explode('-', $endDate);\n\t\t$years = \"\";\n\t\t\t\n\t\t// Validar Fecha\n\t\tif ($sDate[1] == \"12\") {\n\t\t\tif ($sDate[0] == \"1\") {\n\t\t\t\t$years = $sDate[2];\n\t\t\t} else {\n\t\t\t\t$years = $eDate[2];\n\t\t\t}\n\t\t} else {\n\t\t\t$years = $sDate[2];\n\t\t}\n\t\t\t\n\t\t$users = $this->getUserService()->getUsersAndDetails();\n\t\t$semana = 0; $quincena = 0; $mes = 0;\n\t\t\t\n\t\tforeach ($users as $user){\n\t\t\tif ($user['period'] == 1){ $semana++; }\n\t\t\tif ($user['period'] == 2){ $quincena++; }\n\t\t\tif ($user['period'] == 3){ $mes++; }\n\t\t}\n\t\t\t\n\t\t$week = array(); $fortnight = array(); $month = array(); $arr = array();\n\t\t\t\n\t\tif ($semana > 0) {\n\t\t\t$week = $this->pagoSemana($years);\n\t\t} if ($quincena > 0) {\n\t\t\t$fortnight = $this->pagoQuincena($years);\n\t\t} if ($mes > 0){\n\t\t\t$month = $this->pagoMensual($years);\n\t\t}\n\t\t\t\n\t\t$calendar = array();\n\t\t\t\n\t\tforeach ($week as $w){\n\t\t\t$calendar[] = $w;\n\t\t}\n\t\tforeach ($fortnight as $f){\n\t\t\t$calendar[] = $f;\n\t\t}\n\t\tforeach ($month as $m){\n\t\t\t$calendar[] = $m;\n\t\t}\n\t\t\n\t\treturn $calendar;\n\t}", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "public function getCalendarObjects($calendarId) {\n\t\t\\GO::debug(\"c:getCalendarObjects($calendarId)\");\n\t\t\n\t\t//weird bug?\n\t\tif(!\\GO::user()) {\n\t\t\tthrow new Sabre\\DAV\\Exception\\NotAuthenticated();\n\t\t}\n\n\t\t//Get the calendar object and check if the user has delete permission.\n\t\t$calendar = \\GO\\Calendar\\Model\\Calendar::model()->findByPk($calendarId, false, true);\n//\t\tif(!$calendar->checkPermissionLevel(\\GO\\Base\\Model\\Acl::DELETE_PERMISSION))\n//\t\t\tthrow new Sabre\\DAV\\Exception\\Forbidden();\n\t\t\n\t\t\\GO::config()->caldav_max_months_old=isset(\\GO::config()->caldav_max_months_old) ? \\GO::config()->caldav_max_months_old : 6;\n\t\t\\GO::config()->caldav_max_months_old=\\GO::config()->caldav_max_months_old*-1;\n\n\n\t\t$objects = array();\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addCondition('exception_for_event_id', 0)\n\t\t\t->addCondition('calendar_id', $calendarId);\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t->ignoreAcl()\n\t\t\t->criteria($whereCriteria);\n\t\t\n\t\t$stmt = \\GO\\Calendar\\Model\\Event::model()->findForPeriod(\n\t\t\t$findParams, \n\t\t\t\\GO\\Base\\Util\\Date::date_add(time(), 0, GO::config()->caldav_max_months_old),\n\t\t\t\\GO\\Base\\Util\\Date::date_add(time(),0,0,3)\n\t\t); //Outlook crashes on dates far in the future.\n\t\t\n\t\t\\GO::debug(\"Found \".$stmt->rowCount().\" events\");\n\t\t\n\t\twhile ($event = $stmt->fetch()) {\n\t\t\t\n\t\t\t\n\t\t\t// Check if all occurences of this rrule are removed with an exception.\n\t\t\t// If so, then continue to the next event. (Sabredav cannot handle rrules where all possible dates are removed by exceptions)\n\t\t\tif(!empty($event->rrule)) {\n\t\t\t\ttry{\n\t\t\t\t\t$vobject = $event->toVObject();\n\t\t\t\t\t$it = new \\Sabre\\VObject\\Recur\\EventIterator($vobject);\n\t\t\t\t}catch(\\Exception $e) {\n\t\t\t\t\t\\GO::debug(\"Invalid rrule event ID: \".$event->id.' : '.$event->rrule.' '.$e->getMessage());\n\t\t\t\t\t\\GO::debug(\"All possible RRULE dates are removed by an RRULE Exception event so there is no event to display\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$calendar_user_id = $event->calendar->user_id;\n\t\t\t$user_id = \\GO::user()->id;\n\t\t\t\n\t\t\tif(!$event->private || $calendar_user_id == $user_id){\n\t\t\t\n\t\t\t\t$davEvent = DavEvent::model()->findByPk($event->id);\n\t\t\t\tif(!$davEvent || $davEvent->mtime != $event->mtime){\t\t\t\t\n\t\t\t\t\t$davEvent = CaldavModule::saveEvent($event, $davEvent);\n\t\t\t\t}\n\n\t\t\t\t$objects[] = array(\n\t\t\t\t\t'id' => $event->id,\n\t\t\t\t\t'uri' => $davEvent->uri,\n\t\t\t\t\t'calendardata' => $davEvent->data,\n\t\t\t\t\t'calendarid' => 'c:'.$calendarId,\n\t\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif($calendar->tasklist_id>0)\n\t\t{\n\t\t\t\n\t\t\t$tasklist = \\GO\\Tasks\\Model\\Tasklist::model()->findByPk($calendar->tasklist_id, false, true);\n\t\t\t\n\t\t\tif($tasklist && $tasklist->getPermissionLevel() > 0) {\n\n\t\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t\t->addCondition('tasklist_id', $calendar->tasklist_id)\n\t\t\t\t\t->mergeWith(FindCriteria::newInstance()\n\t\t\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t\t\t->addCondition('completion_time', 0)\n\t\t\t\t\t\t->addCondition('due_time', \\GO\\Base\\Util\\Date::date_add(time(), 0, \\GO::config()->caldav_max_months_old),'>','t',false));\n\n\t\t\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()\n\t\t\t\t\t->select('t.*')\n\t\t\t\t\t->ignoreAcl()\n\t\t\t\t\t->criteria($whereCriteria);\n\n\t\t\t\t$stmt = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\t\t\\GO::debug(\"Found \".$stmt->rowCount().\" tasks\");\n\n\n\t//\t\t\t$sql = \"SELECT * FROM ta_tasks WHERE tasklist_id=? AND (completion_time=0 OR due_time>?)\";\n\t//\t\t\t$count = $this->tasks->query($sql, 'ii', array($calendar['tasklist_id'], Date::date_add(time(),0,\\GO::config()->caldav_max_months_old)));\n\n\t\t\t\twhile ($task = $stmt->fetch()) {\t\t\t\n\t\t\t\t\t$davTask = DavTask::model()->findByPk($task->id);\n\n\t\t\t\t\tif(!$davTask || $davTask->mtime != $task->mtime){\t\t\t\t\n\t\t\t\t\t\t$davTask = CaldavModule::saveTask($task, $davTask);\n\t\t\t\t\t}\n\n\t\t\t\t\t$objects[] = array(\n\t\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t\t'uri' => $davTask->uri,\n\t\t\t\t\t\t'calendardata' => $davTask->data,\n\t\t\t\t\t\t'calendarid' => 'c:'.$calendarId,\n\t\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\\GO::debug($objects);\n\n\t\treturn $objects;\n\t}", "public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }", "public function getPagosCalendar() {\n// select t.id as id,\n// concat(\"Asignado a: \", CONCAT(c.nombre, CONCAT(\" \", c.apellido)), \" Tipo: Deuda\", \" Monto: \", CONVERT(t.monto, DECIMAL(4, 2))) as title,\n// t.fecha_creacion as start,\n// t.fecha_creacion as end,\n// \"['fc-event-danger', 'fc-border-event-danger']\" as className\n// from pago t\n// join cliente c on c.id = t.cliente_id\n// order by t.fecha_creacion ASC;\n $command = Yii::app()->db->createCommand()\n ->select(\"t.id as id,\n concat(\\\"Asignado a:\\\", CONCAT(c.nombre, CONCAT(\\\" \\\", c.apellido)), \\\" Tipo:Pago\\\", \\\" Monto:\\\",CONVERT(t.monto, DECIMAL(4,2)),\\\"$\\\") as title,\n t.fecha_creacion as start,\n t.fecha_creacion as end,\n \\\"fc-event-success fc-border-event-success\\\" as className\")\n ->from(\"pago t\")\n ->join(\"cliente c\", \"c.id = t.cliente_id\")\n ->order(\"t.fecha_creacion ASC\");\n// var_dump($command->queryAll());\n// die();\n return $command->queryAll();\n }", "public function calendarioacedemico()\n {\n return $this->hasMany(CalendarioAcad::class, 'iCalAcadId');\n }", "public function getCalendarItems($month = FALSE, $year = FALSE, $user_id = FALSE)\n\t{\n\t\t$sql = $this->db->select();\n\t\t$sql = $sql->from(array('i'=>'times'))->columns(array(new \\Zend\\Db\\Sql\\Expression('SUM(hours) AS total'), 'date', 'creator', 'user_id'));\n\n\t\tif($month)\n\t\t{\n\t\t\t$sql = $sql->where(array('month' => $month));\n\t\t}\n\t\t\n\t\tif($year)\n\t\t{\n\t\t\t$sql = $sql->where(array('year' => $year));\n\t\t}\n\t\t\n\t\tif($user_id)\n\t\t{\n\t\t\t$sql = $sql->where('creator = ? ', $user_id);\n\t\t}\t\t\t\t\n\t\t\n\t\t$sql = $sql->join(array('u' => 'users'), 'u.id = i.creator', array('creator_first_name' => 'first_name', 'creator_last_name' => 'last_name'), 'left');\t\t\t\t \n\t\t$sql = $sql->group('date')\n\t\t\t\t ->group('creator');\n\t\t\n\t\t$route_options = array('month' => $month, 'year' => $year);\n\t\t$route_options['user_id'] = $user_id;\n\t\t\n\t\treturn $this->_translateCalendarItems($this->getRows($sql), 'date', array('route_name' => 'times/view-day', 'options' => $route_options));\n\t}", "public function getCalendars($params){\n /**\n * @var integer $month 0 last month, 1 current month, 2 next month\n */\n $month = isset($params['month']) ? $params['month'] : 1;\n switch ($month){\n case 0:$date = date(\"Y-m-1\",strtotime(\"-1 month\"));break;\n case 1:$date = date(\"Y-m-1\",time());break;\n case 2:$date = date(\"Y-m-1\",strtotime(\"+1 month\"));break;\n default:$date = date(\"Y-m-1\",time());break;\n }\n $month = intval(date(\"m\",strtotime($date)));\n $week = date(\"w\",strtotime($date));\n $start = strtotime($date) - $week * 24 * 3600;\n $end = $start + 41 * 24 * 3600;\n\n $cser = $this->searchByTime($start,$end); /// 排班表内容\n $data = [];\n for ($i = 0; $i < 42; $i++){\n $i_time = $start + $i * 24 * 3600;\n $i_month = intval(date(\"m\",$i_time));\n $data[$i]['day'] = intval(date(\"d\",$i_time));\n $data[$i]['date'] = date(\"Y-m-d\",$i_time);\n $data[$i]['off'] = $i_month != $month ? true : false;\n $data[$i]['on'] = date(\"Y-m-d\",time()) == $data[$i]['date'] ? true : false;\n $flag = false;\n foreach ($cser as $k => $cs){\n if($cs['time'] == $i_time){\n $data[$i]['name'] = $cs['scheduler']['name'];\n $data[$i]['id'] = $cs['s_id'];\n $flag = true;\n unset($cser[$k]);\n break;\n }\n if($cs['time'] < $i_time){\n break;\n }\n }\n if(!$flag){\n $data[$i]['name'] = '无';\n $data[$i]['id'] = null;\n }\n }\n return $data;\n }", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "public function index() {\n\t\t$employees = Employee::all();\n\t\t$descriptionSigns = DescriptionSign::all();\n\t\t$month = date('m');\n\t\t$year = date('Y');\n\t\tforeach ($employees as $key => $value) {\n\t\t\t$calendar = Calendar::where('employee_id', '=', $value->id)->where('month',$month)->where('year',$year)->first();\n\t\t\tif($calendar == null)\n\t\t\t{\n\t\t\t\t$calendar = $this->bornCalendarEmpty($value->id,$month,$year);\n\t\t\t}\n\t\t\t$this->generatePresenteWhenInitNewDate($calendar, $month, $year);\n\t\t\t$employees[$key]->calendar = $calendar;\n\t\t}\n\n\t\t$func = function($emp) {\n\t\t return $emp->year;\n\t\t};\n\t\t// Year is stored in database calendar.\n\t\t$years = collect(Calendar::all())->map($func);\n\t\t$years = array_unique($years->toArray());\n\n\t\treturn view('calendar.calendar', compact('employees','month','year','years','descriptionSigns'));\n\t}", "public function getCalendarObjects($calendarId)\n {\n $params[\"calendar_id\"] = $calendarId;\n\n list($type, $user) = explode(\"_\", $calendarId);\n\n $events = MyScEvents::getMyScEvents($params);\n\n// Info: Array scheme\n// $events[] = array(\n// \"allDay\"=> false,\n// \"description\" => $description,\n// \"end\" => $end->format(\"Y-m-d H:i:s\"),\n// \"id\" => $id,\n// \"start\" => $start->format(\"Y-m-d H:i:s\"),\n// \"title\" => $title,\n// \"summary\" => \"Test2\",\n// \"calendardata\" => \"BEGIN:VCALENDAR\\nVERSION:2.0\\n\"\n// . \"PRODID:mySchoolCalendar\"\n// . \\OCP\\App::getAppVersion('mySchoolCalendar') . \"\\n\"\n// . $vevent->serialize() . \"END:VCALENDAR\"\n// );\n\n $objects = array();\n\n foreach ($events as $event) {\n $object = array(\n \"id\" => $event[\"id\"],\n \"uri\" => $type . \"_event_\" . $event[\"id\"],\n \"lastmodified\" => time(),\n \"calendarid\" => $calendarId,\n \"calendardata\" => $event[\"calendardata\"]\n );\n\n $objects[] = $object;\n }\n\n return $objects;\n }", "public function getCalendar()\n {\n return IntlCalendar::fromDateTime($this);\n }", "private function getCalendar($calendar_obj_list, $cal_id){\n\t\t$main_cal_obj = false;\n\t\tforeach($calendar_obj_list as $cal){\n\t\t\tif($cal->getId() == $cal_id){\n\t\t\t\t$main_cal_obj = $cal;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!is_object($main_cal_obj) && is_object($calendar_obj_list[0])){\n\t\t\t// they specified an incorrect calendar id\n\t\t\t// just use the first calendar\n\t\t\t$main_cal_obj = $calendar_obj_list[0];\n\t\t}\n\t\treturn $main_cal_obj;\n\t}", "function getHomeCalendar()\n {\n $intYear = (isset($_GET['yearID'])) ? intval($_GET['yearID']) : date('Y', time());\n $intMonth = (isset($_GET['monthID'])) ? intval($_GET['monthID']) : date('m', time());\n $intDay = (isset($_GET['dayID'])) ? intval($_GET['dayID']) : 0;\n return $this->getCalendar($intYear,$intMonth,$intDay);\n }", "public function events()\n {\n return $this->hasMany(CalendarEvent::class);\n }", "public function getGroupMembership($principal)\n {\n return [];\n }", "public function listarc()\n\t{\n\t\t$sql=\"SELECT * FROM persona WHERE tipo_persona = 'Cliente';\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "function get_calendar($initial = \\true, $display = \\true)\n {\n }", "function getCalendarObjects($calendarId) {\n \n $this->mylog(' getCalendarObjects');\n\n $evts = $this->base->events_event_liste ($this->auth->token, $calendarId, NULL, NULL, NULL, NULL, NULL, NULL);\n\n $results = [];\n\n if (count($evts)) {\n\tforeach ($evts as $evt) {\n\t \n\t $calendardata = $this->getCalendarData($evt);\n\t $results[] = [\n\t\t\t'id' => $evt['eve_id'],\n\t\t\t'uri' => $evt['eve_id'].'.ics',\n\t\t\t'lastmodified' => $evt['eve_date_modification'], \n\t\t\t'etag' => '\"' . md5($calendardata) . '\"',\n\t\t\t'calendarid' => $calendarId,\n\t\t\t'calendardata' => $calendardata,\n\t\t\t'size' => (int)strlen($calendardata),\n\t\t\t'component' => 'vevent',\n\t\t\t];\n\t //\t $this->mylog(' == '.$evt['eve_date_modification'].' '.$evt['eve_id']);\n\t}\n }\n \n return $results;\n }", "private function createCalendar($method)\n {\n // Create calender.\n $calendar = $this->ics->createCalendar(null, true);\n\n // Set request method.\n $calendar->setMethod(strtoupper($method));\n\n return $calendar;\n }", "public function index() {\n\t\t// and merge the aclConditions in\n\t\tif ($this->Session->check('Workspace.id')) {\n\t\t\t$aclOptions = array(\n\t\t\t\t'cache' => false,\n\t\t\t\t'merge' => false\n\t\t\t);\n\t\t} else {\n\t\t\t$aclOptions = array(\n\t\t\t\t'cache' => true,\n\t\t\t\t'merge' => true\n\t\t\t);\n\t\t}\n\t\t// the calendar is requesting milestones\n\t\tif ($this->RequestHandler->prefers('json')) {\n\t\t\t// setup our conditions\n\t\t\t$conditions = $this->Acl->conditions(\n\t\t\t\tarray(\n\t\t\t\t\t'fields' => array('id', 'name', 'starts', 'ends')\n\t\t\t\t),\n\t\t\t\t$aclOptions\n\t\t\t);\n\t\t\t// filter our conditions\n\t\t\t$conditions = $this->_filterLevel($conditions);\n\t\t\t$this->__calendarResponse($conditions);\n\t\t\treturn;\n\t\t}\n\t\t// setup our conditions and filter them\n\t\t$this->paginate = $this->_filterLevel($this->Acl->conditions(null, $aclOptions));\n\t\tparent::index(true);\n\t}", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "public function index()\n {\n return OrganizerResource::collection(\n Auth::user()->organizers\n );\n }", "public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}", "public function createCalendar($principalUri, $calendarUri, array $properties)\n\t{\n\n\t\t$uid = dav_compat_principal2uid($principalUri);\n\n\t\t$r = q(\"SELECT * FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, $uid, dbesc($calendarUri));\n\t\tif (count($r) > 0) throw new Sabre_DAV_Exception_Conflict(\"A calendar with this URI already exists\");\n\n\t\t$keys = array(\"`namespace`\", \"`namespace_id`\", \"`ctag`\", \"`uri`\");\n\t\t$vals = array(CALDAV_NAMESPACE_PRIVATE, IntVal($uid), 1, \"'\" . dbesc($calendarUri) . \"'\");\n\n\t\t// Default value\n\t\t$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n\t\t$has_vevent = $has_vtodo = 1;\n\t\tif (isset($properties[$sccs])) {\n\t\t\tif (!($properties[$sccs] instanceof Sabre_CalDAV_Property_SupportedCalendarComponentSet)) {\n\t\t\t\tthrow new Sabre_DAV_Exception('The ' . $sccs . ' property must be of type: Sabre_CalDAV_Property_SupportedCalendarComponentSet');\n\t\t\t}\n\t\t\t$v = $properties[$sccs]->getValue();\n\t\t\t$has_vevent = $has_vtodo = 0;\n\t\t\tforeach ($v as $w) {\n\t\t\t\tif (mb_strtolower($w) == \"vevent\") $has_vevent = 1;\n\t\t\t\tif (mb_strtolower($w) == \"vtodo\") $has_vtodo = 1;\n\t\t\t}\n\t\t}\n\t\t$keys[] = \"`has_vevent`\";\n\t\t$keys[] = \"`has_vtodo`\";\n\t\t$vals[] = $has_vevent;\n\t\t$vals[] = $has_vtodo;\n\n\t\tforeach ($this->propertyMap as $xmlName=> $dbName) {\n\t\t\tif (isset($properties[$xmlName])) {\n\t\t\t\t$keys[] = \"`$dbName`\";\n\t\t\t\t$vals[] = \"'\" . dbesc($properties[$xmlName]) . \"'\";\n\t\t\t}\n\t\t}\n\n\t\t$sql = sprintf(\"INSERT INTO %s%scalendars (\" . implode(', ', $keys) . \") VALUES (\" . implode(', ', $vals) . \")\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX);\n\n\t\tq($sql);\n\n\t\t$x = q(\"SELECT id FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'\",\n\t\t\tCALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, $uid, $calendarUri\n\t\t);\n\t\treturn $x[0][\"id\"];\n\n\t}", "public function calendar(): Calendar\n {\n return new Calendar($this);\n }", "public function calendarIndex()\n {\n return view('calendar');\n }", "public function index()\n {\n $this->calendar->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $calendar = $this->calendar->paginate(1);\n $horario = $this->horario->all();\n $pessoa = $this->pessoa->all();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $calendar,\n 'horarios' => $horario,\n 'pessoas' => $pessoa\n ]);\n }\n\n return view('app.pages.calendars.index', compact('calendar','horario', 'pessoa'));\n }", "public function getAllConferences() : array {\n $query='SELECT * FROM Publication WHERE categorie_id=2 ORDER BY ID;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }", "function getCalendarObjectByUID($principalUri, $uid) {\n return null; // TODO\n }", "public function __construct($uid = 0, $principalId = 0)\n {\n $this->uid = intval($uid);\n $this->principalId = intval($principalId);\n\n parent::__construct();\n\n $this->Tbl['cal_event'] = $this->DB['db_pref'].'calendar_events';\n $this->Tbl['cal_task'] = $this->DB['db_pref'].'calendar_tasks';\n $this->Tbl['cal_holiday'] = $this->DB['db_pref'].'calendar_holidays';\n $this->Tbl['cal_group'] = $this->DB['db_pref'].'calendar_groups';\n $this->Tbl['cal_project'] = $this->DB['db_pref'].'calendar_projects';\n $this->Tbl['cal_attach'] = $this->DB['db_pref'].'calendar_event_attachments';\n $this->Tbl['cal_attendee'] = $this->DB['db_pref'].'calendar_event_attendees';\n $this->Tbl['cal_reminder'] = $this->DB['db_pref'].'calendar_event_reminders';\n $this->Tbl['cal_repetition'] = $this->DB['db_pref'].'calendar_event_repetitions';\n $this->Tbl['user'] = $this->DB['db_pref'].'user';\n $this->Tbl['user_foldersettings'] = $this->DB['db_pref'].'user_foldersettings';\n\n $this->DB['ServerVersionString'] = $this->serverinfo();\n $this->DB['ServerVersionNum'] = preg_replace('![^0-9\\.]!', '', $this->DB['ServerVersionString']);\n\n $this->query('SET SESSION sql_mode=\"ALLOW_INVALID_DATES\"');\n\n try {\n $dbSh = new DB_Controller_Share();\n $allShares = $dbSh->getFolderList($this->uid, 'calendar');\n $this->allShares = (!empty($allShares[$this->uid]['calendar'])) ? $allShares[$this->uid]['calendar'] : array();\n } catch (Exception $e) {\n $this->allShares = array();\n }\n }", "function getCalendarObjects($calendarId)\n\t{\n\t\t$objs = q(\"SELECT * FROM %s%scalendarobjects WHERE `calendar_id` = %d\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId));\n\t\t$ret = array();\n\t\tforeach ($objs as $obj) {\n\t\t\t$ret[] = array(\n\t\t\t\t\"id\" => IntVal($obj[\"id\"]),\n\t\t\t\t\"calendardata\" => $obj[\"calendardata\"],\n\t\t\t\t\"uri\" => $obj[\"uri\"],\n\t\t\t\t\"lastmodified\" => $obj[\"lastmodified\"],\n\t\t\t\t\"calendarid\" => $calendarId,\n\t\t\t\t\"etag\" => $obj[\"etag\"],\n\t\t\t\t\"size\" => IntVal($obj[\"size\"]),\n\t\t\t);\n\t\t}\n\t\treturn $ret;\n\t}", "public function calendario()\n {\n $alerts = Alerts::with('user')->get();\n return view('alertas.calendario', compact('alerts'));\n }", "public function getHolidays()\n {\n\t\t$db = $this->getDbo();\n\t\t$rHolidays = array();\n\t\t\n\t\t$query = $db->getQuery(true)\n\t\t\t->select('a.*')\n\t\t\t->from('#__cooltouraman_holiday AS a')\n\t\t\t->where('1');\n\t\t\t\n\t\t$db->setQuery($query);\n\t\t\n\t\t$holidays = $db->loadObjectlist();\n\t\t\n\t\tforeach($holidays as $holiday)\n\t\t{ \n\t\t\t$thisYear = new DateTime();\n\t\t\t$nextYear = new DateTime();\n\t\t\t$nextYear->modify('+ 1 year');\n\t\t\t\n\t\t\tif ($holiday->year === '*')\n\t\t\t\t\t$holiday->year = $thisYear->format(\"Y\");\n\t\t\t\n\t\t\tif ($holiday->year === $thisYear->format(\"Y\") || $holiday->year === $nextYear->format(\"Y\"))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$holidayDate = new DateTime($holiday->year.'-'.$holiday->month.'-'.$holiday->day);\n\t\t\t\t$monthName = strtoupper($holidayDate->format(\"F\"));\n\n\t\t\t\tif(!isset($rHolidays[$monthName]))\n\t\t\t\t\t$rHolidays[$monthName] = array();\n\t\t\t\t\n\t\t\t\t$rHolidays[$monthName][$holidayDate->format(\"d-m-Y\")]['day'] = $holidayDate->format(\"d\");\n\t\t\t\t$rHolidays[$monthName][$holidayDate->format(\"d-m-Y\")]['title'] = $holiday->title;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rHolidays;\n }", "public static function get_all_course_events($cid = NULL) {\r\n global $uid, $course_id;\r\n if (is_null($cid)) {\r\n $cid = $course_id;\r\n }\r\n return Database::get()->queryArray(\"SELECT id, title, content FROM personal_calendar WHERE user_id = ? AND reference_obj_course = ? \", $uid, $cid);\r\n }", "public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }", "function Get_Date_List($info, $first_date, $rules, $total_dates = 1, $num_service_charges = null, $start_date = null)\n{\n\t$calc = new ECash_DueDateCalculator($info, $first_date, $rules, $num_service_charges);\n\treturn $calc->getDateList($total_dates, $start_date);\n}", "public function getCalendar()\r\n {\r\n if (!$this->_calendar && $this->getCalendarId()) {\r\n $this->_calendar = Mage::getModel('google/calendar')->load($this->getCalendarId());\r\n }\r\n\r\n return $this->_calendar;\r\n }", "public function getReservaciones() {\n $pdo = Database::connect();\n $sql = \"select * from reservacion order by id_reservacion\";\n $resultado = $pdo->query($sql);\n //transformamos los registros en objetos:\n $listadoReserva = array();\n foreach ($resultado as $res) {\n $reservacion = new reservacion($res['nombre_paciente'], $res['id_medico'], $res['id_reservacion'], $res['descripcion'], $res['nota'], $res['fecha_cita'], $res['hora_cita'], $res['fecha_creacion']);\n array_push($listadoReserva, $reservacion);\n }\n Database::disconnect();\n //retornamos el listado resultante:\n return $listadoReserva;\n }", "public function getSubCalendars($subCalendarMode) {\r\n $subViewCalendars = array();\r\n $startDate = $this->getStartDate();\r\n $endDate = $this->getEndDate();\r\n\r\n while($startDate < $endDate) {\r\n $subViewCalendar = $this->objectManager->get('DieMedialen\\DmSimplecalendar\\Domain\\Model\\ViewCalendar');\r\n $subViewCalendar->setTimestamp($startDate->getTimestamp());\r\n $subViewCalendar->setMode($subCalendarMode);\r\n $subViewCalendar->setAppointments($this->getAppointmentsFromRange($subViewCalendar->getStartDate(), $subViewCalendar->getEndDate()));\r\n\r\n $startDate = $subViewCalendar->getEndDate()->modify('+1 second');\r\n $subViewCalendars[] = $subViewCalendar;\r\n }\r\n\r\n return $subViewCalendars;\r\n }", "public function getCalendarNodes()\n {\n return $this->getOrCreateCalendarBag();\n }", "public function consultarEventosCalendarioUsuario($idUsuario, $fechaInicio, $fechaFin){\n\t\t\n\t\t\n\t\t$resultadoEventos = array();\n\t\t\n\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \n\t\t/*Citas--------------------------------------------------*/\n\t\t$query = \"SELECT C.idAgendaCita, C.fecha, C.horaInicio, C.fechaFin, C.horaFin, C.estado, C.observaciones, C.idMascota, C.idSucursal,\n\t\t\t\t\tC.idTipoCita, C.idPropietario,\n\t\t\t\t\tM.nombre as nombrePaciente, \n\t\t\t\t\tS.nombre as nombreSucursal, S.telefono1 as telefono1Sucursal, S.direccion,\n\t\t\t\t\tTC.nombre as nombreTipoCita,\n\t\t\t\t\tP.identificacion, P.nombre as nombrePropietario, P.apellido, P.telefono, P.celular, P.email\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tFROM tb_agendaCitas as C\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tINNER JOIN tb_agendaCitas_usuarios AS U on U.idAgendaCita = C.idAgendaCita\n\t\t\t\t\tINNER JOIN tb_mascotas as M on M.idMascota = C.idMascota\n\t\t\t\t\tINNER JOIN tb_sucursales AS S on S.idSucursal = C.idSucursal\n\t\t\t\t\tINNER JOIN tb_propietarios AS P on P.idPropietario = C.idPropietario\n\t\t\t\t\tLEFT JOIN tb_tiposCita AS TC on TC.idTipoCita = C.idTipoCita\n\t\t\t\t\t\n\t\t\t\t\tWHERE (C.estado <> 'Cancelada') AND (C.fecha BETWEEN '$fechaInicio' and '$fechaFin') AND (U.idUsuario = '$idUsuario') AND (U.estado = 'A') \";\n\t\t\n $conexion = parent::conexionCliente();\t\t\n\t\n\t\tif($res = $conexion->query($query)){\n while ($filas = $res->fetch_assoc()) {\n \t\t\t\n \t\t$color = \"\";\t\n \t\tif($filas['estado'] == \"inasistida\"){\n \t\t\t$color = \"#e57373\";\n \t\t}\n\n\t\t\t\t\t\tif($filas['estado'] == \"Atendida\"){\n \t\t\t$color = \"#9e9e9e\";\n \t\t}\n \t\n $resultadoEventos[] = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t \t\t\t => $filas['idAgendaCita'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t\t \t\t\t => $filas['nombrePropietario'].\" \".$filas['apellido'].\" (\".$filas['nombrePaciente'].\")\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t'start'\t\t\t\t\t => $filas['fecha'].\"T\".$filas['horaInicio'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t'end'\t\t \t\t\t => $filas['fechaFin'].\"T\".$filas['horaFin'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t\t\t\t => $color,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'TipoCita'\t\t\t\t => \" -\".$filas['nombreTipoCita'].\"- \",\n\t\t\t\t\t\t\t\t\t\t\t\t\t'className'\t\t\t\t => 'cita'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n \n \n \n }//fin while\n \n /* liberar el conjunto de resultados */\n $res->free(); \n }\n\t\t/*Fin Citas--------------------------------------------------*/\n\t\t\n\t\t\n\t\t\n\t\t/*Horarios Semana---------------------------------------------*/\n\t\t\n\t\t$queryHorarioSemana = \"SELECT idAgendaHorarioUsuario, horaInicio, horaFin, numeroDia \n\t\t\t\t\t\t\t\tFROM tb_agendaHorarioUsuario\n\t\t\t\t\t\t\t\tWHERE idUsuario = '$idUsuario' AND estado = 'A'\";\n\t\t\n\t\t\t\tif($res2 = $conexion->query($queryHorarioSemana)){\n\t while ($filas2 = $res2->fetch_assoc()) {\n\t \t\t \t\t\n\t\t\t\t\t\tif($dia == '6'){\n\t\t\t\t\t\t\t$dia = '0';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dia = $filas2['numeroDia']+1; \n\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 $resultadoEventos[] = array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t => 'prueba',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'start'\t\t\t\t\t => $filas2['horaInicio'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'end'\t\t \t\t\t => $filas2['horaFin'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'rendering'\t\t\t\t => 'background',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'dow'\t\t\t\t\t => '['.$dia.']',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'className'\t\t\t\t => 'horarioDiaSemana'\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \n\t }//fin while\n\t \n\t /* liberar el conjunto de resultados */\n\t $res2->free(); \n \t\t}\n\t\t/*Fin Horarios Semana---------------------------------------------*/\n\t\t\n\t\t\n\t\t/*recesos Semana---------------------------------------------*/\n\t\t\n\t\t$queryRecesosSemana = \"SELECT \n\t\t\t\t\t\t\t\t ARU.idAgendaRecesosUsuario,\n\t\t\t\t\t\t\t\t ARU.numeroDia,\n\t\t\t\t\t\t\t\t AHR.idAgendaHorarioReceso,\n\t\t\t\t\t\t\t\t AHR.horaInicio,\n\t\t\t\t\t\t\t\t AHR.horaFin\n\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t tb_agendaRecesosUsuario AS ARU\n\t\t\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t\t\t tb_agendaHorarioReceso AS AHR ON AHR.idAgendaRecesosUsuario = ARU.idAgendaRecesosUsuario\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t ARU.idUsuario = '$idUsuario' AND AHR.estado = 'A'\";\n\t\t\n\t\t\t\tif($res3 = $conexion->query($queryRecesosSemana)){\n\t while ($filas3 = $res3->fetch_assoc()) {\n\t \t\n\t\t\t\t\t\tif($dia == '6'){\n\t\t\t\t\t\t\t$dia = '0';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dia = $filas3['numeroDia']+1; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t \t\t\n\t\t\t\t\t\t \t\t \t\n\t $resultadoEventos[] = array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'start'\t\t\t\t\t => $filas3['horaInicio'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'end'\t\t \t\t\t => $filas3['horaFin'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'rendering'\t\t\t\t => 'background',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t\t\t\t => 'orange',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'dow'\t\t\t\t\t => '['.$dia.']',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'className'\t\t\t\t => 'recesoDiaSemana'\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \n\t }//fin while\n\t \n\t /* liberar el conjunto de resultados */\n\t $res3->free(); \n \t\t}\n\t\t/*Fin recesos Semana---------------------------------------------*/\t\t\n\t\t\n\t\t\n\t\t/*Horario por fechas----------------------------------------------*/\n\t\t$queryHorarioFechas = \"SELECT \n\t\t\t\t\t\t\t\t idAgendaHorarioFechaUsuario, horaInicio, horaFin, fecha\n\t\t\t\t\t\t\t FROM tb_agendaHorarioFechaUsuario\n\t\t\t\t\t\t\t WHERE estado = 'A' AND idUsuario = '$idUsuario'\";\n\t\t\n\t\t\t\tif($res4 = $conexion->query($queryHorarioFechas)){\n\t while ($filas4 = $res4->fetch_assoc()) {\n\t \t\t\t\t\t \t\t\n\t\t\t\t\t\t \t\t \t\n\t $resultadoEventos[] = array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'start'\t\t\t\t\t => $filas4['fecha'].\"T\".$filas4['horaInicio'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'end'\t\t \t\t\t => $filas4['fecha'].\"T\".$filas4['horaFin'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'rendering'\t\t\t\t => 'background',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'className'\t\t\t\t => 'horarioFecha'\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \n\t }//fin while\n\t \n\t /* liberar el conjunto de resultados */\n\t $res4->free(); \n \t\t}\n\t\t\n\t\t\n\t\t\n\t\t/*Fin horario por fechas-------------------------------------------*/\n\t\t\n\t\t\n\t\t/*recesos por fechas-------------------------------------------*/\n\t\t\t$queryRecesoFechas = \"SELECT \n\t\t\t\t\t\t\t\t RFU.fecha, RF.horaInicio, RF.horaFin\n\t\t\t\t\t\t\t FROM tb_agendaHorarioRecesoFecha AS RF\n\t\t\t\t\t\t\t INNER JOIN tb_agendaRecesosFechaUsuario AS RFU ON RFU.idAgendaRecesosFechaUsuario = RF.idAgendaRecesosFechaUsuario\n\t\t\t\t\t\t\t WHERE RF.estado = 'A' AND RFU.idUsuario = '$idUsuario'\";\n\t\t\n\t\t\t\tif($res5 = $conexion->query($queryRecesoFechas)){\n\t while ($filas5 = $res5->fetch_assoc()) {\n\t \t\t\t\t\t \t\t\n\t\t\t\t\t\t \t\t \t\n\t $resultadoEventos[] = array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'start'\t\t\t\t\t => $filas5['fecha'].\"T\".$filas5['horaInicio'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'end'\t\t \t\t\t => $filas5['fecha'].\"T\".$filas5['horaFin'].\"-05:00\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'rendering'\t\t\t\t => 'background',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'className'\t\t\t\t => 'recesoFecha',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t\t\t\t => 'orange'\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t \n\t }//fin while\n\t \n\t /* liberar el conjunto de resultados */\n\t $res5->free(); \n \t\t}\n\t\t/*Fin recesos por fechas-------------------------------------------*/\n\t\t\n\t\t\n\n\n return $resultadoEventos;\t\n\n\t\t\n\t\t\n\t}", "public function calificaciones(){\n return $this->morphMany('App\\Calificacion','calificacion');\n }", "public function getGroupMemberSet($principal)\n {\n return [];\n }", "public function get_all_data()\n\t{\n\treturn $this->cal;\n\t}", "public function getAllCurricula() {\n return $this->get('get_all_curricula');\n }", "public function actionIndex()\n {\n $searchModel = new CalendarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function calendario() {\n\t\t$condicion=array(\n\t\t\t'pa_capacitacion_cursos_propuestos.Estado' => 1,\n\t\t\t'pa_capacitacion_cursos_propuestos.IdArea'\t=>$this->session->userdata('id_area'),\n\t\t\t'pa_capacitacion_cursos_propuestos.IdArea'\t=> 12,\n\t\t);\n\t\t\n\t\t$this->db->group_by('pa_capacitacion_cursos.Curso');\n\t\t$this->db->order_by('pa_capacitacion_cursos_propuestos.Fecha');\n\t\t$this->db->join('pa_capacitacion_cursos', 'pa_capacitacion_cursos.IdCapacitacionCurso = pa_capacitacion_cursos_propuestos.IdCurso');\n\t\t$consulta = $this->db->get_where( 'pa_capacitacion_cursos_propuestos', $condicion );\n\t\t \n\t\treturn $consulta;\n\t}", "public function getAnioCalendario(){\n return $this->anioCalendario;\n }", "public static function getAllConferences() :array {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $results = $publicationGW->getAllConferences(); \n $data = array();\n foreach ($results as $row){\n $data[]=new Publication ($row['ID'], $row['reference'], $row['authors'], $row['title'], $row['date'], $row['journal'], $row['volume'], $row['number'], $row['pages'], $row['note'], $row['abstract'], $row['keywords'], $row['series'], $row['localite'], $row['publisher'], $row['editor'], $row['pdf'], $row['date_display'], $row['categorie_id']);\n \n }\n \n return $data;\n }", "public function cal_indexAction()\n {\n $startDate = date(\"Y-m-d\") ;\n $endDate = date(\"Y-m-d\", mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")+1));\n $em = $this->getDoctrine()->getManager();\n $dql1 = \"SELECT c.title,c.date,c.time,c.description FROM EnglishCalendarBundle:Calendar c WHERE c.date >= ?1 and c.date < ?2 ORDER BY c.date ASC\";\n $calendar = $em->createQuery($dql1)->setParameter('1',$startDate)->setParameter('2',$endDate)->getResult();\n return $this->render('EnglishHomeBundle:Default:cal_index.html.twig', array('calendar' => $calendar,));\n\n }", "public static function getEnterpriseCompanies(){\n $result = db::get(\"SELECT uid_empresa FROM \". TABLE_EMPRESA .\" WHERE is_enterprise = 1 ORDER BY nombre\", \"*\", 0, \"empresa\");\n return new ArrayObjectList($result);\n }", "public function calendar(){\n\n /**\n * Hago una consulta a la tabla eventos para que me traiga los eventos\n * que esten activos y le pido que me lo convierta a array\n */\n $events = Event::query()->where('state','Activo')->get()->toArray();\n\n /**\n * Creo un array vacio\n */\n $eventos = array();\n\n /**\n * Recorro cada uno de los elementos de la consulta que hice antes con un foreach\n * y los guardo en un array, en la posicion title guardo el titulo y la descripcion\n * y la fecha la guardo en la posicion start, ya que asi me la pide el fullcalendar\n */\n foreach($events as $event){\n $evento = [\n 'title' => $event['title'].\" | \".$event['description'],\n 'start' => $event['date'],\n ];\n /**\n * Guardo el array anterior en el array vacio que cree antes\n */\n array_push($eventos,$evento);\n }\n return view('calendar' , compact('eventos'));\n }", "public function getCalendar() {\n\t\t$this->setDate();\n\t\t$this->getLinks();\n\t\t $this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\n\n\t\t// Get new date array\n\t\t$newDate = getdate(mktime(0,0,0,$this->newMonth, 1, $this->newYear));\n\t\t// Calculate rest days in previous and next month\n\t\t$firstDay = $newDate['wday'];\n\t\t$firstDay = ($firstDay == 0) ? 7: $firstDay;\n\t\t$daysInMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth , $this->newYear );\n\t\tif($this->newMonth != 1){\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth-1 , $this->newYear );\n\t\t}\n\t\telse if($this->newMonth == 1) {\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , 12 , $this->newYear-1 );\n\t\t}\n\n\t\t$lastDates = $daysInPrevMonth - $firstDay +1;\n\n\t\t// Start building table\n\t\t$table =\"<section class='calendar'><header>\" . $this->prevLink . \"<h3>\" . $newDate['month'] . \" - \" . $newDate['year'] . \"</h3>\" . $this->nextLink;\n\t\t$table .= \"</header><table><thead>\\n\";\n\t\t$table .= \"<th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th>\\n\";\n\t\t$table .= \"</thead>\\n\";\n\t\t$table .= \"<tr>\";\n\t\t\n\t\tfor ($a=1; $a < $firstDay ; $a++) { \n\t\t\t$lastDates++;\n\t\t\t$table .= \"<td class='lighter'>\" . $lastDates . \"</td>\";\n\t\t}\n\n\t\t$d = 0;\n\t\tfor ($b=0; $b < $daysInMonth ; $b++) { \n\t\t\t\n\t\t\t$d++;\n\t\t\t$DATE = date('N',mktime(0,0,0, $this->newMonth, $d, $this->newYear));\n\t\t\t\n\t\t\tif ($DATE == 1) {\n\t\t\t\t$table .= \"</tr>\\n<tr>\";\n\t\t\t}\n\n\t\t\tif (($this->newMonth == $this->currentMonth && $d == $this->currentDate && $this->newYear == $this->currentYear)) {\n\t\t\t\t$table .= \"<td><strong>\" . $d . \"</strong></td>\";\n\t\t\t}\n\t\t\telse if ($DATE == 7) {\n\t\t\t\t$table .= \"<td class='red'>\" . $d . \"</td>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$table .= \"<td>\" . $d . \"</td>\";\n\t\t\t}\n\t\t}\n\t\t\tif ($DATE != 7) {\n\t\t\t\t$nextMonthDays = 7 - $DATE;\n\t\t\t\tfor ($c=1; $c <= $nextMonthDays ; $c++) { \n\t\t\t\t\t$table .= \"<td class='lighter'>\" . $c . \"</td>\";\n\t\t\t}\n\t}\n\t\t$table .= \"</tr></table></section>\";\n\n\t\treturn $table;\n\t}", "function obtenerSesion_agendar(){\n\t\t\n\t\t$query1 = ('select sesion.id, sesion.checkin, sesion.pagada, sesion.id_servicio, sesion.id_usuario, sesion.id_agenda, sesion.ejecutada, usuario.nombre,\n\t\t\t\t\tusuario.apellido, servicio.descripcion , cliente.nombre as nombre_cliente , cliente.apellido as apellido_cliente from sesion \n\t\t\t\t\tInner JOIN usuario\n\t\t\t\t\ton sesion.id_usuario = usuario.id\n\t\t\t\t\tInner Join servicio\n\t\t\t\t\ton sesion.id_servicio = servicio.id\n\t\t\t\t\tInner Join cliente\n\t\t\t\t\ton sesion.id_cliente = cliente.id\n\t\t\t\t\twhere sesion.id_agenda is NULL'); //QUERY PARA OBTENER TODO DE UNA VEZ.\n\t\t$query = $this->db->query($query1);\n\t\t\n\t\t\n\t //$query = $this->db->get('sesion');\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t \n\t \n\t}", "public function index()\n {\n //$calendar_events = CalendarEvent::all(); //Too Many?\n $calendar_events = CalendarEvent::where('user_id', '!=', '1')->whereBetween(\n 'start', [Carbon::today(), Carbon::today()->addMonths(3)])->get();\n $today = Carbon::today()->toDateString();\n $calendar_events_sorted = CalendarEvent::whereDate('start', '=', $today)\n ->get()->sortby('start');\n\n $calendar = $this->prepCalendar($calendar_events);\n\n $admins = Admin::all()->pluck('name', 'id');\n\n \\JavaScript::put(['admin' => Auth::guard('admin')->check()]);\n\n return view('calendar_events.index', compact('calendar_events', 'calendar_events_sorted', 'calendar', 'admins'));\n }", "function getCalendarObjects($path, $node, $jsonData = null) {\n $start = null;\n $end = null;\n\n $filters = [\n 'name' => 'VCALENDAR',\n 'comp-filters' => [\n [\n 'name' => 'VEVENT',\n 'comp-filters' => [],\n 'prop-filters' => [],\n 'is-not-defined' => false,\n 'time-range' => [\n 'start' => $start,\n 'end' => $end,\n ],\n ],\n ],\n 'prop-filters' => [],\n 'is-not-defined' => false,\n 'time-range' => null,\n ];\n\n return [200, $this->getMultipleDAVItems($path, $node, $node->calendarQuery($filters), $start, $end)];\n }", "public function selectAll() {\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_texto_principal\";\n $stm = $conn->prepare($sql);\n $success = $stm->execute();\n if ($success) {\n //Criando uma lista com os dados\n $listTextoPrincipal = [];\n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $TextoPrincipal = new TextoPrincipal();\n $TextoPrincipal->setId($result['id_texto_principal']);\n $TextoPrincipal->setTitulo($result['titulo']);\n $TextoPrincipal->setTexto($result['texto']);\n $TextoPrincipal->setTipoTexto($result['tipo_texto']);\n array_push($listTextoPrincipal, $TextoPrincipal);\n };\n\n $this->conex -> closeDataBase();\n //retornando a lista\n return $listTextoPrincipal;\n } else {\n return \"Erro\";\n }\n }", "function ical() {\n \t$filter = ProjectUsers::getVisibleTypesFilter($this->logged_user, array(PROJECT_STATUS_ACTIVE), get_completable_project_object_types());\n if($filter) {\n $objects = ProjectObjects::find(array(\n \t\t 'conditions' => array($filter . ' AND completed_on IS NULL AND state >= ? AND visibility >= ?', STATE_VISIBLE, $this->logged_user->getVisibility()),\n \t\t 'order' => 'priority DESC',\n \t\t));\n\n \t\trender_icalendar(lang('Global Calendar'), $objects, true);\n \t\tdie();\n } elseif($this->request->get('subscribe')) {\n \tflash_error(lang('You are not able to download .ics file because you are not participating in any of the active projects at the moment'));\n \t$this->redirectTo('ical_subscribe');\n } else {\n \t$this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n }", "function dealCalendars($id){\n\t\tApp::import('model', 'Deal');\n\t\t$deal = new Deal();\n\t\t$thisDeal = $deal->findById($id);\n\t\t$deal_valid = $thisDeal['Deal']['deal_valid'];\n\t\t$deal_expire = $thisDeal['Deal']['deal_expire'];\n\t\t\n\t\tApp::import('model','DealPurchase');\n\t\t$dealPurchase = new DealPurchase();\n\t\t$datesFull = $dealPurchase->getDatesFull($id);\n\t\t\n\t\t/**\n\t\t* Calculate how many calendar months to display.\n\t\t*/ \n\t\t$firstDate = date_parse($deal_valid);\n\t\t$firstMonth = $firstDate['month'];\n\t\t$secondDate = date_parse($deal_expire);\n\t\t$secondMonth = $secondDate['month'];\n\t\t\n\t\t//In case the endmonth is in a different year than the start month\n\t\t$yearsDifference = $secondDate['year'] - $firstDate['year'];\n\t\t$secondMonth += $yearsDifference * 12;\n\t\t\n\t\t$interval = $secondMonth - $firstMonth;\n\t\t$calendar['months'] = $interval;\n\t\t\n\t\t$first_date = date_parse($deal_valid);\n\t\t$last_date = date_parse($deal_expire);\n\t\t/**\n\t\t* Create Calendar Objects\n\t\t*/\n\t\t$calendarObj = '<div class=\"calendar_wrap clearfix\"><div class=\"calendar_controls\"><a class=\"prev_cal\" href=\"#\"></a><a class=\"next_cal\" href=\"#\"></a></div><div class=\"calendar_slider clearfix\">';\n\t\tfor($i = 0; $i <= $calendar['months']; $i++){\n\t\t\t$calendarObj .= $this->renderMonth($first_date['month'],$first_date['year'], $deal_valid, $deal_expire, $datesFull);\n\t\t\tif($first_date['month'] == 12){\n\t\t\t\t$first_date['month'] = 1;\n\t\t\t\t$first_date['year']++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$first_date['month']++;\n\t\t\t}\t\n\t\t}\n\t\t$calendarObj .= '</div></div>';\n\t\treturn $this->output($calendarObj);\n\n\t}", "public function index()\n {\n $calendarios = $this->repository->latest('data')->get();\n\n return view('admin.pages.calendarios.index',\n [\n 'calendarios'=>$calendarios,\n 'convenios'=>Convenio::all()\n ]\n );\n }", "public function getGroupMembership($principal)\n\t{\n// $principal = $this->getPrincipalByPath($principal);\n// if (!$principal) throw new Sabre_DAV_Exception('Principal not found');\n//\n// $stmt = $this->pdo->prepare('SELECT principals.uri as uri FROM `'.$this->groupMembersTableName.'` AS groupmembers LEFT JOIN `'.$this->tableName.'` AS principals ON groupmembers.principal_id = principals.id WHERE groupmembers.member_id = ?');\n// $stmt->execute(array($principal['id']));\n//\n $result = array();\n// while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n// $result[] = $row['uri'];\n// }\n return $result;\n }", "public function calificaciones(){\n return $this->morphMany('App\\Models\\Calificacion','calificable');\n }", "private function build_calendar($annoMesDia){\n $mes = Carbon::createFromFormat('Y-m-d', $annoMesDia);\n $primerDiaCalendario = $mes->copy()->startOfMonth()->startOfWeek();\n $ultimoDiaCalendario = $mes->copy()->lastOfMonth()->endOfWeek();\n\n // construir las semanas\n $day = $primerDiaCalendario->copy();\n $weeks = [];\n $week = ['weekNumber'=>$day->weekOfYear, 'days'=>[]];\n while($day->between($primerDiaCalendario, $ultimoDiaCalendario)){\n // agregar DAY a la WEEK\n array_push($week['days'], [\n '_day' => $day->copy(),// Objecto para hacer operacione\n 'day' => $day->format('Y-m-d'),\n 'isWeekend' => $day->dayOfWeek==6 || $day->dayOfWeek==0,\n 'number' => $day->day,\n 'sameMonth' => $day->month==$mes->month\n ]);\n\n // si es domingo, pasar a la siguiente semana\n if($day->dayOfWeek==0){\n array_push($weeks, $week);\n $week = ['weekNumber'=>$day->weekOfYear, 'days'=>[]];\n }\n\n $day->addDay();\n }\n return (object)[\n 'firstDayOfCalendar' => $primerDiaCalendario->format('Y-m-d'),\n 'lastDayOfCalendar' => $ultimoDiaCalendario->format('Y-m-d'),\n 'weeks' => $weeks\n ];\n }", "public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }", "function get_periodo_calendario ($fecha, $anio_lectivo){\n $sql=\"(SELECT t_p.id_periodo, 'Cuatrimestre' as tipo_periodo \n FROM periodo t_p \n JOIN cuatrimestre t_c ON (t_p.id_periodo=t_c.id_periodo)\n WHERE (t_p.anio_lectivo=$anio_lectivo) AND \n ('$fecha' BETWEEN t_p.fecha_inicio AND t_p.fecha_fin)) \n \n UNION \n \n (SELECT t_p.id_periodo, 'Examen Final' as tipo_periodo\n FROM periodo t_p \n JOIN examen_final t_ef ON (t_p.id_periodo=t_ef.id_periodo)\n WHERE (t_p.anio_lectivo=$anio_lectivo) AND \n ('$fecha' BETWEEN t_p.fecha_inicio AND t_p.fecha_fin))\";\n \n return (toba::db('gestion_aulas')->consultar($sql));\n }", "public function obtenerFechasCertificaciones($limit=null){\n $sql = \"\n SELECT concat(year,'-',month,'-01') as date\n FROM \". TABLE_CERTIFICACION .\"\n WHERE uid_empresa = \". $this->getUID() .\"\n AND uid_agrupador IN (\n SELECT aa.uid_agrupador FROM \". TABLE_AGRUPAMIENTO .\"_agrupador aa\n INNER JOIN \". TABLE_AGRUPAMIENTO .\"_modulo USING(uid_agrupamiento)\n WHERE uid_modulo = \". util::getModuleId(\"certificacion\") .\"\n )\n AND year AND month\n GROUP BY year, month\n ORDER BY year DESC, month DESC\n \";\n\n if( is_numeric($limit) ){ $sql .= \" LIMIT $limit\"; }\n\n $dates = $this->db->query($sql, \"*\", 0);\n return $dates;\n }", "function findEventsByCalendar($events=array(),$calendar) {\n\t\t$output = array();\n\t\tif (!$events) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$x = 0;\n\t\t\tforeach ($events as $event) {\n\t\t\t\t$calendar_found = false;\n\t\t\t\tforeach ($event['Tag'] as $tag) {\n\t\t\t\t\tfor ($i=0; $i<count($tag['Calendar']); $i++) {\n\t\t\t\t\t\tif ($tag['Calendar'][$i]['shortname'] == $calendar) {\n\t\t\t\t\t\t\t$output[$x] = $event;\n\t\t\t\t\t\t\t$calendar_found = true;\n\t\t\t\t\t\t\t$x++;\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\tif ($calendar_found == true) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $output;\n\t\t}\n\t}", "private function fetchCalendarOwnerAddresses($calendarPath): array {\n $calendarNode = $this->server->tree->getNodeForPath($calendarPath);\n\n return $this->getAddressesForPrincipal($calendarNode->getOwner());\n }", "private function baseCalendarArray($date, $fday, $lday, $monthHolidays){\n $calendar = array();\n for($day = $fday; $day < $lday+1; $day++)\n {\n\n $calendar = $this->setDay($calendar, $day);\n $calendar = $this->setDayName($calendar, $day, $this->date, \"D\");\n\n if(!empty($event[$day]))\n $calendar = $this->setDayEvent($calendar, $day, $event[$day]);\n \n\n if($date->isWeekend())\n {\n $calendar = $this->setDayWeekend($calendar, $day, \"Weekend\");\n $calendar = $this->setDayColor($calendar, $day, 'purple');\n }\n else \n {\n $calendar = $this->setDayColor($calendar, $day, 'white');\n }\n\n if(!empty($monthHolidays[$day]))\n {\n $calendar = $this->setDayEvent($calendar, $day, $monthHolidays[$day]['event']);\n $calendar = $this->setDayColor($calendar, $day, 'pink');\n }\n \n $date->addDay();\n }\n\n return $calendar;\n }", "public function getJournalsInRange(Collection $accounts, Carbon $start, Carbon $end): Collection;" ]
[ "0.70131445", "0.6858883", "0.67017037", "0.66978055", "0.65352964", "0.6442766", "0.6253367", "0.61964846", "0.61364025", "0.6092897", "0.599893", "0.5983254", "0.586558", "0.58069414", "0.5733568", "0.5713105", "0.56808126", "0.56793064", "0.5621551", "0.56128055", "0.558512", "0.5569151", "0.55656576", "0.5533713", "0.5521904", "0.54982734", "0.54908824", "0.5475038", "0.54589635", "0.5458256", "0.5444796", "0.5441345", "0.54291075", "0.53888154", "0.5365217", "0.5335166", "0.53328025", "0.5311363", "0.53100467", "0.5287912", "0.5273598", "0.52726215", "0.5255963", "0.5230164", "0.52297974", "0.52239525", "0.51994324", "0.5197157", "0.51868844", "0.51775956", "0.5147911", "0.51319224", "0.5123", "0.51227534", "0.51208264", "0.5095617", "0.5083445", "0.50772184", "0.5070064", "0.5070015", "0.50615436", "0.5050211", "0.50414246", "0.5040936", "0.50311166", "0.50276434", "0.5025955", "0.5025833", "0.5020579", "0.5019528", "0.5017482", "0.5007587", "0.5005786", "0.49929735", "0.49900806", "0.4988874", "0.4987079", "0.49833086", "0.49826", "0.49733898", "0.49645492", "0.49502605", "0.4947513", "0.494086", "0.49398792", "0.4939636", "0.49300113", "0.49295595", "0.49290472", "0.49225882", "0.49149162", "0.49090588", "0.48974082", "0.4896005", "0.48931924", "0.48856005", "0.48855117", "0.48850852", "0.48842502", "0.4881129" ]
0.7077838
0
Creates a new calendar for a principal. If the creation was a success, an id must be returned that can be used to reference this calendar in other methods, such as updateCalendar
public function createCalendar($principalUri, $calendarUri, array $properties) { throw new Sabre\DAV\Exception\Forbidden(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createCalendar($principalUri, $calendarUri, array $properties) {}", "function createCalendar($principalUri, $calendarUri, array $properties) {\n\n return null;\n }", "public function store(CalendarsCreateRequest $request)\n {\n\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE);\n\n $calendar = $this->calendar->create($request->all());\n\n $response = [\n 'message' => 'Calendars created.',\n 'data' => $calendar->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()\n\t{\n\t\t// Set the title\n\t\t$this->template->title(lang('calendars:button:new_calendar'));\n\n\t\t// If this is a post, set the str_id\n\t\tif ($_POST)\n\t\t{\n\n\t\t\t// Set the str_id\n\t\t\t$_POST['str_id'] = rand_string(10);\n\n\t\t\t// Set default colors\n\t\t\tif ( empty($_POST['bg_color']) ) $_POST['bg_color'] = '3366cc';\n\t\t\tif ( empty($_POST['text_color']) ) $_POST['text_color'] = 'ffffff';\n\t\t\tif ( ! isset($_POST['sharing']) ) $_POST['sharing'] = NULL;\n\t\t}\n\n\t\t/* Start normal Streams_Core stuff\n\t\t----------------------------------------------------------------------------*/\n\n\t\t// Set some shit\n\t\t$extra = array(\n\t\t\t'return'\t\t\t=> 'admin/calendars',\n\t\t\t'success_message'\t=> lang('calendars:success:new_calendar'),\n\t\t\t'failure_message'\t=> lang('calendars:error:new_calendar'),\n\t\t\t'title'\t\t\t\t=> lang('calendars:button:new_calendar'),\n\t\t);\n\n\t\t// We will set these ourselves\n\t\t$skip = array('str_id');\n\n\t\t// Build it\n\t\t$this->streams->cp->entry_form('calendars', 'calendars', $mode = 'new', null, true, $extra, $skip, $this->_tabs);\n\t}", "public function create()\n {\n return view('backend.'.Auth::user()->role.'.event_calendar.create');\n }", "function addCalendar($calendar) {\n return $this->databaseInsertRecord(\n $this->tableCalendars,\n 'calendar_id',\n $calendar\n );\n }", "public function create()\n {\n if (Sentry::check()) {\n // Find active user and set default variables to null\n $user = Sentry::getUser();\n $groups = null;\n $schoolName = null;\n\n // Permission checks\n if ($user->hasAnyAccess(['school', 'event'])) {\n\n // If user is a superAdmin, show all possible groups to add an event to\n if ($user->hasAccess(['school'])) {\n $groups = Group::where('school_id', '<>', '')->get();\n $opening = '';\n } else {\n // If the user isn't a superAdmin, only show the groups to which the user has permissions\n $user->load('school.groups.appointments');\n $groups = $user->school->groups;\n $opening = $user->school->opening;\n }\n\n // Transform recieved objectList (from database) into array to send with view\n $smartgroup = [];\n foreach ($groups as $group) {\n $smartgroup[$group->id] = $group->name;\n }\n\n // Show the form where users can add appointments\n return View::make('calendar.create')->with('groups', $smartgroup)->with('opening', $opening);\n\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }", "public function create(Request $request)\n {\n $validator = Validator::make($request->all(), Calendar::$rules['create']);\n\n if ($validator->fails()){\n return response()->json($validator->messages(), 200);\n }\n\n $calendar = Calendar::create($request->all());\n\n return $this->responseHandler(['calendar' => $calendar], 201, 'Berhasil membuat kalender akademik baru');\n }", "public function createCalendar($principalUri, $calendarUri, array $properties)\n\t{\n\n\t\t$uid = dav_compat_principal2uid($principalUri);\n\n\t\t$r = q(\"SELECT * FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, $uid, dbesc($calendarUri));\n\t\tif (count($r) > 0) throw new Sabre_DAV_Exception_Conflict(\"A calendar with this URI already exists\");\n\n\t\t$keys = array(\"`namespace`\", \"`namespace_id`\", \"`ctag`\", \"`uri`\");\n\t\t$vals = array(CALDAV_NAMESPACE_PRIVATE, IntVal($uid), 1, \"'\" . dbesc($calendarUri) . \"'\");\n\n\t\t// Default value\n\t\t$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';\n\t\t$has_vevent = $has_vtodo = 1;\n\t\tif (isset($properties[$sccs])) {\n\t\t\tif (!($properties[$sccs] instanceof Sabre_CalDAV_Property_SupportedCalendarComponentSet)) {\n\t\t\t\tthrow new Sabre_DAV_Exception('The ' . $sccs . ' property must be of type: Sabre_CalDAV_Property_SupportedCalendarComponentSet');\n\t\t\t}\n\t\t\t$v = $properties[$sccs]->getValue();\n\t\t\t$has_vevent = $has_vtodo = 0;\n\t\t\tforeach ($v as $w) {\n\t\t\t\tif (mb_strtolower($w) == \"vevent\") $has_vevent = 1;\n\t\t\t\tif (mb_strtolower($w) == \"vtodo\") $has_vtodo = 1;\n\t\t\t}\n\t\t}\n\t\t$keys[] = \"`has_vevent`\";\n\t\t$keys[] = \"`has_vtodo`\";\n\t\t$vals[] = $has_vevent;\n\t\t$vals[] = $has_vtodo;\n\n\t\tforeach ($this->propertyMap as $xmlName=> $dbName) {\n\t\t\tif (isset($properties[$xmlName])) {\n\t\t\t\t$keys[] = \"`$dbName`\";\n\t\t\t\t$vals[] = \"'\" . dbesc($properties[$xmlName]) . \"'\";\n\t\t\t}\n\t\t}\n\n\t\t$sql = sprintf(\"INSERT INTO %s%scalendars (\" . implode(', ', $keys) . \") VALUES (\" . implode(', ', $vals) . \")\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX);\n\n\t\tq($sql);\n\n\t\t$x = q(\"SELECT id FROM %s%scalendars WHERE `namespace` = %d AND `namespace_id` = %d AND `uri` = '%s'\",\n\t\t\tCALDAV_SQL_DB, CALDAV_SQL_PREFIX, CALDAV_NAMESPACE_PRIVATE, $uid, $calendarUri\n\t\t);\n\t\treturn $x[0][\"id\"];\n\n\t}", "public function create(Request $request)\n {\n $fields = $request->validate([\n 'description' => 'required|string'\n ]);\n\n $calendar = Calendar::create([\n 'description' => $fields['description'],\n 'user_id' => auth()->user()->id\n ]);\n \n return $calendar;\n }", "public function store(Request $request)\n {\n \n $calendar = InternCalendar::create([\n 'description' => $request->description,\n 'start_date' => $request->start_date,\n 'end_date' => $request->end_date,\n 'uni_id' => $request->uni_id,\n 'faculty_id' => $request->faculty_id,\n \n ]); \n return $calendar;\n }", "public function create()\n {\n\t\t$lang = \\App::getLocale(session('lang'));\n\t\tif(Gate::allows('administradores', Auth::user())){\n\t\t\t$medicos = Medico::All();\n\t\t\t$pacientes = Paciente::All();\n \treturn view('clinica.citas.create-citas', compact('medicos','pacientes'));\n\t\t}else{\n\t\t\tif($lang == 'es'){\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Su cuenta de usuario no estรก autorizada para crear nuevas citas.');\t\n\t\t\t}else{\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Your account does not have permission to create new appointments.');\t\n\t\t\t}\n\t\t\treturn redirect('citas');\n\t\t}\n }", "public function create()\n {\n return view('Backend.Calendar.create');\n }", "public function create()\n {\n\n return view('webapp-layouts.calendar.create');\n }", "public function setPrimaryCalendar ($calendarId)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET primary_calendar = ? WHERE id = ?\");\n\t\t$Statement->execute(array($calendarId, $this->id));\n\t\t\n\t\treturn true;\n\t}", "function create(){\n\t\t\t//getting default circle\n\t\t\t$def_circle = $this->circle_model->get_Circle(\"cursos\");\n\t\t\t$id = new MongoID($def_circle['_id']);\n\t\t\t\n\t\t\t$document = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'acl' => array(\n\t\t\t\t//asignamos el circulo cursos por default\n\t\t\t\t0 => array('circle' => $id)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t$this->user_model->add_User($document);\n\t\t}", "public function store(EmployeeCalendarStoreRequest $request, Employee $employee)\n {\n $calendar = new EmployeeCalendar($request->validated());\n $employee->calendars()->save($calendar);\n return new EmployeeCalendarResource($calendar);\n }", "public function add(){\n\n $this->set('add', true);\n\n if($this->request->is('post')){\n $this->request->data['CalendarEntry']['user_id'] = $this->Auth->User('id');\n if($this->CalendarEntry->save($this->request->data)){\n $this->_setFlash('Calendar entry added', 'success');\n return $this->redirect('/calendar');\n }\n else {\n $this->_setFlash($this->CalendarEntry->validationErrorsAsString());\n }\n }\n\n $this->render('add-edit');\n }", "public function calCreated_Create($strControlId = null) {\n\t\t\t$this->calCreated = new QDateTimePicker($this->objParentObject, $strControlId);\n\t\t\t$this->calCreated->Name = QApplication::Translate('Created');\n\t\t\t$this->calCreated->DateTime = $this->objSeccion->Created;\n\t\t\t$this->calCreated->DateTimePickerType = QDateTimePickerType::DateTime;\n\t\t\t$this->calCreated->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->calCreated->LinkedNode = QQN::Seccion()->Created;\n\t\t\treturn $this->calCreated;\n\t\t}", "public function calCreated_Create($strControlId = null) {\n\t\t\t$this->calCreated = new QDateTimePicker($this->objParentObject, $strControlId);\n\t\t\t$this->calCreated->Name = QApplication::Translate('Created');\n\t\t\t$this->calCreated->DateTime = $this->objDocente->Created;\n\t\t\t$this->calCreated->DateTimePickerType = QDateTimePickerType::DateTime;\n\t\t\t$this->calCreated->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->calCreated->LinkedNode = QQN::Docente()->Created;\n\t\t\treturn $this->calCreated;\n\t\t}", "public function __construct($uid = 0, $principalId = 0)\n {\n $this->uid = intval($uid);\n $this->principalId = intval($principalId);\n\n parent::__construct();\n\n $this->Tbl['cal_event'] = $this->DB['db_pref'].'calendar_events';\n $this->Tbl['cal_task'] = $this->DB['db_pref'].'calendar_tasks';\n $this->Tbl['cal_holiday'] = $this->DB['db_pref'].'calendar_holidays';\n $this->Tbl['cal_group'] = $this->DB['db_pref'].'calendar_groups';\n $this->Tbl['cal_project'] = $this->DB['db_pref'].'calendar_projects';\n $this->Tbl['cal_attach'] = $this->DB['db_pref'].'calendar_event_attachments';\n $this->Tbl['cal_attendee'] = $this->DB['db_pref'].'calendar_event_attendees';\n $this->Tbl['cal_reminder'] = $this->DB['db_pref'].'calendar_event_reminders';\n $this->Tbl['cal_repetition'] = $this->DB['db_pref'].'calendar_event_repetitions';\n $this->Tbl['user'] = $this->DB['db_pref'].'user';\n $this->Tbl['user_foldersettings'] = $this->DB['db_pref'].'user_foldersettings';\n\n $this->DB['ServerVersionString'] = $this->serverinfo();\n $this->DB['ServerVersionNum'] = preg_replace('![^0-9\\.]!', '', $this->DB['ServerVersionString']);\n\n $this->query('SET SESSION sql_mode=\"ALLOW_INVALID_DATES\"');\n\n try {\n $dbSh = new DB_Controller_Share();\n $allShares = $dbSh->getFolderList($this->uid, 'calendar');\n $this->allShares = (!empty($allShares[$this->uid]['calendar'])) ? $allShares[$this->uid]['calendar'] : array();\n } catch (Exception $e) {\n $this->allShares = array();\n }\n }", "public function create()\n {\n $convenios = Convenio::all();\n return view('admin.pages.calendarios.create',['convenios'=>$convenios]);\n }", "public function actionCreatecal($start,$end,$resource)\n\t{\n\t\t$this->layout = '//layouts/iframe1';\n\t\t$model=new Roomclosure;\n\t\t$model->room_id=$resource;\n\t\t$model->start_date=$start;\n\t\t$model->end_date=$end;\n\t\t$model->cl_id = Pattern::generate(\"CLOSURE_CODE\");\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Roomclosure']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Roomclosure'];\n\t\t\t$model->room_id=$resource;\n\t\t\tif($start<=$end){\n\t\t\t\tif($model->validate()) {\n\t\t\t\t #$transaction mulai transaksi\n\t\t\t\t $transaction = Yii::app()->db->beginTransaction();\n\t\t\t\t try{\n\t\t\t\t\t\tPattern::increase('CLOSURE_CODE');\n\t\t\t\t $model->save();\n\t\t\t\t #jika tidak ada error transaksi proses di commit\n\t\t\t\t $transaction->commit();\n\t\t\t\t\t\t#response ke json\n\t\t\t\t\t\t$response = new Resultec();\n\t\t\t\t\t\t$response->result = 'OK';\n\t\t\t\t\t\t$response->message = 'Create successful';\n\n\t\t\t\t\t\tYii::app()->end();\n\t\t\t\t }\n\t\t\t\t catch(exception $e) {\n\t\t\t\t $transaction->rollback();\n\t\t\t\t throw new CHttpException(500, $e->getMessage());\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tYii::app()->user->setFlash('success', \"Created Failed\");\n\t\t\t}\n\t\t}\n\n\t\t$this->render('_formcal',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function calCreated_Create($strControlId = null) {\n\t\t\t$this->calCreated = new QDateTimePicker($this->objParentObject, $strControlId);\n\t\t\t$this->calCreated->Name = QApplication::Translate('Created');\n\t\t\t$this->calCreated->DateTime = $this->objListaCurso->Created;\n\t\t\t$this->calCreated->DateTimePickerType = QDateTimePickerType::DateTime;\n\t\t\t$this->calCreated->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->calCreated->LinkedNode = QQN::ListaCurso()->Created;\n\t\t\treturn $this->calCreated;\n\t\t}", "public function store($user_id, Request $request)\n {\n $calendar = $request->isMethod('put') ? Calendar::findOrFail($request->input('calendar_id')) : new Calendar;\n \n\n $calendar->mood = $request->input('mood');\n $calendar->user_id = $user_id;\n $calendar->calendar_date = $request->input('calendar_date');\n\n $calendar->save();\n\n return response()->json($calendar);\n }", "public function calendarioAction()\n {\n $idPaciente = $this->params()->fromRoute('id');\n $objectManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n $hydrator = new DoctrineObject(\n $objectManager,\n 'CsnUser\\Entity\\Agendas'\n );\n $agenda = new Agendas();\n $form = new AgendasForm($objectManager);\n if($this->request->isPost()){\n $form->setData($this->request->getPost());\n if($form->isValid()) {\n $data = $form->getData(FormInterface::VALUES_AS_ARRAY);\n $agenda = $hydrator->hydrate($data['agendas'],$agenda);\n $agenda->setUsuariox($objectManager->find('CsnUser\\Entity\\User', $this->identity()->getId()));\n $id = $this->request->getPost('id');\n if(!$id){\n $objectManager->persist($agenda);\n } else {\n $objectManager->find('CsnUser\\Entity\\Agendas',$id);\n $objectManager->persist($agenda);\n }\n $objectManager->flush();\n }\n } \n if($idPaciente){\n $paciente = $objectManager->find('CsnUser\\Entity\\Pacientes', $idPaciente);\n $data = array('form' => $form,'nombre' => $paciente->getNOMBRE(),'apPaterno' => $paciente->getAPELLIDO_PATERNO(),'apMaterno' => $paciente->getAPELLIDO_MATERNO(), 'idPaciente' => $idPaciente,'fecha_nac' => $paciente->getFECHA_NACIMIENTO()); \n } else {\n $data = array('form' => $form);\n }\n $queryrole = $this->getObjectManager()->createQuery(\"SELECT r.id as role FROM CsnUser\\Entity\\User u JOIN u.role r WHERE u.id = \".$this->identity()->getId());\n $role = $queryrole->getArrayResult();\n $query = $this->getObjectManager()->createQuery(\"SELECT u.id,u.firstName,u.lastName FROM CsnUser\\Entity\\User u WHERE u.role = 4\");\n $doctores = $query->getArrayResult();\n $data['doctores'] = $doctores; \n return new ViewModel($data);\n }", "public function create()\n {\n $validated = request()->validate([\n 'title' => 'required',\n 'day' => 'required|date',\n 'start_date' => 'required|date_format:H:i',\n 'end_date' => 'required|date_format:H:i',\n 'id_paciente' => 'required|integer',\n 'id_personal' => 'required|integer',\n ]);\n\n Agenda::create($validated);\n\n $paciente = Paciente::find($validated['id_paciente']);\n $colaborador = Personal::find($validated['id_personal']);\n\n \\Mail::to($paciente->correo)->send(new AgendaCreate($validated, $paciente, $colaborador));\n\n return redirect()->route('agenda.index')->with('success', 'Hora agendada correctamente');\n }", "public function create()\n {\n return view('mystudio.calendar.create', [\n 'forms' => MyStudio::where('type', 'form')->get(),\n 'dasboard_calendar' => Calendar::where('dashboard_enable', true)->exists(),\n ]);\n }", "public function setPrincipalId($val)\n {\n $this->_propDict[\"principalId\"] = $val;\n return $this;\n }", "public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;", "public function create()\n {\n //\n return view('calificaciones.create');\n }", "public function create()\n\t{\n\t\t// Returning result, so using $result instead of $this->res.\n\t\t$result = '';\n\n\t\t$this->postData();\n\n\t\t$this->getDB()->insert('customers',[\n\t\t\t\t'customer_name'=>$this->getCustomerName(),\n\t\t\t\t'customer_address1'=>$this->getCustomerAddress1(),\n\t\t\t\t'customer_address2'=>$this->getCustomerAddress2(),\n\t\t\t\t'customer_city'=>$this->getCustomerCity(),\n\t\t\t\t'customer_zipcode'=>$this->getCustomerZipcode(),\n\t\t\t\t'customer_state'=>$this->getCustomerState(),\n\t\t\t\t'customer_phone'=>$this->getCustomerPhone(),\n\t\t\t\t'customer_ext'=>$this->getCustomerExt(),\n\t\t\t\t'customer_fax'=>$this->getCustomerFax(),\n\t\t\t\t'customer_email'=>$this->getCustomerEmail(),\n\t\t\t\t'customer_rdp'=>$this->getCustomerRdp(),\n\t\t\t\t'customer_notes'=>$this->getCustomerNotes(),\n\t\t\t\t'flagged'=>$this->getFlag(),\n\t\t\t\t'flag_reason'=>$this->getFlagReason()]);\n\n\t\tif($this->getDB()->lastId() == null)\n\t\t{\n\t\t\techo 'There was an error inserting the event into the calendar!';\n\t\t} else {\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function crear(){\n\t\t\t\t\t\t\t\t$calidad = new calidad($_POST['data']);\n\t\t\t\t\t\t $calidadMapper = new calidadMapper();\n\t\t\t\t\t\t var_dump($calidadMapper->crearcalidad($calidad));\n\t\t\t\t\t\t\t}", "private function createCalendar($method)\n {\n // Create calender.\n $calendar = $this->ics->createCalendar(null, true);\n\n // Set request method.\n $calendar->setMethod(strtoupper($method));\n\n return $calendar;\n }", "public function create()\n {\n return view('calendar::calendar_events.create');\n }", "private function create(SincronizacaoEvent $sincronizacaoEvent)\n {\n $sync = $sincronizacaoEvent->getData();\n $tutorGrupo = $this->tutorGrupoRepository->find($sync->sym_table_id);\n $tutor = $this->tutorRepository->find($tutorGrupo->ttg_tut_id);\n $grupo = $this->grupoRepository->find($tutorGrupo->ttg_grp_id);\n\n $ambiente = $this->ambienteVirtualRepository->getAmbienteByTurma($grupo->grp_trm_id);\n\n if ($ambiente) {\n $pessoa = $this->pessoaRepository->find($tutor->tut_pes_id);\n\n $name = explode(\" \", $pessoa->pes_nome);\n $firstName = array_shift($name);\n $lastName = implode(\" \", $name);\n\n $data['tutor']['ttg_tipo_tutoria'] = $this->tutorGrupoRepository->getTipoTutoria($tutor->tut_id, $grupo->grp_id);\n $data['tutor']['grp_id'] = $grupo->grp_id;\n $data['tutor']['pes_id'] = $tutor->tut_pes_id;\n $data['tutor']['firstname'] = $firstName;\n $data['tutor']['lastname'] = $lastName;\n $data['tutor']['email'] = $pessoa->pes_email;\n $data['tutor']['username'] = $pessoa->pes_email;\n $data['tutor']['password'] = \"changeme\";\n $data['tutor']['city'] = \"São Luís\";\n\n $param['url'] = $ambiente->url;\n $param['token'] = $ambiente->token;\n $param['action'] = 'post';\n $param['functioname'] = 'local_integracao_enrol_tutor';\n $param['data'] = $data;\n\n $response = Moodle::send($param);\n $status = 3;\n\n if (array_key_exists('status', $response) && $response['status'] == 'success') {\n $status = 2;\n }\n\n event(new AtualizarSyncEvent($tutorGrupo, $status, $response['message']));\n return true;\n }\n\n return false;\n }", "private function create() {\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (!empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toCreat();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to create!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute insert.\n\t\t$this->objAccessCrud->setDateInsert(date(\"Y-m-d H:i:s\"));\n\t\t$id = $this->objAccessCrud->create ();\n\t\t// Check result.\n\t\tif ($id == 0) {\n \t\t\t$this->msg->setError ('There were issues on creating ther record!');\n\t\t\t\treturn;\n\t\t}\n\t\t// Save the id in the session to be used in the update.\n\t\t$_SESSION ['PK']['ACCESSCRUD'] = $id;\n\t\t\t\n\t\t$this->msg->setSuccess ( 'Created the record with success!' );\n\t\treturn;\n\t}", "public function crearReserva() {\n\n $id = $this->reserva->getLastId();\n $fecha = $_REQUEST[\"fecha\"];\n $instalacion = $_REQUEST[\"instalacion\"];\n $precio = $this->instalacion->getCampo($instalacion,'precioHora') * 1;\n $usuario = $_REQUEST[\"idUsuario\"];\n\n if ($this->reserva->add($id, $fecha, $precio, $instalacion, $usuario) > 0) {\n $this->vistaModificarReserva($id,$instalacion);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n }\n\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function setCalendarID($value)\n {\n return $this->set('CalendarID', $value);\n }", "public function createByAdmin(Request $request)\n {\n $admin_id = $request->input('selectAdmin');\n $admins = Admin::all()->pluck('name', 'id');\n $calendar_events = CalendarEvent::where('admin_id', $admin_id)->get()->sortby('start');\n $user_id = $request->filled('user_id') ? $request->input('user_id') : null;\n\n \\JavaScript::put(['admin_id' => $admin_id]);\n\n $calendar = $this->prepCalendar($calendar_events);\n\n return view('calendar_events.create', compact('calendar', 'admin_id', 'admins', 'user_id'));\n }", "function create_empresa($data) {\n\t\t$data['fecha_alta'] = date('Y-m-d H:i:s');\n\t\t//Audit field\n\t\t$data['user'] = $this->auth_frr->is_logged_in();\n\n\t\tif ($this -> db -> insert('empresas', $data)) {\n\t\t\t$empresa_id = $this -> db -> insert_id();\n\t\t\treturn array('empresa_id' => $empresa_id);\n\t\t}\n\t}", "public function create() {\n\n $model = new CursoModel();\n\n\n $data = (array) $this->request->getJson();\n\n\t\t$model->insert($data);\n\t\t\n\t\t$response = [\n 'status' => 201,\n 'error' => null,\n 'messages' => [\n 'success' => 'Curso criado com sucesso'\n ]\n\t ];\n\t \n return $this->respondCreated($response);\n\t\n\t}", "function createCalendarObject($calendarId, $objectUri, $calendarData)\n\t{\n\t\t$calendarData = icalendar_sanitize_string($calendarData);\n\n\t\t$extraData = $this->getDenormalizedData($calendarData);\n\n\t\tq(\"INSERT INTO %s%scalendarobjects (`calendar_id`, `uri`, `calendardata`, `lastmodified`, `componentType`, `firstOccurence`, `lastOccurence`, `etag`, `size`)\n\t\t\tVALUES (%d, '%s', '%s', NOW(), '%s', '%s', '%s', '%s', %d)\",\n\t\t\tCALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId), dbesc($objectUri), addslashes($calendarData), dbesc($extraData['componentType']),\n\t\t\tdbesc(wdcal_php2MySqlTime($extraData['firstOccurence'])), dbesc(wdcal_php2MySqlTime($extraData['lastOccurence'])), dbesc($extraData[\"etag\"]), IntVal($extraData[\"size\"])\n\t\t);\n\n\t\t$this->increaseCalendarCtag($calendarId);\n\t\trenderCalDavEntry_uri($objectUri);\n\n\t\treturn '\"' . $extraData['etag'] . '\"';\n\t}", "public function store(AgendaCreateRequest $request)\n {\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE);\n\n $agenda = $this->repository->create($request->all());\n\n $response = [\n 'message' => 'Agendamento criado com sucesso.',\n 'data' => $agenda->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 store(CalificacionRequest $request)\n\t{\n $id = 1; // \\Auth::user()->id;\n\n $calificacion = new Calificaciones;\n $calificacion->user_id = $id;\n $calificacion->proyecto_id = $request->get('proyecto_id');\n $calificacion->categoria_id = $request->get('categoria_id');\n $calificacion->calificacion = $request->get('calificacion');\n $calificacion->planteamiento = $request->get('planteamiento');\n $calificacion->ejecucion = $request->get('ejecucion');\n $calificacion->presentacion = $request->get('presentacion');\n $calificacion->save();\n\n return redirect('evaluaciones');\n\t}", "public function create()\n {\n Roleauth::check('project.resourceplanning.assignrole.create');\n\n $project = DB::table('project')\n ->where('company_id', Auth::user()->company_id)\n ->get();\n\n\n $project_id = array();\n foreach ($project as $projectid) {\n\n $project_id[$projectid->id] = $projectid->project_Id . ' ( ' . $projectid->project_desc . ' )';\n }\n\n $Role = DB::table('createrole')\n ->where('company_id', Auth::user()->company_id)\n ->get();\n\n $roles = array();\n foreach ($Role as $value) {\n $roles[$value->role_name] = $value->role_name;\n }\n\n\n $empname = DB::table('employee_records')\n ->where('company_id', Auth::user()->company_id)\n ->get();\n\n $resource_name = array();\n\n foreach ($empname as $emp) {\n\n $resource_name[$emp->employee_id] = $emp->employee_first_name . ' ' . $emp->employee_middle_name . ' ' . $emp->employee_last_name;\n }\n\n\n\n\n return view('admin.assignroletoperson.create', compact('resource_name', 'roles', 'project_id'));\n }", "public function create()\n {\n abort_if(Gate::denies('roleCreate'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n $this->resetInputFields();\n\n $this->createModal = true;\n }", "public function an_authenticated_user_may_created_his_own_schedules()\n {\n $this->withOutExceptionHandling()->signIn();\n $schedule = make('App\\Schedule');\n $schedule->clinic_profile = false;\n // dd($schedule);\n // $this->expectException(\\Exception::class);\n $response = $this->json('post','/schedule', $schedule->toArray());\n $response->assertStatus(200);\n // dd($response->getContent());\n }", "public function Create()\n\t\t{\n\t\t\t$this->ID = null;\n\t\t\t$this->Created = new DateTime();\n\t\t\t$this->CreatedBy = User::GetCurrentUser();\n\t\t\t$this->Modified = new DateTime();\n\t\t\t$this->ModifiedBy = User::GetCurrentUser();\n\t\t\t\n\t\t\t$type = strtolower($this->GetType());\n\t\t\t$values = $this->GetChangedValues();\n\t\t\t\n\t\t\t$id = DomainObjectAccess::Create($type, $values);\n\t\t\t$this->ID = $id;\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function createAction()\n {\n $entity = new Project();\n $request = $this->getRequest();\n $form = $this->createForm(new ProjectType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $securityContext = $this->get('security.context');\n $user = $securityContext->getToken()->getUser();\n $entity->setOwner($user);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n // creating the ACL\n $aclProvider = $this->get('security.acl.provider');\n $objectIdentity = ObjectIdentity::fromDomainObject($entity);\n $acl = $aclProvider->createAcl($objectIdentity);\n\n // retrieving the security identity of the currently logged-in user\n $securityIdentity = UserSecurityIdentity::fromAccount($user);\n\n // grant owner access\n $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);\n $aclProvider->updateAcl($acl);\n\n return $this->redirect($this->generateUrl('project_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('SitronnierSmBoxBundle:Project:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function getCalendarId()\n {\n return $this->get('CalendarId');\n }", "public function createUserAgendaAction()\n {\n $data = $this->getRequestData();\n if (isset($data['topic']) && isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/agenda/' . $user->getKey() . \"-agenda\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-agenda\");\n $folder->setParentId(51);\n $folder->save();\n }\n $agenda = new Object_Agenda();\n $agenda->setCreator($user);\n $agenda->setTopic($data['topic']);\n $agenda->setTitle($data['title']);\n $agenda->setNotes(isset($data['notes']) ? $data['notes'] : \"\");\n $agenda->setStart_time(isset($data['start_time']) ? $data['start_time'] : \"\");\n $agenda->setEnd_time(isset($data['end_time']) ? $data['end_time'] : \"\");\n $agenda->setWith_whom(isset($data['with_whom']) ? $data['with_whom'] : \"\");\n $agenda->setWith_people(isset($data['people']) ? Object_People::getById($data['people']) : \"\");\n $agenda->setLocation(isset($data['location']) ? $data['location'] : \"\");\n $agenda->setAlarm(isset($data['alarm']) ? $data['alarm'] : \"\");\n $agenda->setRepeat_days(isset($data['repeat_days']) ? $data['repeat_days'] : array());\n $agenda->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $agenda->setPublished(true);\n $agenda->setParentId($folder->getId());\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot save Agenda object');\n }\n } else {\n $this->setErrorResponse('topic and title is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "public function calDateCredited_Create($strControlId = null) {\n\t\t\t$this->calDateCredited = new QDateTimePicker($this->objParentObject, $strControlId);\n\t\t\t$this->calDateCredited->Name = QApplication::Translate('Date Credited');\n\t\t\t$this->calDateCredited->DateTime = $this->objStewardshipBatch->DateCredited;\n\t\t\t$this->calDateCredited->DateTimePickerType = QDateTimePickerType::Date;\n\t\t\t$this->calDateCredited->Required = true;\n\t\t\treturn $this->calDateCredited;\n\t\t}", "protected function create()\n {\n $this->preCreate();\n if ($this->owner_resource) {\n $api_owner = $this->owner_resource;\n $this->data = $this\n ->api\n ->$api_owner($this->owner_id)\n ->create($this->data)[static::$api_name];\n } else {\n $this->data = $this->api->create($this->data)[static::$api_name];\n }\n $this->id = $this->data['id'];\n $this->postCreate();\n\n return $this;\n }", "public function create()\n {\n if (! Gate::allows('time_project_create')) {\n return abort(401);\n } $enum_client_type = TimeProject::$enum_client_type;\n \n return view('admin.time_projects.create', compact('enum_client_type'));\n }", "public function createAuth($data)\n\t{\n\t\t$auth = $this->map($data);\n\t\t\n\t\t$auth->save();\n\n\t\treturn $auth;\n\t}", "public function store(CreateCasoRequest $request)\n {\n /* @var $caso Caso */\n $input = $request->all();\n\n if(Auth::user()->hasRole('CAPTADOR')){\n $input['captador'] = Auth::user()->empleado->id;\n $input['fecha_captacion'] = Carbon::now();;\n }\n\n $cliente = Interviniente::find($request->cliente_id);\n $cliente->isapre;\n $cliente->region;\n $cliente->comuna;\n $cliente->provincia;\n $input['cliente'] = $cliente;\n\n $contraparte = Interviniente::find($request->contraparte_id);\n $contraparte->isapre;\n $contraparte->region;\n $contraparte->comuna;\n $contraparte->provincia;\n $input['contraparte'] = $contraparte;\n\n $caso = $this->casoRepository->create($input);\n\n if(isset($caso->datosResponsable->user)){\n $caso->datosResponsable->user->notify(new ResponsableCasoAsignado($caso));\n }\n\n if(isset($caso->datosCaptador->user)){\n $caso->datosCaptador->user->notify(new CaptadorCasoAsignado($caso));\n }\n\n Flash::success('Caso guardado exitosamente.');\n\n return redirect(route('casos.index'));\n }", "public function create()\n {\n Gate::authorize('haveaccess');\n\n return inertia('Remission/Create');\n }", "function getCalendarObjectByUID($principalUri, $uid) {\n return null; // TODO\n }", "public function saveCalendar($appointment = null){\n $client = Yii::$app->calendarService;\n return $client->save(['sid'=>$this->sid,'appointment'=>$appointment]);\n }", "public function createCompany(CreatesCompanies $creator): Response|Redirector|RedirectResponse\n {\n $this->resetErrorBag();\n\n $creator->create(Auth::user(), $this->state);\n\n $name = $this->state['name'];\n\n $this->companyCreated($name);\n\n return $this->redirectPath($creator);\n }", "public function createAction()\n\t{\n\t\t$auth = new AuthenticationService();\n\t\tif($auth->hasIdentity()) {\n\t\t\t# if user has session take them some else\n\t\t\treturn $this->redirect()->toRoute('home');\n\t\t}\n\n\t $createForm = new CreateForm($this->adapter);\n\t $request = $this->getRequest();\n\n\t if($request->isPost()) {\n\t \t$formData = $request->getPost()->toArray();\n\t \t$createForm->setInputFilter($this->usersTable->getCreateFormFilter());\n\t \t$createForm->setData($formData);\n\n\t \tif($createForm->isValid()) {\n\t \t\ttry {\n\t \t\t\t$data = $createForm->getData();\n\t \t\t\t$this->usersTable->saveAccount($data); \n\n\t \t\t\t$this->flashMessenger()->addSuccessMessage('Compte créé avec succès. Vous pouvez maintenant vous connecter');\n\n\t \t\t\treturn $this->redirect()->toRoute('login');\n\t \t\t} catch(RuntimeException $exception) {\n\t \t\t\t$this->flashMessenger()->addErrorMessage($exception->getMessage());\n\t \t\t\treturn $this->redirect()->refresh(); # refresh this page to view errors\n\t \t\t}\n\t \t}\n\t }\n\t\t$this->layout()->setTemplate('login/index-layout');\n\t\treturn (new ViewModel(['form' => $createForm]))->setTemplate('auth/create');\n\t}", "public function create($data)\n {\n \n \t\n \t$data = ['url' => 'Employers','method'=>'POST','data'=>$data];\n \treturn $this->payRunObject->call($data);\n }", "public function store(Request $request)\n {\n $principal = new Principal();\n\n $principal->titulo = Request::input('titulo');\n $principal->texto = Request::input('from_one');\n $principal->save();\n\n return Response::json([\n 'Success' => [\n 'message' => 'Record Save Exits',\n 'status_code' => 200\n ]\n ], 200);\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public function create()\n {\n $u = Auth::user();\n $doc = Docente::where('identificacion', $u->identificacion)->first();\n $hoy = getdate();\n $a = $hoy[\"year\"] . \"-\" . $hoy[\"mon\"] . \"-\" . $hoy[\"mday\"];\n $per = Periodo::where([['fechainicio', '<=', $a], ['fechafin', '>=', $a]])->first();\n $grupos = Cargaacademica::where([['docente_id', $doc->id], ['periodo_id', $per->id]])->get();\n if ($grupos != null) {\n foreach ($grupos as $c) {\n $cargas[$c->id] = $c->asignatura->codigo . \"-\" . $c->asignatura->nombre . \" - \" . $c->grupo->nombre;\n }\n }\n return view('evaluacion.asistencia.create')\n ->with('location', 'evalcuacion')\n ->with('cargas', $cargas);\n }", "public function store(PlanoContaCreateRequest $request)\n {\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE);\n\n $planoContum = $this->repository->create($request->all());\n\n $response = [\n 'message' => 'PlanoConta created.',\n 'data' => $planoContum->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()\n {\n return view ('admin.calon.add');\n }", "public function create()\n {\n //\n return view('Organizer.create');\n }", "public function create(Request $request) \n {\n $this->validate($request, [\n 'payment_method' => ['required'],\n 'start_date' => ['required']\n ]);\n\n return dd('test');\n\n $deposit = new Deposit;\n $deposit->member_id = Auth::user()->id;\n $deposit->payment_method = $request->input('payment_method');\n $deposit->start_date = $request->input('start_date');\n \n\n $schedule = new Schedule;\n $schedule->deposit()->associate($deposit);\n $schedule->user_id = $schedule->deposit->member_id;\n\n // Convert the date into carbon\n $start = new Carbon($schedule->deposit->start_date);\n\n /**\n * Set the end date\n * For example: End date is Christmas this year\n * \n * null = THIS [year, month, etc..]\n */\n $end = Carbon::createFromDate(null, 12, 25);\n\n $schedule->start_date = $start;\n $schedule->end_date = $end;\n\n // Schedule type as Deposit Schedule [1], Loan Schedule [2]\n $schedule->sched_type = 1;\n $schedule->save();\n \n /**\n * Schedule should be saved first in order for\n * the deposit to get its ID\n */\n $deposit->sched_id = $schedule->id;\n $deposit->save();\n\n /* Users Table update setup column after the user setup his/her account: use for toggleable navbar */\n $setup = User::where('id', Auth::user()->id)->first();\n $setup->setup = 1;\n $setup->save();\n\n return redirect()->action('SchedulesController@index');\n }", "public function create($id_caso)\n{\n\t$id_caso = urldecode($id_caso);\n\n\n\t$datos['casos'] = $this->Casos->detalles($id_caso);\n\n\tif ($datos['casos'] == NULL || $datos['casos'] == '') \n\t{\n\t\tredirect('Inicio');\n\t}\n\n\t//Validar \n\t$datos['involucrados'] = $this->Involucrados->detallesCasos($id_caso);\n\tif (empty($datos['involucrados'])) \n\t{\n\t\t$this->session->set_flashdata('Alert','El caso no tiene involucrados para dar un fallo, debe de tener denunciante y contraventor.');\n\t\tredirect('Personas');\n\t}\n\n\t$datos['fallos'] = $this->Fallos->detalles($id_caso);\n\tif (empty($datos['fallos'])) \n\t{\n\t\t$contador_casos = 0;\n\t}\n\telse\n\t{\n\t\t$contador_casos = 1;\n\t}\n\n\tif ($datos['casos']->estado != 'ACTIVO') {\n\t\tredirect('Inicio');\n\t}\n\n\t$data = array(\n\t\t'id_caso' => $id_caso,\n\t\t'title' => 'Crear Fallo',\n\t\t'auth'=> $this->sesion,\n\t\t'alertas'=> $this->sesion,\n\t\t'old'=> $this->sesion,\n\t\t'contador_casos' => $contador_casos\n\t);\n\n\t// LLamado de la vista blade:\n\t$this->blade->view('pages/fallos/create', $data);\n}", "public function create()\n {\n //get data of the participants who can only be organizer\n $organizer= Participant::getOrganizers();\n\n //get only participants which are active\n $invitees = Participant::getActiveParticipants();\n\n //assign to particpants i.e invitees and organizers to the view\n return view('events.create')\n ->with('organizer', $organizer)\n ->with('invitees', $invitees);\n }", "public function createSchedule($data) {\n\t\t\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->nonPci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'ScheduleStartDate' => $data['scheduleStartDate'],\n\t\t\t\t'SchedulePeriodType' => $data['schedulePeriodType'],\n\t\t\t\t'DayOfWeek' => $data['dayOfWeek'],\n\t\t\t\t'DayOfMonth' => $data['dayOfMonth'],\n\t\t\t\t'FirstWeekOfMonth' => $data['firstWeekOfMonth'],\n\t\t\t\t'SecondWeekOfMonth' => $data['secondWeekOfMonth'],\n\t\t\t\t'ThirdWeekOfMonth' => $data['thirdWeekOfMonth'],\n\t\t\t\t'FourthWeekOfMonth' => $data['fourthWeekOfMonth'],\n\t\t\t\t'PaymentAmountInCents' => $data['paymentAmountInCents'],\n\t\t\t\t'LimitToNumberOfPayments' => $data['limitToNumberOfPayments'],\n\t\t\t\t'LimitToTotalAmountInCents' => $data['limitToTotalAmountInCents'],\n\t\t\t\t'KeepManualPayments' => $data['keepManualPayments'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->createSchedule($params);\n\t}", "public function createSchedule()\n\t{\t\t\n\t\t$validator = array('success' => false, 'messages' => array());\n\t\t$attendance = $this->model_schedule->createSchedule();\n\n\t\tif($attendance == true) {\n\t\t\t$validator['success'] = true;\n\t\t\t$validator['messages'] = 'Successfully Added';\n\t\t}\n\t\telse {\n\t\t\t$validator['success'] = false;\n\t\t\t$validator['messages'] = 'Error';\t\n\t\t}\n\n\t\techo json_encode($validator);\n\n\t}", "public function createAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $entity = new CalendarCategories();\n $id_cal = $this->getCalendarRoot();\n $rootcalendar = $em->getRepository('ApplicationCalendarBundle:CalendarRoot')->find($id_cal);\n if ($rootcalendar) {\n $entity->setRootcalendar($rootcalendar);\n }\n $form = $this->createCreateForm($entity);\n $form->bind($request);\n if ($form->isValid()) {\n $em->persist($entity);\n $em->flush();\n return $this->redirect($this->generateUrl('calendarcategories'));\n }\n return $this->render('ApplicationCalendarBundle:CalendarCategories:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(Requests\\StoreCalendarEvent $request)\n {\n $calendar_event = new CalendarEvent();\n // Validation in type-hinted form request\n $this->saveCalendarEvent($request, $calendar_event);\n\n return redirect()->route('calendar_events.index')->with('success', 'Item created successfully.');\n }", "public function store(Request $request)\n {\n// soc_card\n\n if ($request->user_id==auth()->id()):\n\n $date = $request->date;\n $res = explode(\"/\", $date);\n $changedDate = $res[2].\"-\".$res[0].\"-\".$res[1];\n\n\n\n $patients=Patient::where('soc_card',$request->soc)->first();\n\n if ($request->id == null):\n CalendarModel::create([\n 'name'=>$request->name,\n 'patient_id'=>$patients->id??null,\n 'soc'=>$request->soc,\n 'comments'=>$request->description,\n 'start'=>$changedDate.' '.$request->start,\n 'end'=>$request->end,\n 'user_id'=>$request->user_id,\n 'status'=>'active'\n ]);\n else:\n $cal=CalendarModel::find($request->id)->update([\n 'name'=>$request->name,\n 'patient_id'=>$patients->id??null,\n 'soc'=>$request->soc,\n 'comments'=>$request->description,\n 'start'=>$changedDate.' '.$request->start,\n 'end'=>$request->end,\n 'user_id'=>$request->user_id,\n 'status'=>'active'\n ]);\n\n\n endif;\nendif;\n\n return back();\n }", "function create() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Dummy empty annonce\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->competences = $this->extendedProfile->competences;\n\t\t$this->annonce->begin = date(DATE_FORMAT);\n\t\t$this->renderView(\"createAnnonce\");\n\t\t\n\t}", "public function createAdvent($data, $user)\n {\n DB::beginTransaction();\n\n try {\n if(!$data['start_at']) throw new \\Exception ('A start time is required.');\n if(!$data['end_at']) throw new \\Exception ('An end time is required.');\n\n $advent = AdventCalendar::create(Arr::only($data, ['name', 'display_name', 'summary', 'start_at', 'end_at']));\n\n return $this->commitReturn($advent);\n } catch(\\Exception $e) {\n $this->setError('error', $e->getMessage());\n }\n return $this->rollbackReturn(false);\n }", "public function setPrincipal($val)\n {\n $this->_propDict[\"principal\"] = $val;\n return $this;\n }", "public function store(CreateCaixaRequest $request)\n {\n PermissionController::temPermissao('relatorios.update');\n $input = $request->all();\n\n $caixa = $this->caixaRepository->create($input);\n\n Flash::success('Caixa do Dia criado com sucesso.');\n\n return redirect(route('caixas.index'));\n }", "public function getCalendarId()\r\n {\r\n if (!$this->getData('calendar_id') && $this->_calendar instanceof Mymodules_Google_Model_Calendar) {\r\n return $this->getCalendar()->getId();\r\n }\r\n\r\n return $this->getData('calendar_id');\r\n }", "public function become_creator(Request $request) {\n\n $user = User::find($request->id);\n\n if ($user) {\n\n // Check the user registered as content creator /viewer\n\n if ($user->is_content_creator == CREATOR_STATUS) {\n\n $response_array = ['success'=>false, 'error_messages'=>tr('registered_as_content_creator')];\n\n } else {\n\n $user->is_content_creator = CREATOR_STATUS;\n\n $user->save();\n\n $response_array = ['success'=>true, 'message'=>tr('become_creator')]; \n\n } \n\n } else {\n\n $response_array = ['success'=>false, 'error_messages'=>tr('user_not_found')];\n\n }\n\n return response()->json($response_array);\n\n }", "public function crear() {\n\t\t$this->load->model('pais_model');\n\t\t$datos['body']['paises'] = $this->pais_model-> getAll($filtro=\"\");\n\t\t\n\t\tenmarcar($this, 'autor/crear', $datos);\n\t}", "public function store(PersonaCreacion $request)\n {\n // dd($request->numero_identificacion);\n \n Persona::crear($request);\n\n session()->flash('message', '¡Persona Creada! :D');\n return redirect(route('personas.create'));\n }", "public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }", "public function create()\n {\n return view (\"runner.personas.create\");\n }", "public function asignarRol(AutorizadorRolUsuariosRequest $request)\n {\n $rol = AutorizadorRolUsuario::create($request->all());\n return response()->json(['id' => $rol->id]);\n }", "public function create()\n {\n if (!CRUDBooster::isCreate()) {\n CRUDBooster::insertLog(trans('crudbooster.log_try_add', ['module'=>CRUDBooster::getCurrentModule()->name ]));\n CRUDBooster::redirect(CRUDBooster::adminPath(), trans(\"crudbooster.denied_access\"));\n }\n\n $max_id = $this->somProjectsAirportRepository->getLastInsertedId();\n $data = array();\n $data['id'] = $max_id+1;\n\n $data['countries'] = array();\n $somCountries = $this->somCountryRepository->all();\n $cnt = 0;\n $selected_country_id = 0;\n foreach ($somCountries as $somCountry) {\n $data['countries'][$somCountry->id] = $somCountry->country;\n if($cnt == 0){\n $selected_country_id = $somCountry->id;\n }\n $cnt++;\n } \n\n $data['airport_types'] = array();\n $airport_types = $this->somProjectsAirportTypeRepository->all();\n foreach ($airport_types as $airport_type) {\n $data['airport_types'][$airport_type->id] = $airport_type->name;\n }\n\n $data['selected_country'] = $selected_country_id;\n $data['selected_airport'] = 0;\n\n return view('som_projects_airports.create')\n ->with('data', $data);\n }", "public function create()\n\t{\n $ids_proyectos = Proyecto::where('created_at', '>=', Carbon::now()->subMonths(2))->orderBy('proyecto')->pluck('proyecto', 'id');\n $ids_categorias = Categoria::pluck('categoria', 'id');\n\t\treturn view('calificaciones.create', compact('ids_proyectos', 'ids_categorias'));\n\t}", "public function create()\n {\n\t\tif(Auth::user()->rol->permisos->contains(1))\n\t\t{\t\n\t\t\t$prmRol = Rol::All();\n\t\t\treturn view('admin.usuario.create',compact('prmRol'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn abort(401);\n\t\t}\n }", "public function create()\n {\n if (Auth::user()->rol_id != 3) \n return redirect('/asesor');\n\n return view('asesor/clasificacion.create');\n }" ]
[ "0.68141156", "0.62563926", "0.59141725", "0.57392716", "0.57192284", "0.5677594", "0.5596635", "0.55510163", "0.5514354", "0.5511221", "0.5468638", "0.5368757", "0.5279807", "0.5246921", "0.5185661", "0.5161506", "0.5149656", "0.51376957", "0.50723654", "0.5056522", "0.5033308", "0.50173813", "0.49807492", "0.49763837", "0.49757102", "0.49633476", "0.49550986", "0.49513474", "0.49383092", "0.4928525", "0.4926877", "0.49127302", "0.49104378", "0.49055526", "0.49053285", "0.48992997", "0.4893332", "0.48877236", "0.48770505", "0.48770505", "0.4875832", "0.48753726", "0.48752195", "0.48752195", "0.48752195", "0.48752195", "0.48750475", "0.48703298", "0.48603263", "0.48600143", "0.48575646", "0.48573717", "0.48522845", "0.48509258", "0.48501673", "0.4828782", "0.48203704", "0.48199075", "0.48117352", "0.48085165", "0.47950032", "0.47826406", "0.47781467", "0.4773403", "0.4754551", "0.47442567", "0.47404537", "0.47349977", "0.47324273", "0.47320065", "0.47212648", "0.4718784", "0.47174904", "0.47172415", "0.4716709", "0.47137535", "0.46960586", "0.46887943", "0.46808955", "0.4679775", "0.46650192", "0.4657528", "0.46551234", "0.46544045", "0.46484563", "0.46478578", "0.46463335", "0.46435276", "0.46405804", "0.46360612", "0.46316642", "0.463109", "0.46283907", "0.46237403", "0.46234742", "0.462011", "0.46133938", "0.46124357", "0.46111113", "0.46100032" ]
0.5710865
5
Delete a calendar and all it's objects
public function deleteCalendar($calendarId) { throw new Sabre\DAV\Exception\Forbidden(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Calendar $calendar)\n {\n //\n }", "public function delete($calendario);", "public static function deleteByCalendar($a_cal_id)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\t\t\r\n\t\t$query = \"DELETE FROM cal_shared WHERE cal_id = \".$ilDB->quote($a_cal_id ,'integer').\" \";\r\n\t\t$res = $ilDB->manipulate($query);\r\n\t\treturn true;\r\n\t}", "public function destroy(InternCalendar $internCalendar)\n {\n //\n }", "function deleteCalendarObject($calendarId, $objectUri) {\n\n }", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "function delete_get_calendar_cache()\n {\n }", "public function destroy($id)\n {\n // $calendar = Calendar::where('id', $id)->where('user_id', auth()->id())->get();\n // if ($calendar->isEmpty()) return response('Calendar not exist', 403);\n Calendar::destroy($id);\n return response('ok', 201);\n }", "public function destroy($id)\n\t{\n\t\t$calendar = Calendar::find($id);\n $calendar->delete();\n // redirect\n Session::flash('message', 'Successfully deleted!');\n return redirect('home');\n\t}", "public function deleteCalendar($calendarId)\n\t{\n\t\tq(\"DELETE FROM %s%scalendarobjects WHERE `calendar_id` = %d\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId));\n\t\tq(\"DELETE FROM %s%scalendars WHERE `id` = %d\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId));\n\n\t}", "public function delete($calendar)\n {\n throw new BadMethodCallException('Not supported');\n }", "public function destroyAllInvalid()\n {\n Wcalendar::where('id_category', '-1')->delete();\n return response()->json();\n }", "public function destroy($id)\n {\n //\n $evento = Calendario::find($id)->delete();\n return response()->json($evento);\n }", "public function testUserCannotDeleteCalendars()\n {\n $userOne = User::factory()->withPersonalTeam()->create();\n $userOne->assignRole(Role::findByName('user'));\n $userOne->assignRole(Role::findByName('team-admin'));\n $teams = $userOne->ownedTeams;\n\n $property = Property::factory()->create([\n 'team_id' => $teams->first()->getKey(),\n 'is_private' => true\n ]);\n $calendar = Calendar::factory()->create(['property_id' => $property->getKey()]);\n $slot = Slot::factory()->create(['calendar_id' => $calendar->getKey()]);\n\n // Create a normal user to try update a property\n $userTwo = User::factory()->withPersonalTeam()->create();\n $userTwo->assignRole(Role::findByName('user'));\n\n $response = $this->actingAs($userTwo)->delete('/calendars/' . $calendar->getKey(). '/slots/' . $slot->getKey());\n $response->assertStatus(403);\n $this->assertDatabaseHas('slots', ['id' => $slot->getKey(), 'deleted_at' => null]);\n }", "function index_delete() {\n $calon = $this->delete('id_calon');\n $this->db->where('id_calon', $calon);\n $delete = $this->db->delete('calon');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete()\n {\n if (empty($this->id)) {\n return false;\n }\n\n $db = $this->getDB();\n $db->addWhere('id', $this->id);\n\n $result = $db->delete();\n\n if (!PHPWS_Error::isError($result)) {\n $db2 = new PHPWS_DB('phpws_key');\n $db2->addWhere('module', 'calendar');\n $db2->addWhere('item_name', 'event' . $this->id);\n PHPWS_Error::logIfError($db2->delete());\n return PHPWS_DB::dropTable($this->getEventTable());\n } else {\n if (PHPWS_Settings::get('calendar', 'public_schedule') == $this->id) {\n PHPWS_Settings::set('calendar', 'public_schedule', 0);\n PHPWS_Settings::save('calendar');\n }\n return $result;\n }\n }", "public function destroy(Request $request, $id = null)\n {\n $calendar = Calendar::find($id);\n\n if (!$calendar) {\n return $this->responseHandler(null, 404, 'Tidak ada kalender akademik dengan id:' . $id);\n }\n\n $calendar->delete();\n\n return $this->responseHandler(['id' => $id], 200, 'Berhasil menghapus kalender akademik');\n }", "function deleteCalendarObject($calendarId, $objectUri)\n\t{\n\t\t$r = q(\"SELECT `id` FROM %s%scalendarobjects WHERE `calendar_id` = %d AND `uri` = '%s'\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId), dbesc($objectUri));\n\t\tif (count($r) == 0) throw new Sabre_DAV_Exception_NotFound();\n\n\t\tq(\"DELETE FROM %s%scalendarobjects WHERE `calendar_id` = %d AND `uri` = '%s'\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId), dbesc($objectUri));\n\n\t\t$this->increaseCalendarCtag($calendarId);\n\t\trenderCalDavEntry_calobj_id($r[0][\"id\"]);\n\t}", "public static function delete_all_events($user_id = NULL) {\r\n global $uid;\r\n $resp = Database::get()->query(\"DELETE FROM personal_calendar WHERE user_id = ?\", $uid);\r\n if ($resp) {\r\n Log::record(0, MODULE_ID_PERSONALCALENDAR, LOG_DELETE, array('user_id' => $uid, 'id' => 'all'));\r\n return array('success' => true, 'message' => '');\r\n } else {\r\n return array('success' => false, 'message' => 'Database error');\r\n }\r\n }", "function deleteCalendar($calendarId) {\n if (!is_int($calendarId)) {\n return FALSE;\n }\n\n // load events from this calendar\n $events = $this->loadEventsByCalendar($calendarId);\n\n if (!$events) {\n return FALSE;\n }\n\n // extract event-ids\n $ids = array();\n foreach ($events as $event) {\n $ids[] = $event['event_id'];\n }\n\n // delete events\n if (count($ids) > 0) {\n // delete recurrence information for months\n $this->databaseDeleteRecord(\n $this->tableRecurrenceMonths,\n 'event_id',\n $ids\n );\n // delete reucrrence information for weekdays\n $this->databaseDeleteRecord(\n $this->tableRecurrenceWeekdays,\n 'event_id',\n $ids\n );\n // delete events\n $this->databaseDeleteRecord(\n $this->tableEvents,\n 'calendar_id',\n $calendarId\n );\n }\n\n // finally, delete the calendar itself\n return $this->databaseDeleteRecord(\n $this->tableCalendars,\n 'calendar_id',\n $calendarId\n );\n }", "public function destroy(EmployeeCalendarDestroyRequest $request, Employee $employee, EmployeeCalendar $calendar)\n {\n $calendar->delete();\n return [\"message\" => \"deleted\"];\n }", "public function destroy($id)\n { $calendario = $this->repository->find($id);\n if (!count($calendario->agendas ) == 0) {\n return redirect()\n ->back()\n ->with('info', 'Existem Agendamento nesta Data');\n }\n $calendario->delete();\n return redirect()->route('calendarios.index');\n }", "public function destroy($id)\n {\n $deleted = $this->calendar->delete($id);\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'Calendars deleted.',\n 'deleted' => $deleted,\n ]);\n }\n\n return redirect()->back()->with('message', 'Calendars deleted.');\n }", "public function destroy($id)\n\t{\n $event = CalendarEvent::find($id);\n if(!$event) {\n Session::flash('errorMessage', \"Event with id of $id is not found\");\n App::abort(404);\n }\n $event->delete();\n return Redirect::action('EventsController@index');\n\n\t}", "public static function delete_all_calendar_events($mumie) {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/calendar/lib.php');\n $records = $DB->get_records(\n \"event\",\n array(\n \"modulename\" => \"mumie\",\n \"instance\" => $mumie->id\n )\n );\n\n foreach ($records as $record) {\n $event = \\calendar_event::load($record->id);\n $event->delete();\n }\n }", "public function delete()\n {\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('PostCalendar::', '::', ACCESS_ADD), LogUtil::getErrorMsgPermission());\n\n $eid = FormUtil::getPassedValue('eid'); // seems like this should be handled by the eventHandler\n $render = FormUtil::newForm('PostCalendar', $this);\n\n // get the event from the DB\n $event = DBUtil::selectObjectByID('postcalendar_events', $eid, 'eid');\n $event = ModUtil::apiFunc('PostCalendar', 'event', 'formateventarrayfordisplay', $event);\n\n $render->assign('loaded_event', $event);\n return $render->execute('event/deleteeventconfirm.tpl', new PostCalendar_Form_Handler_EditHandler());\n }", "public function deleteAction(Request $request, CalendarEvent $event)\n {\n\n $em = $this->getDoctrine()->getManager();\n $em->remove($event);\n $em->flush();\n\n return $this->redirectToRoute('ma_lrm_event_index');\n }", "function attendance_delete_calendar_events($sessionsids) {\n global $DB;\n $caleventsids = attendance_existing_calendar_events_ids($sessionsids);\n if ($caleventsids) {\n $DB->delete_records_list('event', 'id', $caleventsids);\n }\n\n $sessions = $DB->get_recordset_list('attendance_sessions', 'id', $sessionsids);\n foreach ($sessions as $session) {\n $session->caleventid = 0;\n $DB->update_record('attendance_sessions', $session);\n }\n}", "public function destroy(Agenda $agenda)\n {\n //\n }", "function vitero_delete_instance($id) {\n global $DB;\n\n if (!$vitero = $DB->get_record('vitero', array('id' => $id))) {\n return false;\n }\n\n // Update calendar event.\n $param = array('courseid' => $vitero->course, 'instance' => $vitero->id,\n 'groupid' => 0, 'modulename' => 'vitero');\n $eventid = $DB->get_field('event', 'id', $param);\n\n if (!empty($eventid)) {\n $event = calendar_event::load($eventid);\n $event->delete();\n }\n\n $DB->delete_records('vitero', array('id' => $vitero->id));\n\n // Delete meeting, if no other activity links to this.\n $allmeetings = $DB->count_records('vitero', array('meetingid' => $vitero->meetingid));\n\n if (!$allmeetings) {\n if (!vitero_delete_meeting($vitero)) {\n return false;\n }\n // Delete team.\n vitero_delete_team($vitero->teamid);\n }\n return true;\n}", "public function destroy()\n {\n if (request()->ajax()) {\n if (request()->has('id'))\n {\n foreach (request('id') as $id) {\n HolidayDay::destroy($id);\n }\n }\n }\n return response(['status'=>true]);\n }", "function delete()\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\r\n\t\t// Delete current item\r\n\t\t$sql = \"delete from tbl_Pistol_CompetitionDay\r\n\t\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r(\"SQL: \" . $sql);\r\n\t\t\t\r\n\t\tmysqli_query($dbh,$sql);\r\n\t\tif (mysqli_errno($dbh)!=0) {\r\n\t\t\tprint_r(mysqli_error($dbh));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->clear(); // Clear current object\r\n\r\n\t}", "public function delete(LessonSchedule $schedule);", "public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }", "public function destroy($id)\n {\n $event = EventCalendar::find($id);\n $event->delete();\n flash(translate('event_has_been_deleted_successfully'))->success();\n \n \n return redirect()->back();\n }", "public function testDeleteSchedule() {\n\t\t$numRows = $this->getConnection()->getRowCount(\"schedule\");\n\n\t\t$schedule = new Schedule(null, $this->company->getCompanyId(), $this->VALID_SCHEDULEDAYOFWEEK1, $this->VALID_SCHEDULEENDTIME1, $this->VALID_SCHEDULELOCATIONADDRESS1, $this->VALID_SCHEDULELOCATIONNAME1, $this->VALID_SCHEDULESTARTTIME1);\n\n\t\t$schedule->insert($this->getPDO());\n\n\t\t//make sure it was inserted\n\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"schedule\"));\n\n\t\t//DELETE!!!!!!!!! a.k.a Tallcot it!!!!!!\n\n\t\t$schedule->delete($this->getPDO());\n\n\t\t//make sure there in no longer any data\n\n\t\t$pdoSchedule = Schedule::getScheduleByScheduleId($this->getPDO(), $schedule->getScheduleId());\n\t\t$this->assertNull($pdoSchedule);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"schedule\"));\n\n\t}", "public function getCalendarObjects($calendarId) {\n\t\t\\GO::debug(\"c:getCalendarObjects($calendarId)\");\n\t\t\n\t\t//weird bug?\n\t\tif(!\\GO::user()) {\n\t\t\tthrow new Sabre\\DAV\\Exception\\NotAuthenticated();\n\t\t}\n\n\t\t//Get the calendar object and check if the user has delete permission.\n\t\t$calendar = \\GO\\Calendar\\Model\\Calendar::model()->findByPk($calendarId, false, true);\n//\t\tif(!$calendar->checkPermissionLevel(\\GO\\Base\\Model\\Acl::DELETE_PERMISSION))\n//\t\t\tthrow new Sabre\\DAV\\Exception\\Forbidden();\n\t\t\n\t\t\\GO::config()->caldav_max_months_old=isset(\\GO::config()->caldav_max_months_old) ? \\GO::config()->caldav_max_months_old : 6;\n\t\t\\GO::config()->caldav_max_months_old=\\GO::config()->caldav_max_months_old*-1;\n\n\n\t\t$objects = array();\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addCondition('exception_for_event_id', 0)\n\t\t\t->addCondition('calendar_id', $calendarId);\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t->ignoreAcl()\n\t\t\t->criteria($whereCriteria);\n\t\t\n\t\t$stmt = \\GO\\Calendar\\Model\\Event::model()->findForPeriod(\n\t\t\t$findParams, \n\t\t\t\\GO\\Base\\Util\\Date::date_add(time(), 0, GO::config()->caldav_max_months_old),\n\t\t\t\\GO\\Base\\Util\\Date::date_add(time(),0,0,3)\n\t\t); //Outlook crashes on dates far in the future.\n\t\t\n\t\t\\GO::debug(\"Found \".$stmt->rowCount().\" events\");\n\t\t\n\t\twhile ($event = $stmt->fetch()) {\n\t\t\t\n\t\t\t\n\t\t\t// Check if all occurences of this rrule are removed with an exception.\n\t\t\t// If so, then continue to the next event. (Sabredav cannot handle rrules where all possible dates are removed by exceptions)\n\t\t\tif(!empty($event->rrule)) {\n\t\t\t\ttry{\n\t\t\t\t\t$vobject = $event->toVObject();\n\t\t\t\t\t$it = new \\Sabre\\VObject\\Recur\\EventIterator($vobject);\n\t\t\t\t}catch(\\Exception $e) {\n\t\t\t\t\t\\GO::debug(\"Invalid rrule event ID: \".$event->id.' : '.$event->rrule.' '.$e->getMessage());\n\t\t\t\t\t\\GO::debug(\"All possible RRULE dates are removed by an RRULE Exception event so there is no event to display\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$calendar_user_id = $event->calendar->user_id;\n\t\t\t$user_id = \\GO::user()->id;\n\t\t\t\n\t\t\tif(!$event->private || $calendar_user_id == $user_id){\n\t\t\t\n\t\t\t\t$davEvent = DavEvent::model()->findByPk($event->id);\n\t\t\t\tif(!$davEvent || $davEvent->mtime != $event->mtime){\t\t\t\t\n\t\t\t\t\t$davEvent = CaldavModule::saveEvent($event, $davEvent);\n\t\t\t\t}\n\n\t\t\t\t$objects[] = array(\n\t\t\t\t\t'id' => $event->id,\n\t\t\t\t\t'uri' => $davEvent->uri,\n\t\t\t\t\t'calendardata' => $davEvent->data,\n\t\t\t\t\t'calendarid' => 'c:'.$calendarId,\n\t\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif($calendar->tasklist_id>0)\n\t\t{\n\t\t\t\n\t\t\t$tasklist = \\GO\\Tasks\\Model\\Tasklist::model()->findByPk($calendar->tasklist_id, false, true);\n\t\t\t\n\t\t\tif($tasklist && $tasklist->getPermissionLevel() > 0) {\n\n\t\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t\t->addCondition('tasklist_id', $calendar->tasklist_id)\n\t\t\t\t\t->mergeWith(FindCriteria::newInstance()\n\t\t\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t\t\t->addCondition('completion_time', 0)\n\t\t\t\t\t\t->addCondition('due_time', \\GO\\Base\\Util\\Date::date_add(time(), 0, \\GO::config()->caldav_max_months_old),'>','t',false));\n\n\t\t\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()\n\t\t\t\t\t->select('t.*')\n\t\t\t\t\t->ignoreAcl()\n\t\t\t\t\t->criteria($whereCriteria);\n\n\t\t\t\t$stmt = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\t\t\\GO::debug(\"Found \".$stmt->rowCount().\" tasks\");\n\n\n\t//\t\t\t$sql = \"SELECT * FROM ta_tasks WHERE tasklist_id=? AND (completion_time=0 OR due_time>?)\";\n\t//\t\t\t$count = $this->tasks->query($sql, 'ii', array($calendar['tasklist_id'], Date::date_add(time(),0,\\GO::config()->caldav_max_months_old)));\n\n\t\t\t\twhile ($task = $stmt->fetch()) {\t\t\t\n\t\t\t\t\t$davTask = DavTask::model()->findByPk($task->id);\n\n\t\t\t\t\tif(!$davTask || $davTask->mtime != $task->mtime){\t\t\t\t\n\t\t\t\t\t\t$davTask = CaldavModule::saveTask($task, $davTask);\n\t\t\t\t\t}\n\n\t\t\t\t\t$objects[] = array(\n\t\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t\t'uri' => $davTask->uri,\n\t\t\t\t\t\t'calendardata' => $davTask->data,\n\t\t\t\t\t\t'calendarid' => 'c:'.$calendarId,\n\t\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\\GO::debug($objects);\n\n\t\treturn $objects;\n\t}", "public function destroy($id)\n {\n if (Sentry::check()) {\n // Find active user\n $user = Sentry::getUser();\n $event = Appointment::find($id);\n\n // Check if User belongs to group/school which the appointment is from\n if ($user->hasAccess('school') || ($user->hasAccess('event') && $user->school_id == $event->group->school_id)) {\n $event->delete();\n }\n\n return Redirect::route('calendar.index');\n } else {\n return Redirect::route('landing');\n }\n }", "public static function deleteAppointments($a_obj_id)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarEntry.php');\n\t\t\n\t\tforeach(ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id)\n\t\t{\n\t\t\tilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);\n\t\t\tilCalendarEntry::_delete($app_id);\n\t\t}\n\t}", "function delete_agenda($idagenda)\n {\n return $this->db->delete('agenda',array('idagenda'=>$idagenda));\n }", "public function deleteEvent()\n {\n $result = new stdClass;\n $instance = null;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id);\n if (!$event->hasPermission(Horde_Perms::DELETE)) {\n $GLOBALS['notification']->push(_(\"You do not have permission to delete this event.\"), 'horde.warning');\n return $result;\n }\n $range = null;\n if ($event->recurs() && $this->vars->r != 'all') {\n switch ($this->vars->r) {\n case 'future':\n // Deleting all future instances.\n // @TODO: Check if we need to find future exceptions\n // that are after $recurEnd and remove those as well.\n $instance = new Horde_Date($this->vars->rstart, $event->timezone);\n $recurEnd = clone($instance);\n $recurEnd->hour = 0;\n $recurEnd->min = 0;\n $recurEnd->sec = 0;\n $recurEnd->mday--;\n if ($event->end->compareDate($recurEnd) > 0) {\n $kronolith_driver->deleteEvent($event->id);\n $result = $this->_signedResponse($this->vars->cal);\n $result->events = array();\n } else {\n $event->recurrence->setRecurEnd($recurEnd);\n $result = $this->_saveEvent($event, $event, $this->vars);\n }\n $range = Kronolith::RANGE_THISANDFUTURE;\n break;\n case 'current':\n // Deleting only the current instance.\n $instance = new Horde_Date($this->vars->rstart, $event->timezone);\n $event->recurrence->addException(\n $instance->year, $instance->month, $instance->mday);\n $result = $this->_saveEvent($event, $event, $this->vars);\n }\n } else {\n // Deleting an entire series, or this is a single event only.\n $kronolith_driver->deleteEvent($event->id);\n $result = $this->_signedResponse($this->vars->cal);\n $result->events = array();\n $result->uid = $event->uid;\n }\n\n if ($this->vars->sendupdates) {\n Kronolith::sendITipNotifications(\n $event, $GLOBALS['notification'], Kronolith::ITIP_CANCEL, $instance, $range);\n }\n $result->deleted = true;\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }", "public function deleteCalendarObject($calendarId, $objectUri) {\n\t\t\\GO::debug(\"deleteCalendarObject($calendarId,$objectUri)\");\n\t\t\n\t\ttry{\n\t\t\t$event = $this->getEventByUri($objectUri, $calendarId);\n\t\t\tif($event){\n\t\t\t\t$event->delete(); // will delete the DavEvent with an event\n\t\t\t}else{\n\t\t\t\t$task = $this->getTaskByUri($objectUri, $calendarId);\n\t\t\t\tif($task)\n\t\t\t\t\t$task->delete(); // will delete the DavTask with an event\n\t\t\t}\n\t\t}catch(\\GO\\Base\\Exception\\AccessDenied $e){\n//\t\t\t\\GO::debug($e);\n\t\t\tthrow new Sabre\\DAV\\Exception\\Forbidden;\n\t\t}\n\t}", "public function destroy(Appointments $appointments)\n {\n //\n }", "public function destroy(Request $request)\n {\n\n $publicacao=Publicacao::where('id','=',$request->id)->get();\n $interesses=Interesse::where('id_publicacao','=',$publicacao[0]->id)->get();\n foreach ($interesses as $interesse) {\n Interesse::destroy($interesse->id);\n }\n Publicacao::destroy($request->id);\n return redirect(route(\"timeLine\"));\n\n }", "public function destroy($id)\n {\n $calendar_event = CalendarEvent::findOrFail($id);\n $calendar_event->delete();\n\n return redirect()->route('calendar_events.index')->with('message', 'Item deleted successfully.');\n }", "public function cleanScheduleAction(){\n \t$actual = new Frogg_Time_Time();\n \t$cleaning_day = $actual->subtract(3*24*60*60);\n \t$cleaning_stamp = $cleaning_day->getUnixTstamp();\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `timestamp` < '.$cleaning_stamp);\n \tdie;\n }", "public function deleteUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) {\n $agenda->setPublished(false);\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot delete Agenda object!');\n }\n } else {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function empty_calendar($groups = array())\n {\n $sqladd = '';\n if (!empty($groups)) {\n if (is_numeric($groups)) {\n $groups = array($groups);\n }\n foreach ($groups as $k => $groupId) {\n // Am I the owner?\n if ($this->getGroupOwner($groupId) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $groupId);\n if (empty($perms) || empty($perms['delete'])) {\n // No, I haven't\n return false;\n }\n }\n //\n $groups[$k] = doubleval($groupId);\n }\n $sqladd = ' AND {TABLE}.`gid` IN('.join(',', $groups).')';\n } else {\n return false;\n }\n // Empty both the events and the tasks table with all associated secondary table items\n foreach (array('evt' => 'cal_event', 'tsk' => 'cal_task') as $token => $table) {\n $sec_sqladd = str_replace('{TABLE}', $this->Tbl[$table], $sqladd);\n foreach (array('cal_reminder', 'cal_repetition', 'cal_attendee', 'cal_attach') as $sec_table) {\n $query = 'DELETE '.$this->Tbl[$sec_table].'.* FROM '.$this->Tbl[$sec_table].', '.$this->Tbl[$table].\n ' WHERE '.$this->Tbl[$sec_table].'.`ref`=\"'.$token.'\" AND '.$this->Tbl[$sec_table].'.eid='.$this->Tbl[$table].'.id'.\n $sec_sqladd;\n $this->query($query);\n }\n $query = 'DELETE FROM '.$this->Tbl[$table].' WHERE `archived`=\"0\"'.str_replace('{TABLE}.', '', $sqladd);\n $this->query($query);\n }\n return;\n }", "public function destroy($id){ // id del meeting\n\n $meeting = Meeting::findOrFail($id);\n\n //ACTUALIZAMOS EL HORARIO DEL DOCTOR\n $meeting->schedule->update([\"estado\"=>\"0\"]);\n\n //BORRAMOS LA CITA CREADA\n $meeting->delete();\n\n return redirect()->route('cita.ver.index')\n ->with('mensaje','ok',);\n }", "public function __deleteEvents() {\n $_deleteEventCodes_ = array(\n 'wk_pa_add_column_menu',\n 'wk_pa_addJs_product',\n 'wk_pa_product_model_delete',\n 'wk_pricealert_account_view',\n 'wk_pricealert_header',\n 'wk_pricealert_addJs_add',\n 'wk_pricealert_addJs_edit',\n 'wk_pa_product_model_update',\n 'wk_pa_product_model_add',\n );\n\n foreach ($_deleteEventCodes_ as $_DE_code) {\n $this->helper_event->deleteEventByCode($_DE_code);\n }\n }", "public function destroy($id)\n {\n \tPatientWeek::destroy($id);\n }", "function Delete(){\r\n $query = \"DELETE FROM userschedules\r\n WHERE referenceId = $this->referenceId\r\n AND organizationId = $this->organizationId\";\r\n include(\"includes/dbConnection.php\");\t\t\t\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: DELETE query failed.\");\r\n }", "public function destroy(events $events)\n {\n //\n }", "public function delall()\n {\n }", "public function delete(){\r\n\t\t// Check for request forgeries\r\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\r\n\t\r\n\t\t// Get the model.\r\n\t\t$model = $this->getModel(\"ManageCompanyEvent\");\r\n\t\t$this->deleteEvents($model);\r\n\t\r\n\t\t$this->setRedirect('index.php?option=com_jbusinessdirectory&view='.$this->input->get('view'));\r\n\t}", "public function schedule_delete(Request $request,$id)\n {\n //delete the row\n schedule::where('id',$id)->delete();\n return redirect('/schedule_show');\n\n }", "public function destroy($id)\n {\n $agenda = Agenda::where('id',$id)->delete();\n $arbitro = Arbitro::where('id',$id)->delete();\n return redirect('/');\n //\n }", "public function destroy(Cursos $cursos)\n {\n //\n }", "public function destroy(Cursos $cursos)\n {\n //\n }", "public function delete($id) {\n \t\n \t$oCriteria = new CdtSearchCriteria();\n\t\t$oCriteria->addFilter('encomienda_oid', $id, '=');\n\t\t$oCriteria->addNull('fechaHasta');\n\t\t$managerEncomiendaEstado = ManagerFactory::getEncomiendaEstadoManager();\n\t\t$oEncomiendaEstado = $managerEncomiendaEstado->getEntity($oCriteria);\n\t\tif (($oEncomiendaEstado->getTipoEstadoEncomienda()->getOid()!=CPIQ_ESTADO_ENCOMIENDA_SOLICITADA)) {\n\t\t\t\n\t\t\tthrow new GenericException( CPIQ_MSG_ENCOMIENDA_ELIMINAR_PROHIBIDO );\n\t\t}\n\t\telse{\n\t\t\n\t \t$encomiendaEstadoDAO = DAOFactory::getEncomiendaEstadoDAO();\n\t $encomiendaEstadoDAO->deleteEncomiendaEstadoPorEncomienda($id);\n\t \t\n\t $encomiendaProfesionalDAO = DAOFactory::getEncomiendaProfesionalDAO();\n\t $encomiendaProfesionalDAO->deleteEncomiendaProfesionalPorEncomienda($id);\n\t \n\t $encomiendaRegistroDAO = DAOFactory::getEncomiendaRegistroDAO();\n\t $encomiendaRegistroDAO->deleteEncomiendaRegistroPorEncomienda($id);\n\t \n\t $encomiendaEspecialidadDAO = DAOFactory::getEncomiendaEspecialidadDAO();\n\t $encomiendaEspecialidadDAO->deleteEncomiendaEspecialidadPorEncomienda($id);\n\t \n\t \n\t \n\t \tparent::delete( $id );\n\t\t}\n\t\t\n }", "public function testDeleteInvalidSchedule() {\n\t\t$schedule = new Schedule(null, $this->company->getCompanyId(), $this->VALID_SCHEDULEDAYOFWEEK1, $this->VALID_SCHEDULEENDTIME1, $this->VALID_SCHEDULELOCATIONADDRESS1, $this->VALID_SCHEDULELOCATIONNAME1, $this->VALID_SCHEDULESTARTTIME1);\n\n\t\t$schedule->delete($this->getPDO());\n\t}", "public function delete($entryId){\n\n $this->autoRender = false;\n\n $entry = $this->CalendarEntry->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'CalendarEntry.id' => $entryId\n )\n ));\n\n if(empty($entry)){\n $this->_setFlash('Calendar entry does not exist');\n return $this->redirect('/calendar');\n }\n\n if($this->CalendarEntry->delete($entryId)){\n $this->_setFlash('Calendar entry deleted','success');\n return $this->redirect('/calendar');\n }\n else {\n $this->_setFlash('We encountered a problem while trying to delete this calendar entry');\n return $this->redirect(\"/calendaar/view/$entryId\");\n }\n }", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function destroy($id)\n {\n if($id == 'all')\n {\n DB::delete('delete from events where id != ?',[$id]);\n }\n else\n {\n DB::delete('delete from events where id = ?',[$id]);\n }\n return response()->json('Successfully Deleted');\n //\n }", "function delete_events() {\n\n\t$args = array(\n\t\t'post_type' => 'tribe_events',\n\t\t'post_status' => 'any',\n\t\t'meta_key' => '_EventStartDate',\n\t\t'orderby' => 'meta_value',\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t'value' => (new DateTime(\"2017-01-01 00:00\"))->format(DateTime::ATOM),\n\t\t\t\t'compare' => '<=',\n\t\t\t),\n\t\t),\n\t\t'order' => 'ASC',\n\t\t'suppress_filters' => true,\n\t\t'posts_per_page' => -1\n\t);\n\n\t$out = '';\n\t$query = get_posts( $args );\n\tforeach($query as $post) {\n\t\t$out .= tribe_get_start_date($post, true) . \" \" . $post->post_title . '<br>';\n\t\t//wp_delete_post($post->ID, true);\n\t}\n\treturn $out;\n}", "public function destroy($id)\n {\n $time = Schedule::findOrFail($id)->time;\n $find = Schedule::all()->where('time', '=', $time);\n foreach ($find as $item){\n Schedule::findOrFail($item->id)->delete();\n }\n return redirect()->route('section.index');\n }", "public function destroy(CalendarEvent $calendar_event)\n {\n $calendar_event->delete();\n\n return redirect()->route('calendar_events.index')->with('warning', 'Item deleted successfully.');\n }", "public function delete()\n {\n $dayId = $this->uri->segment(3);\n \n if ($dayId) {\n $this->load->model(\"Eggproductiondata\", 'production');\n \n $this->load->model(\"Eggproductiondays\", 'day');\n \n //echo $this->production->delete(array('egg_production_day_id'=>$dayId));\n echo $this->day->delete($dayId);\n } else {\n \n echo 0;\n }\n \n die;\n }", "public function deleteAction() {\n\t\t$request = $this->getRequest();\n\t\t$values = $request->getParams();\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$dbseries->update(array('newday' => (int)$this->_getParam('newday', -1)), 'id = '. (int) $values['seriesid']);\n\t\t$this->_forward('crfetch');\n\t}", "public function delete_schedule($params = [])\n {\n return Schedule::where(['event_id' => $params['event_id'], 'user_id' => $params['user_id']])->delete();\n }", "public function deleteById(int $id): void\n {\n $this->client->delete(\"Appointments/$id\");\n }", "public function destroy($id)\n {\n\n $event = Event::findOrFail($id);\n\n $deleted = $event->delete();\n\n if ($deleted)\n Session::flash('deleted_event', 'The event was successfully deleted!');\n\n return redirect('admin/calendar');\n\n }", "public function destroy(Events $events)\n {\n //\n }", "function calenderHolidayDel(Request $request){\n\n $id = Auth::user()->id;\n $date = $request->date_hidden;\n $action = $request->schedule;\n\n if($action==1){\n\n CalendarHoliday::create(['user_id'=>$id,\n 'holiday_date'=>$date]);\n\n $status_msg='Successfully updated';\n \n }\n else{\n\n CalendarAvailability::where('user_id',$id)->delete();\n\n CalendarHoliday::where('user_id',$id)->delete();\n\n $status_msg='Successfully deleted';\n }\n\n Session::flash('status',$status_msg);\n\n return redirect()->back();\n\n }", "public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}", "public function deleteById($orderscheduleId);", "public function destroy(Request $request)\n {\n // find that record\n $event = EventBackend::find($request->id);\n\n if (count($event->media) > 0) {\n $event->media()->delete(); // delete english & arabic youtube links\n }\n\n if (count($event->hashtags) > 0) {\n $event->hashtags()->detach(); // delete hashtags\n }\n\n if (count($event->categories) > 0) {\n $event->categories()->detach(); // delete categories\n }\n\n $event->delete(); // delete events\n\n if (\\Lang::getLocale() == 'en') {\n Session::flash('success', 'Event deleted successfully!');\n } else {\n Session::flash('success', ' تم مسح الحدث بنجاح');\n }\n return response()->json(['success', 'event deleted!']);\n }", "public function destroy($id)\n {\n $data = Leave::findOrFail($id);\n\n foreach(json_decode($data->date_leave) as $date){\n $datePermit = Carbon::parse($date);\n $getDays = Days::where('name_day', $datePermit->format('l'))->first();\n $getSchedule = Schedule::where('users_id', $data->users_id)->where('days_id', $getDays->id)->first();\n \n if($getSchedule){ // jika ada jadwalnya, maka create\n $dataAttend = Attendance::whereDate('start',$date)->where('user_id', $data->users_id)->first();\n if($dataAttend){\n $dataAttend->delete();\n }\n }\n }\n\n $data->delete();\n\n return redirect()->route('leave.index')->with('success','Data berhasil dihapus!');\n }", "function calendar_display_type_delete() {\n\t\t$db = new DB ;\n\t\tif(isset($_GET['id']) > 0)\n\t\t{\n\t\t\t// update all events who use this event_type we set the event_type to 'other'.\n\t\t\t// if we don't do this, the events who use this event_type can't be edited anymore.\n\t\t\t$result = $this->set_types_to_other($_GET['id']);\n\n\t\t\t// delete the event_type\n\t\t\t$sql = \"delete from event_type where event_type_id = \".$_GET['id'];\n\t\t\t$db->execute_statement($sql);\n\n\t\t\tinclude_once(SF_CLASS_PATH.'/calendar/calendar.inc');\n $calendar_obj = new Calendar ;\n $calendar_obj->cache_event_type_array();\n\t\t\t\t\t\t\t\n\t\t}\n\t\theader('Location: /admin/calendar/display_type_list.php');\n }", "function delete($schedule_id)\n\t{\n\t\t//var_dump($schedule_id);\n\t\t$this->db->where('id', $schedule_id);\n\t\treturn $this->db->delete(\"schedule\");\n\t\t\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public function destroy($id)\n {\n $delete_holyday = Governmentholyday::find($id);\n $delete_holyday->delete();\n }", "public function delete_all()\n {\n }", "public function deleteOrganiser() {\n $this->organiser = NULL;\n }", "public function deleteAll(): void;", "public function destroy($id)\n {\n $appointment=Appointment::find($id);\n $nextAppointments=Appointment::where(['date'=>$appointment->date,'doc_id'=>$appointment->doc_id,\n ['serial_no','>',$appointment->serial_no]])->get();\n if($appointment->delete())\n {\n foreach($nextAppointments as $appt)\n {\n $appt->serial_no--;\n $appt->save();\n }\n return redirect('dashboard')->with('success','Appointment Deleted!');\n }\n else\n return redirect('dashboard')->with('failure','Appointment Deletion Failed!');\n }", "public function delete_entries_start ()\n\t{\n\t\t$return = (ee()->extensions->last_call) ?\n\t\t\t\t\tee()->extensions->last_call : '';\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\t$group_id = ee()->session->userdata['group_id'];\n\n\t\tif ($group_id != 1 AND ee()->calendar_permissions->enabled())\n\t\t{\n\t\t\t$count = count($_POST['delete']);\n\n\t\t\t//remove all the ones they are denied permission to\n\t\t\tforeach ($_POST['delete'] as $key => $delete_id)\n\t\t\t{\n\t\t\t\t//if there are only calendar IDs, lets alert\n\t\t\t\tif ( ! ee()->calendar_permissions->can_edit_entry($group_id, $delete_id))\n\t\t\t\t{\n\t\t\t\t\tunset($_POST['delete'][$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if we've removed everything, they were all\n\t\t\t//denied and we need to alert\n\t\t\tif ($count > 0 and count($_POST['delete']) == 0)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = TRUE;\n\n\t\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function destroySelected(Request $request)\n {\n foreach ($request->ids as $id) {\n // find that record\n $event = EventBackend::find($id);\n\n // delete english images or files\n\n // delete arabic images or files\n\n if (count($event->media) > 0) {\n $event->media()->delete(); // delete english & arabic youtube links\n }\n\n if (count($event->hashtags) > 0) {\n $event->hashtags()->detach(); // delete hashtags\n }\n\n if (count($event->categories) > 0) {\n $event->categories()->detach(); // delete categories\n }\n\n $event->delete(); // delete events\n }\n\n if (\\Lang::getLocale() == 'en') {\n Session::flash('success', 'Event deleted successfully!');\n } else {\n Session::flash('success', ' تم مسح الحدث بنجاح');\n }\n\n return response()->json(['success', 'event deleted!']);\n }", "public function destroy($id)\n {\n $mytime = Carbon::now();\n\n $result = Schedule::select()->where(\"fecha_atencion\",\"<\",$mytime->format(\"Y-m-d\"))->where(\"estado\",\"0\")->delete();\n if($result==0){\n\n return redirect()->route('horarios.index')->with('mensaje','no');\n\n }else{\n\n return redirect()->route('horarios.index')->with('mensaje','ok');\n\n }\n\n\n\n }", "public function actionDelete($id)\n {\n $delete = \\Yii::$app\n ->db\n ->createCommand()\n ->delete('schedule', ['department_id' => $id])\n ->execute();\n if ($delete) {\n Yii::$app->session->setFlash('success', \"Schedule deleted successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Schedule not deleted.\");\n }\n return $this->redirect(['index']);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "function delete(){\n\t\t$eventDet = $this->get_full_details();\n\t\t//print_r($eventDet);\n\t\t#unlink all images for the event\n\t\tif ($eventDet->news_image_logo) { \n\t\t\t//unlink($this->imgPath.$eventDet->news_image_logo);\n\t\t}\n\t\tif ($eventDet->news_photo1) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo1);\n\t\t}\n\t\tif ($eventDet->news_photo2) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo2);\n\t\t}\n\t\tif ($eventDet->news_photo3) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo3);\n\t\t}\t\t\t\t\t\t\n\t\t\n\t\t#remove event entry from the db\n\t\tglobal $db;\n\t\t$sQl = \"delete from cms_news where id = '\".$this->event_id.\"'\";\n\t\tif ($db->query($sQl)){\n\t\t\t$this->message = \"Event \".$eventDet->news_title.\" deleted successfully\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error = \"Cannot delete Event \".$eventDet->news_title.\"\";\n\t\t\treturn false;\n\t\t}\n\t}", "public function deleteSchedule($id)\n \t{\n \t\t$deleteSlot = RecruiterSchedule::destroy($id);\n \t\t$checkInvitedSlot = RecruiterScheduleInvite::where('slot_id',$id)->first();\n \t\tif ($checkInvitedSlot) {\n \t\t\t$deleteSlot = RecruiterScheduleBooked::where('u_id',$checkInvitedSlot->u_id)->delete();\n \t\t}\n $deleteSlot = RecruiterScheduleInvite::where('slot_id',$id)->delete();\n\t\treturn response()->json([\n 'success' => true,\n 'message' => 'Time Slot Deleted Successfully'\n ],200);\n \t}", "public function deselectHolidays()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n $dates = [];\n\n $available_days = AvailableDays::where('available_date', '>=', $current_year)\n ->where('available_date', '<=', $next_year)\n ->get();\n $available_adhocs = AvailableAdhocs::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $unavailable_days = UnavailableDays::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $unavailable_adhocs = UnavailableAdhocs::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $holidays = $this->getTwoYearDates();\n foreach ($holidays as $key => $holiday) {\n $dates[] = date('Y-m-d', strtotime($holiday->date));\n }\n\n foreach ($available_days as $key => $available_day) {\n if(in_array($available_day->available_date, $dates) ) {\n $available_day->delete();\n }\n }\n\n foreach ($available_adhocs as $key => $available_adhoc) {\n if(in_array($available_adhoc->date, $dates) ) {\n $available_adhoc->delete();\n }\n }\n\n foreach ($unavailable_days as $key => $unavailable_day) {\n if(in_array($unavailable_day->date, $dates) ) {\n $unavailable_day->delete();\n }\n }\n\n foreach ($unavailable_adhocs as $key => $unavailable_adhoc) {\n if(in_array($unavailable_adhoc->date, $dates) ) {\n $unavailable_adhoc->delete();\n }\n }\n }", "public function deletepurgeAction($days)\n {\n $purge = $this->get('oc_platform.advert_purger');\n /* $old_adverts = $purge->purge($days, $advertswithapplication);*/\n $purge->purge($days);\n /* foreach($old_adverts as $old_advert)\n {\n $em = $this->getdoctrine()->getManager();\n $em->remove($old_advert);\n $em->flush();\n }*/\n return $this->redirect($this->generateUrl('oc_platform_home'));\n }", "public function destroy($id)\n {\n $ids = explode(',', $id);\n $schedules = Schedule::findOrFail($ids);\n $destroy = $schedules->each(function ($schedule, $key) {\n $schedule->delete();\n });\n\n // \n return apiResponse(\n $schedules->pluck('id'),\n 'delete data success.',\n true\n );\n }", "private function deleteEvent($event)\n {\n $data = json_decode($event->data,true);\n\n //now we need to see what the actual event gcal_id is as the event data may not have a current google cal if the event\n //was moved or deleted etc.\n //but it could also have been moved to a calendar that no longer has gcal or created and have a gcal already\n\n /*\n use case 1: the event has previously been created and synced but is now being deleted means there will be an gcal id\n in the json encoded event data BUT the cal_id could be wrong in the event. it will be correct in teh data\n\n use case 2: the event has previously been created but was only synced in the current sync run in which case the event\n object will hold the gcal_id. the cal_id would be correct in the event object and in the data.\n\n SOLUTION: if there is no gcal_id in the event data then pull the gcal_id from the event object BUT ALWAYS get the \n event cal id from the event data\n\n */\n\n\n\n $evObj = new \\Pbbooking\\Model\\Event($data['id']);\n $event_gcal_id = (isset($data['gcal_id']) && $data['gcal_id'] != '') ? $data['gcal_id'] : $evObj->gcal_id;\n\n if (!$event_gcal_id || $event_gcal_id == '')\n return false; //can't delete an event with no gcal id\n\n //now we are assuming we have a gcalid as $event_gcal_id\n $service = new \\Google_Service_Calendar($this->googleClient);\n $cal = $GLOBALS['com_pbbooking_data']['calendars'][$evObj->cal_id];\n\n $service->events->delete(trim($cal->gcal_id),$event_gcal_id);\n\n return true;\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('time_project_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = TimeProject::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }" ]
[ "0.75884086", "0.7346631", "0.6924988", "0.6895693", "0.6874049", "0.68738574", "0.6519423", "0.6515091", "0.64197564", "0.625339", "0.619031", "0.6189879", "0.6119622", "0.60904646", "0.60383433", "0.6002049", "0.59439117", "0.5943278", "0.59424686", "0.5910592", "0.59032303", "0.5901605", "0.58846384", "0.5859401", "0.5843225", "0.58364725", "0.5797346", "0.5791748", "0.57783663", "0.5777701", "0.5755736", "0.5744975", "0.5738672", "0.57345676", "0.572682", "0.5724682", "0.5717339", "0.56830066", "0.56644714", "0.56486636", "0.56467813", "0.56197137", "0.5606199", "0.5581542", "0.55667615", "0.55470735", "0.55259806", "0.55025417", "0.54974633", "0.5495738", "0.54935765", "0.5490895", "0.54886883", "0.54807544", "0.5474348", "0.5464636", "0.54597", "0.5450625", "0.5450625", "0.54341257", "0.54309446", "0.54309285", "0.541977", "0.54126096", "0.54125506", "0.5405663", "0.540003", "0.5399923", "0.5398666", "0.53985965", "0.53934276", "0.53921986", "0.53903717", "0.53798044", "0.53792584", "0.53673315", "0.5357138", "0.5356506", "0.53516215", "0.5333197", "0.53321713", "0.5327697", "0.5326174", "0.53179824", "0.53044695", "0.5304371", "0.52971166", "0.52969384", "0.5296068", "0.5295665", "0.5286395", "0.5286395", "0.5286395", "0.5285697", "0.52828854", "0.5281502", "0.52767605", "0.5275879", "0.5275178", "0.5274684" ]
0.56095606
42
Get the event by DAV client URI
private function getEventByUri($uri, $calendarId){ $joinCriteria = FindCriteria::newInstance() ->addRawCondition('t.id', 'd.id'); $whereCriteria = FindCriteria::newInstance() ->addModel(DavEvent::model(),'d') ->addCondition('calendar_id', $calendarId) ->addCondition('uri', $uri,'=','d'); $findParams = FindParams::newInstance() ->single() ->join(DavEvent::model()->tableName(),$joinCriteria, 'd') ->criteria($whereCriteria); return \GO\Calendar\Model\Event::model()->find($findParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetEventByURI($uri_path = '') \n {\n if ( ! $uri_path) {\n return false;\n }\n $data = $this->db\n ->join('status', 'status.id_status = event.id_status', 'left')\n ->join('event_detail', 'event_detail.id_event = event.id_event', 'left')\n ->join('localization', 'localization.id_localization = event_detail.id_localization', 'left')\n ->where('is_delete', 0)\n ->where('publish_date <=', $this->date_now)\n ->where(\"(expire_date >= '{$this->date_now}' OR expire_date IS NULL || expire_date = '0000-00-00')\")\n ->where(\"LCASE({$this->db->dbprefix('event')}.uri_path)\", strtolower($uri_path))\n ->where(\"LCASE({$this->db->dbprefix('status')}.status_text)\", \"publish\")\n ->where(\"LCASE({$this->db->dbprefix('localization')}.iso_1)\", $this->lang->get_active_uri_lang())\n ->order_by('event.id_event', 'desc')\n ->limit(1)\n ->get('event')\n ->row_array();\n\n return $data;\n }", "public function find_client($event_id, $client_id);", "public function getEvent();", "public function getEvent()\n {\n // get event\n $this\n ->get('/event')\n ->assertStatus(200);\n }", "public function calendar_get_item($ews,$event_id){\n\t\t// Form the GetItem request\n\t\t$request = new EWSType_GetItemType();\n\t\t\n\t\t// Define which item properties are returned in the response\n\t\t$itemProperties = new EWSType_ItemResponseShapeType();\n\t\t$itemProperties->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;\n\t\t\n\t\t// Add properties shape to request\n\t\t$request->ItemShape = $itemProperties;\n\t\t\n\t\t// Set the itemID of the desired item to retrieve\n\t\t$id = new EWSType_ItemIdType();\n\t\t$id->Id = $event_id;\n\t\t\n\t\t$request->ItemIds->ItemId = $id;\n\t\t\n\t\t// Send the listing (find) request and get the response\n\t\t$response = $ews->GetItem($request);\n\t\t//create an array to hold response data\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->GetItemResponseMessage->Items->CalendarItem);\n\t\treturn $event_data;\n\t }", "public static function event() {\n return self::service()->get('events');\n }", "public function getEvent($eventUrl)\n\t{\n\t\t// The given $eventUrl could, in legacy code, actually be a token instead\n\t\tif (!$this->connector->isEventUrl($eventUrl))\n\t\t{\n\t\t\t// This is an old-style token. Properly path it.\n\t\t\t$eventUrl = 'events/'. $eventUrl;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The Event is using the new distributed API, and we're given an EventUrl\n\t\t\t$eventUrl = urldecode($eventUrl);\n\n\t\t\t// Verify the OAuth signature of the call\n\t\t\t//\n\t\t\t// Todo: This can be deferred to get the wrapper functional, but MUST be done!\n\t\t\t// Maybe see: OAuthSignatureMethod_HMAC_SHA1::check_signature()?\n\t\t\t// Should be a library call, not a local method implementation\n\t\t\tif (false)\n\t\t\t{\n\t\t\t\t$error = array('error' => 'The request did not validate using AppDirect OAuth signatures');\n\t\t\t\tthrow new AppDirectValidationException('401', $error);\n\t\t\t}\n\t\t}\n\n\t\t// GET the event from the provided $eventUrl using a OAuth-signed request\n\t\treturn new AppDirectEvent($this->connector->get($eventUrl));\n\t}", "public static function get(Client $client, $id) {\n $req = $client->newRequest(\"GET\", \"/{accountname}/events/{id}\");\n $req->addParameter(\"id\", $id);\n\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }", "public function getEvent()\n {\n // Check for a new event on the current connection\n $buffer = '';\n do {\n $buffer .= fgets($this->socket, 512);\n } while (!empty($buffer) && !preg_match('/\\v+$/', $buffer));\n $buffer = trim($buffer);\n\n // If no new event was found, return NULL\n if (empty($buffer)) {\n return null;\n }\n\n // If the event has a prefix, extract it\n $prefix = '';\n if (substr($buffer, 0, 1) == ':') {\n $parts = explode(' ', $buffer, 3);\n $prefix = substr(array_shift($parts), 1);\n $buffer = implode(' ', $parts);\n }\n\n // Parse the command and arguments\n list($cmd, $args) = array_pad(explode(' ', $buffer, 2), 2, null);\n\n // Parse the server name or hostmask\n if (strpos($prefix, '@') === false) {\n $hostmask = new Phergie_Hostmask(\n null, null, $prefix\n );\n } else {\n $hostmask = Phergie_Hostmask::fromString($prefix);\n }\n\n // Parse the event arguments depending on the event type\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'names':\n case 'nick':\n case 'quit':\n case 'ping':\n case 'pong':\n case 'error':\n case 'part':\n $args = array_filter(array(ltrim($args, ':')));\n break;\n\n case 'privmsg':\n case 'notice':\n $args = $this->parseArguments($args, 2);\n list($source, $ctcp) = $args;\n if (substr($ctcp, 0, 1) === \"\\001\" && substr($ctcp, -1) === \"\\001\") {\n $ctcp = substr($ctcp, 1, -1);\n $reply = ($cmd == 'notice');\n list($cmd, $args) = array_pad(explode(' ', $ctcp, 2), 2, array());\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'version':\n case 'time':\n case 'finger':\n case 'ping':\n if ($reply) {\n $args = array($args);\n }\n break;\n case 'action':\n $args = array($source, $args);\n break;\n }\n }\n // This fixes the issue that seems to occur, but why does it?\n if (!is_array($args)) {\n $args = array($args);\n }\n break;\n\n case 'topic':\n case 'invite':\n case 'join':\n $args = $this->parseArguments($args, 2);\n break;\n\n case 'kick':\n case 'mode':\n $args = $this->parseArguments($args, 3);\n break;\n\n // Remove target and colon preceding description from responses\n default:\n $args = substr($args, strpos($args, ' ') + 2);\n break;\n }\n\n // Create, populate, and return an event object\n if (ctype_digit($cmd)) {\n $event = new Phergie_Event_Response;\n $event\n ->setCode($cmd)\n ->setDescription($args);\n } else {\n $event = new Phergie_Event_Request;\n $event\n ->setType($cmd)\n ->setArguments($args);\n $event->setHostmask($hostmask);\n }\n $event->setRawData($buffer);\n return $event;\n }", "public function getEvent()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Event']) ? $headers['X-NE-Event'] : null;\n }", "private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }", "function url_ical(string $pkey, string $eventid): string\n{\n return $GLOBALS['icaldownload']->url_ical($pkey, $eventid);\n}", "public function getEvent()\n {\n return $this->getProperty(\"Event\",\n new Event($this->getContext(), new ResourcePath(\"Event\", $this->getResourcePath())));\n }", "public function getEvent(): EventInterface;", "public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }", "public function getCalendarObject($calendarId, $objectUri) {\n\n\t\t\\GO::debug(\"c:getCalendarObject($calendarId,$objectUri)\");\n\n\t\t/*\n\t\t * When a client adds or updates an event, the server must return the\n\t\t * data identical to what the client sent. That's why we store the\n\t\t * client data in a separate table and if the mtime's match we use that.\n\t\t */\n\n\t\t//select on calendar id is necessary because somehow thunderbird tries\n\t\t//to get an event that's an invitation. It must not return the organizers event.\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t//->single()\n\t\t\t->limit(1)\n\t\t\t->ignoreAcl()\n\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t->criteria($whereCriteria)\n\t\t\t->join(DavEvent::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\n//\t\t$sql = \"SELECT d.uri,e.*, d.mtime AS client_mtime, d.data FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=? AND e.calendar_id=?\";\n//\t\t$this->cal->query($sql, 'si', array($objectUri,$calendarId));\n//\t\t$event = $this->cal->next_record();\n\n\t\t//\\GO::debug($event);\n\t\t\n\t\t$event = \\GO\\Calendar\\Model\\Event::model()->find($findParams)->fetch();\n\t\t\n\t\tif ($event) {\n\n\t\t\t\\GO::debug('Found event');\n\t\t\t\n\t\t\t$data = ($event->mtime==$event->client_mtime && !empty($event->data)) ? $event->data : $this->exportCalendarEvent($event);\n\t\t\t\\GO::debug($event->mtime==$event->client_mtime ? \"Returning client data (mtime)\" : \"Returning server data (mtime)\");\n\t\t\t\n\t\t\t\n//\t\t\t$data = $this->exportCalendarEvent($event);\n\t\t\t\n\t\t\t\\GO::debug($data);\n\n\t\t\t$object = array(\n\t\t\t\t'id' => $event->id,\n\t\t\t\t'uri' => $event->uri,\n\t\t\t\t'calendardata' => $data,\n\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t);\n\t\t\t//\\GO::debug($object);\n\t\t\treturn $object;\n\t\t} \n\t\telse {\n\n\t\t\t//$calendar = $this->cal->get_calendar($calendarId);\n\n//\t\t\t$sql = \"SELECT e.*, d.uri, d.mtime AS client_mtime, d.data FROM ta_tasks e INNER JOIN dav_tasks d ON d.id=e.id WHERE d.uri=?\";// AND e.tasklist_id=?\";\n//\t\t\t$this->tasks->query($sql, 's', array($objectUri));\n//\t\t\t$task = $this->tasks->next_record();\n\t\t\t\n\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t->addModel(DavTask::model(),'d')\n\t\t\t\t//->addCondition('tasklist_id', $calendarId) //Not necessary with the inner join on dav_tasks\n\t\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t\t->addRawCondition('t.id', 'd.id');\n\n\t\t\t$findParams = FindParams::newInstance()\n\t\t\t\t->single()\n\t\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t\t->criteria($whereCriteria)\n\t\t\t\t->join(DavTask::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\t\t\t\n\t\t\t\n\t\t\t$task = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\tif ($task) {\n\n\t\t\t\t\\GO::debug('Found task');\n\n\t\t\t\t$data = ($task->mtime==$task->client_mtime && !empty($task->data)) ? $task->data : $task->toICS();\n\n\t\t\t\t\\GO::debug($data);\n\n\t\t\t\t$object = array(\n\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t'uri' => $task->uri,\n\t\t\t\t\t'calendardata' => $data,\n\t\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t'etag'=>'\"' .date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t);\n\n\n\t\t\t\treturn $object;\n\t\t\t}\n\t\t}\n\t\tthrow new Sabre\\DAV\\Exception\\NotFound('File not found');\n\t}", "public function index($appId)\n {\n return $this->try(function() use ($appId)\n {\n return $this->client->get('v1/apps/'.$appId.'/events');\n });\n }", "public function getEvent() {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "protected function getEvent(string $event) {\n return $this\n ->mailjet_webhook_events()\n ->where('event', $event)\n ->orderBy('created_at', 'desc')\n ->first();\n }", "public function event( $id ) {\n\t\treturn $this->client->getEvent( [ 'id' => $id ] );\n\t}", "public function getEvent()\n {\n return $this->getData('event');\n }", "public function getEvent($event_uri, $verbose = true)\n {\n $params = [];\n if ($verbose) {\n $params['verbose'] = 'yes';\n }\n\n $event_list = (array)json_decode($this->apiGet($event_uri, $params));\n if (isset($event_list['events']) && isset($event_list['events'][0])) {\n $event = new EventEntity($event_list['events'][0]);\n $this->eventDb->save($event);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n $hostsInfo->entity = $this->userApi->getUser($hostsInfo->host_uri);\n }\n }\n return $event;\n }\n\n return false;\n }", "public function getEvent($eventId)\n {\n $url = '/events/' . $eventId;\n\n $response = $this->request($url);\n\n $dataWrapper = $this->contentHandler->getEventDataWrapper($response);\n\n return $dataWrapper->getData()->get(0);\n }", "public function getEventDispatch();", "public function getEventObject(){\n $eventTimeID = $this->getID();\n\n $prepared = self::adhocQuery(function( \\PDO $connection ) use ($eventTimeID){\n $statement = $connection->prepare(\"\n SELECT sev.id FROM SchedulizerEvent sev\n JOIN SchedulizerEventTime sevTime ON sevTime.eventID = sev.id\n WHERE sevTime.id = :eventTimeID\n \");\n $statement->bindValue(\":eventTimeID\", $eventTimeID);\n return $statement;\n });\n\n return Event::getByID($prepared->fetch(\\PDO::FETCH_COLUMN));\n }", "public function getEvent() {\n\t}", "public function getEvent() {\n $request = $this->getRequest();\n\n if (request('type') == 'event_callback') {\n $event = $request['event'];\n } else {\n $event = $request;\n }\n\n return $event;\n }", "public function getEventName() : String;", "public function getEvent($id)\n {\n\n $cached = $this->getFromCache('event_cache_'.$id);\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch, event, checkins and RSVPs (only the latter has pictures)\n $event = $this->client->getEvent(array('id' => $id));\n\n $rsvps = $this->client->getRSVPs(\n array('event_id' => $id, 'rsvp' => 'yes', 'order' => 'name', 'fields' => 'host', 'page' => 300)\n );\n\n $event = $event->toArray();\n $event['checkins'] = array();\n $event['rsvps'] = array();\n foreach ($rsvps as $rsvp) {\n $event['rsvps'][] = array(\n 'id' => $rsvp['member']['member_id'],\n 'name' => $rsvp['member']['name'],\n 'photo' => isset($rsvp['member_photo']) ? $rsvp['member_photo'] : null,\n 'host' => $rsvp['host']\n );\n }\n\n $this->saveInCache('event_cache_'.$id, $event);\n\n return $event;\n }", "public function getEvent($name, $method = HTTP_METH_GET)\n {\n $url = '/events/' . $name . '.json';\n return $this->send($url, $method);\n }", "function GetOneEvents($event_id)\n\t{\n\t\t$sql = \"SELECT * FROM event WHERE event_id = '\".$event_id.\"'\";\n\t\t$data = CDBCon::GetInstance()->GetRow($sql);\n\t\treturn $data;\n\t}", "abstract public function getEventName();", "public function findClient($client);", "function agenda_get_item($event_id)\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n $sql = \"SELECT \tevent.id \t\t\t\t\t\tAS id,\n\t\t\t\t\tevent.title \t\t\t\t\tAS title,\n\t\t\t\t\tevent.description \t\t\t\tAS description,\n\t\t\t\t\tevent.start_date \t\t\t\tAS old_start_date,\n\t\t\t\t\tevent.end_date \t\t\t\t\tAS old_end_date,\n\t\t\t\t\tevent.author_id \t\t\t\tAS author_id,\n\t\t\t\t\trel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\tevent.master_event_id\t\t \tAS master_event_id,\n\t\t\t\t\trel_event_recipient.user_id\t\tAS user_id,\n\t\t\t\t\trel_event_recipient.group_id\tAS group_id\n FROM \" . $tbl . \"\n\n WHERE event.id = \" . (int) $event_id ;\n\n $event = claro_sql_query_get_single_row($sql);\n\n if ($event) return $event;\n else return claro_failure::set_failure('EVENT_ENTRY_UNKNOW');\n\n}", "function getEventById()\n\t{\n\t\t//echo \" From ByID: \" . $this->_id;\n\t\t$eventId = 1;\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%d.%m.%Y')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%H:%i')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_end, '%H:%i')\");\n\t\t$query->select($db->nameQuote('t1.s_category'));\n\t\t$query->select($db->nameQuote('t1.s_place'));\n\t\t$query->select($db->nameQuote('t1.s_price'));\n\t\t$query->select($db->nameQuote('t1.idt_drivin_event'));\n\t\t$query->select($db->nameQuote('t1.n_num_part'));\n\t\t$query->select('t1.`n_num_part` - (SELECT COUNT(t2.`idt_drivin_event_apply`) ' .\n\t\t\t' FROM #__jevent_events_apply as t2 ' .\n\t\t\t' WHERE t2.`idt_drivin_event` = t1.`idt_drivin_event` AND t2.dt_cancel is null) as n_num_free');\n\t\t$query->from('#__jevent_events as t1');\n\t\t$query->where($db->nameQuote('idt_drivin_event') . '=' . $this->_id);\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t}\n\t\t//echo \" From ByID: \" . count($link);\n\t\t//echo \" From ByID: \" . $query;\n\t\treturn $link;\n\t}", "public function getEventSubscriber();", "public function getEvent()\r\n {\r\n return $this->Event;\r\n }", "public function getURI();", "public function event(): EventDispatcherInterface;", "function getEventsHostedByCompany()\n{\n\t$companyUserName=validate_input($_GET['companyUserName']);\n\t$companyid=getCompanyIdfromCompanyUserName($companyUserName);\t\n}", "public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }", "public static function get_event($eventid) {\r\n global $uid;\r\n return Database::get()->querySingle(\"SELECT * FROM personal_calendar WHERE id = ?d AND user_id = ?d\", $eventid, $uid);\r\n }", "public static function getlist(Client $client, $params = null) {\n if ($params == null || is_array($params)) {\n $params = new EventQuery($params == null ? array() : $params);\n }\n $req = $client->newRequest(\"GET\", \"/{accountname}/events\");\n\n $req->addQuery(\"context\", $params->context);\n $req->addQuery(\"filter\", $params->filter);\n $req->addQuery(\"lastupdatesince\", $params->lastupdatesince);\n $req->addQuery(\"limit\", $params->limit);\n $req->addQuery(\"offset\", $params->offset);\n $req->addQuery(\"orderby\", $params->orderby);\n $req->addQuery(\"output\", $params->output);\n $req->addQuery(\"searchterm\", $params->searchterm);\n $req->addQuery(\"simplefilter\", $params->simplefilter);\n\n $result = $req->run(\"json\");\n return EventsList::fromJson($result);\n }", "public static function getEvent($event_id)\n\t{\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\t$sql = \"SELECT *, events.id as event_id, fest_type.name as fest_type_name FROM events JOIN fest_type ON fest_type.id = events.fest_type_id WHERE events.id = :event_id\";\n\t\t$query = $database->prepare($sql);\n\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t// fetch() is the PDO method that gets a single result\n\t\treturn $query->fetch();\n\t}", "function getEventID() {\n\t\treturn $this->_EventID;\n\t}", "function getXeroInvoiceCallbackURI() {\r\n $sql = $this->db->prepare(\"SELECT uri FROM CALLBACK_URIS WHERE callback='xero_invoice'\");\r\n $sql->execute();\r\n return $sql->fetch(PDO::FETCH_ASSOC);\r\n }", "public function getByStub($stub)\n {\n $item = $this->eventDb->load('stub', $stub);\n\n if (!$item) {\n return false;\n }\n\n return $this->getEvent($item['uri']);\n }", "public function getEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n $event = $this->model->getEvent($id);\n\n $this->send(200, $event);\n }", "function uri(): string;", "function get_event(){\n\t\tglobal $EM_Event;\n\t\tif( is_object($EM_Event) && $EM_Event->event_id == $this->event_id ){\n\t\t\treturn $EM_Event;\n\t\t}else{\n\t\t\tif( is_numeric($this->event_id) && $this->event_id > 0 ){\n\t\t\t\treturn em_get_event($this->event_id, 'event_id');\n\t\t\t}elseif( is_array($this->bookings) ){\n\t\t\t\tforeach($this->bookings as $EM_Booking){\n\t\t\t\t\t/* @var $EM_Booking EM_Booking */\n\t\t\t\t\treturn em_get_event($EM_Booking->event_id, 'event_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn em_get_event($this->event_id, 'event_id');\n\t}", "public function retrieveEventLog($eventLogId)\n {\n return $this->start()->uri(\"/api/system/event-log\")\n ->urlSegment($eventLogId)\n ->get()\n ->go();\n }", "public function getEventAttachment($event_id, $approved = NULL) {\r\n\t\t\r\n\t\t$query = \"SELECT * FROM $this->att, $this->ev WHERE $this->att.event_id = $this->ev.event_id\";\r\n\t\t\r\n\t\t$query .= \" AND $this->ev.event_id = $event_id\";\r\n\t\t\r\n\t\tif(!is_null($approved)) $query .= \" AND $this->att.file_approved = $approved\";\r\n\t\t\r\n\t\treturn $this->executeQuery($query);\r\n\t\t\r\n\t}", "protected function getEvent()\n {\n if (null === $this->event) {\n $this->event = $event = new EntityEvent;\n\n $event->setTarget($this);\n }\n\n return $this->event;\n }", "public function getCalendarEventOrgUnitIdEventId($version, $orgUnitId, $eventId)\n {\n $uri = \"/d2l/api/le/$version/$orgUnitId/calendar/event/$eventId\";\n return new Request('GET', $uri);\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function getOutlook($url, $eventPath) {\n $body = '';\n $headers = array();\n if ($this->oAuthToken) {\n $headers['Authorization'] = 'Bearer ' . $this->oAuthToken;\n }\n\n $response = $this->request('GET', $url, $body, $headers);\n if ($response['statusCode'] === 200) {\n return array(\n 'body' => $response['body'],\n );\n }\n \n return array('body' => '');\n }", "public function getEvent()\n {\n $result = new stdClass;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id, $this->vars->date);\n $event->setTimezone(true);\n $result->event = $event->toJson(null, true, $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i A');\n // If recurring, we need to format the dates of this instance, since\n // Kronolith_Driver#getEvent will return the start/end dates of the\n // original event in the series.\n if ($event->recurs() && $this->vars->rsd) {\n $rs = new Horde_Date($this->vars->rsd);\n $result->event->rsd = $rs->strftime('%x');\n $re = new Horde_Date($this->vars->red);\n $result->event->red = $re->strftime('%x');\n }\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }", "public function getOne($id){\n $repo = $this->om->getRepository(Event::class);\n return $repo->find($id);\n }", "public function get($params=false){\n\t\n\t\t$this->_request['method'] = 'GetEvents';\n\t\n\t\tif($params){\n\t\t\t\n\t\t\tif(array_key_exists('method', $params)){\n\t\t\t\t$this->_request['method'] = $params['method'];\n\t\t\t\tunset($params['method']);\n\t\t\t}else if(array_key_exists('eventID', $params)){\n\t\t\t\t$this->_request['method'] = 'GetEvents';\n\t\t\t}\n\t\t\t\n\t\t\t$this->set($params);\n\t\t\t\n\t\t}\n\t\n\t\treturn $this;\n\t}", "public function getClient()\n {\n return $this->_directory;\n }", "Public function getEvents($id_cliente=1){\n\t\t// Imposto l'azienda di riferimento\n\t\t$id_azienda=$this->session->id_azienda;\n\t\t// Inizio a creare la query\n\t $sql = \"SELECT * FROM eventi\"; // WHERE eventi.inizio\";\n\t\t// Aggiungo il limite per l'azienda\n\t\t$sql.=\" WHERE eventi.id_azienda=$id_azienda \";\n\t\t// Aggiungo l'eventuale limite per il cliente selezionato\n\t\t$sql.=\" AND eventi.id_cliente=$id_cliente \";\n\t\t$sql.=\"AND eventi.inizio BETWEEN ? AND ? ORDER BY eventi.inizio ASC\";\n \treturn $this->db->query($sql, array($_GET['start'], $_GET['end']))->result();\n\t}", "public function get ($eventid) {\n\n $stmt = $this->db->prepare(\"\n SELECT *\n FROM stadium_events\n WHERE eventid = ?;\");\n if ($stmt) {\n\n $params = array($eventid);\n if ($stmt->execute($params)) {\n\n if ($stmt->rowCount() > 0) {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $response = array (\n 'hostid' => $row['hostid'],\n 'title' => $row['title'],\n 'sport' => $row['sport'],\n 'event_desc' => $row['event_desc'],\n 'location' => $row['location'],\n 'eventid' => $row['eventid'],\n 'skill_level' => $row['skill_level'],\n 'longitude' => $row['longitude'],\n 'latitude' => $row['latitude'],\n 'event_start' => $row['event_start'],\n 'event_end' => $row['event_end'],\n 'privacy' => $row['privacy']\n );\n\n $this->json_response_success(\"Event successfully retrieved!\", $response);\n\n } else {\n $this->json_response_error(\"Error getting event! - No rows returned\");\n }\n\n } else {\n $this->json_response_error(\"Error getting event - A Database error occurred while executing the stmt!\");\n }\n } else {\n $this->json_response_error(\"PDO stmt could not be created!\");\n }\n\n $stmt->closeCursor();\n unset($this->db);\n }", "public function getEventDetail()\n {\n // get event detail\n $this\n ->get('/event/detail/'.$this->event->id)\n ->assertStatus(200);\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "public function getEvents();", "public function getEvents();", "abstract public function getUri();", "public function getEvent()\n {\n return $this->hasOne(Event::class, ['id' => 'event_id']);\n }", "public function getEventById($event_id) {\n\t\t$sql_query = \"SELECT * FROM evento WHERE Id=\".$this->connection->real_escape_string($event_id).\";\";\n\t\t$result = $this->connection->query($sql_query);\n\t\tif($row = $result->fetch_assoc()){\n\t\t\t$event_info = [\n\t\t\t\t\"id\" => $row[\"Id\"],\n\t\t\t\t\"name\" => $row[\"Nombre\"],\n\t\t\t\t\"date\" => $row[\"Fecha\"],\n\t\t\t\t\"time\" => $row[\"Hora\"],\n\t\t\t\t\"dateM\" => $row[\"FechaModificacion\"],\n\t\t\t\t\"timeM\" => $row[\"HoraModificacion\"],\n\t\t\t\t\"author\" => $row[\"Autor\"],\n\t\t\t\t\"description\" => $row[\"Descripcion\"],\n\t\t\t\t\"thumbnail\" => $row[\"Miniatura\"]\n\t\t\t];\n\t\t}\n\t\treturn $event_info;\n\t}", "public function event() : DomainEvent {\n return $this->event;\n }", "function handleEvent( &$socket ) {\n\t$conn = socket_accept( $socket );\n\t$req = readHttpReq( $conn );\n\t$uri = parseGetReq( $req );\n\t$query = array();\n\n\t$status = ( $req && $uri )\n\t\t? '204 No Content'\n\t\t: '501 Not Implemented';\n\n\tif ( array_key_exists( 'query', $uri ) ) {\n\t\tparse_str( $uri[ 'query' ], $query );\n\t}\n\n\tsendHttpResp( $conn, $status );\n\tconsoleLog( \"$req [\\033[1;33m$status\\033[0m]\" );\n\n\treturn $query;\n}", "function getOneEvent($eventid)\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE eventid = '$eventid'\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }", "public function getEvent(): Event\n {\n return $this->mainEvent;\n }", "protected function getClient( $clientId ) {\n\t\t\t$data = [\n\t\t\t\t\"client_id\" => $clientId\n\t\t\t];\n\t\t\t$this->_connection->setTable(\"client\");\n\t\t\treturn $this->_connection->findFirst($data);\n\t\t}", "public function get($uri);", "function getCalendarObject($calendarId, $objectUri) {\n\n $this->mylog(' getCalendarObject '.$calendarId, $objectUri);\n\n $this->base->set_timestamp_return_format('U');\n $evt = $this->base->events_event_get($this->auth->token, $objectUri);\n $calendardata = $this->getCalendarData($evt);\n $ret = [\n\t 'id' => $evt['eve_id'],\n\t 'uri' => $evt['eve_id'].'.ics',\n\t 'lastmodified' => $evt['eve_date_modification'],\n\t 'etag' => '\"' . md5($calendardata) . '\"',\n\t 'calendarid' => $calendarId,\n\t 'size' => (int)strlen($calendardata),\n\t 'calendardata' => $calendardata,\n\t 'component' => 'vevent'\n\t ];\n // $this->mylog(print_r($ret, true));\n // file_put_contents('/tmp/calendarobject-'.$evt['eve_id'].'.txt', $ret);\n return $ret;\n }", "public function getCollection($uri, array $queryParams = [])\n {\n $events = (array)json_decode($this->apiGet($uri, $queryParams));\n $meta = array_pop($events);\n\n $collectionData = [];\n foreach ($events['events'] as $item) {\n $event = new EventEntity($item);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n }\n }\n\n $collectionData['events'][] = $event;\n\n // save the URL so we can look up by it\n $this->eventDb->save($event);\n }\n $collectionData['pagination'] = $meta;\n\n return $collectionData;\n }", "function getEvent() {\t\n\n\t//Get the event from pipe and json_decode it\n\treturn json_decode(file_get_contents('php://input'));\n}", "public function getEventType(): string;", "public function getUri() {}", "public function getUri() {}", "public function getCalendarEventAccessOrgUnitIdEventId($version, $orgUnitId, $eventId, $userId = null, $roleId = null)\n {\n $queryParrams = [\n \"userId\" => $userId, \"roleId\" => $roleId\n\n ];\n $queryString = http_build_query($queryParrams);\n $uri = \"/d2l/api/le/$version/$orgUnitId/calendar/event/$eventId/access/?$queryString\";\n return new Request('GET', $uri);\n }", "public function client($property = null) {\n if ( $property == null ) {\n return $this->client;\n }\n else {\n return @$this->client[$property];\n }\n }", "private function getTaskByUri($uri, $calendarId){\n\t\t//$this->db->query(\"SELECT e.* FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=?\",\"s\",$uri);\n\t\t\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(DavTask::model(),'d')\n\t\t\t->addCondition('uri', $uri,'=','d');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t->single()\n\t\t\t->join(DavTask::model()->tableName(),$joinCriteria, 'd')\n\t\t\t->criteria($whereCriteria);\n\t\t\n\t\treturn \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\t}", "static public function ctrReadEvents($item=null, $value=null){\n $events = EventsModel::mdlReadEvents($item, $value);\n return $events;\n }", "public function getCliente();", "public function getClient() {\n return $this->_get( 'client' );\n }", "abstract protected function get_event_name();", "public static function get_event_basic_eid($eid) {\n\t\t\t// #1 default value\n\t\t\t$event = array(\n\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t 'image' => DefaultImage::Event. '_small.jpg',\n\t\t\t\t\t\t 'image_large' => DefaultImage::Event.'_large.jpg', \n\t\t\t\t\t\t 'alt' => '', \n\t\t\t\t\t\t 'title' => ''\n\t\t\t\t\t\t );\n\t\t\t\n\t\t\t// #2 get event basic info\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT logo, title FROM event WHERE eid=? LIMIT 1;');\n\t\t\t$stmt->bind_param('i', $eid);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\tif ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\t$event['url'] = 'event?eid='.$eid;\n\t\t\t\tif (!empty($row['logo'])) \n\t\t\t\t{\n\t\t\t\t\t$event['image'] = $row['logo'].'_small.jpg';\n\t\t\t\t\t$event['image_large'] = $row['logo'].'_large.jpg';\n\t\t\t\t}\n\t\t\t\t$event['alt'] = strip_tags($row['title']);\n\t\t\t\t$event['title'] = strip_tags($row['title']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event;\n\t\t}", "public static function getJClientWithEvents($clientId) {\n $client = SchedDao::getJClient($clientId);\n $client->events = SchedDao::getJClientEvents($clientId);\n return $client;\n }", "public function getUserEvents() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/userevent/get_user_events.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "final public function getEventByID(Int $event_id)\n\t\t{\n\n\t\t\t# Validation\n\t\t\tif(!isSizedInt($event_id)) return false;\n\n\t\t\t# Get Event\n\t\t\t$occurences = $this->db->select(\n\t\t\t\t'SELECT * FROM mod_time WHERE event_id = ?', [$event_id]\n\t\t\t);\n\n\t\t\treturn $occurences ?: array();\n\n\t\t}", "protected static function getFacadeAccessor()\n {\n return 'client.events';\n }", "public function getEvents()\n {\n return json_decode((string) $this->response->getBody())->events;\n }" ]
[ "0.6026523", "0.56476104", "0.55299765", "0.5339097", "0.53301615", "0.52014196", "0.5114776", "0.51048684", "0.50857025", "0.5063577", "0.50404483", "0.50049466", "0.5003664", "0.49884564", "0.49456805", "0.49206483", "0.48921737", "0.48792472", "0.48657516", "0.48657516", "0.48657516", "0.4861933", "0.4857695", "0.48545665", "0.48389447", "0.48195016", "0.48177952", "0.480489", "0.4790509", "0.47746757", "0.4738755", "0.4736525", "0.47205704", "0.47181785", "0.47179276", "0.47167817", "0.47072", "0.46934724", "0.46852362", "0.46848008", "0.46740463", "0.465518", "0.4653535", "0.4646589", "0.46371245", "0.46207026", "0.46148598", "0.46120512", "0.45997864", "0.45978078", "0.4590289", "0.45862138", "0.45808244", "0.45731986", "0.45704204", "0.45699018", "0.45554948", "0.45493397", "0.45452282", "0.4518351", "0.45105228", "0.4479541", "0.44747773", "0.4458419", "0.44580477", "0.44549966", "0.44475204", "0.44448102", "0.44448102", "0.44422927", "0.44422927", "0.44421136", "0.44369313", "0.44359478", "0.4432097", "0.44226", "0.44222313", "0.4411203", "0.43964604", "0.43928778", "0.43914056", "0.4386908", "0.4377065", "0.43705755", "0.4361743", "0.43616554", "0.43616554", "0.43597883", "0.4353957", "0.434752", "0.43474483", "0.4341653", "0.43325356", "0.4330059", "0.4327245", "0.43260545", "0.43192023", "0.43173409", "0.4309406", "0.43090287" ]
0.5938819
1
Get the event by DAV client URI
private function getTaskByUri($uri, $calendarId){ //$this->db->query("SELECT e.* FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=?","s",$uri); $joinCriteria = FindCriteria::newInstance() ->addRawCondition('t.id', 'd.id'); $whereCriteria = FindCriteria::newInstance() ->addModel(DavTask::model(),'d') ->addCondition('uri', $uri,'=','d'); $findParams = FindParams::newInstance() ->single() ->join(DavTask::model()->tableName(),$joinCriteria, 'd') ->criteria($whereCriteria); return \GO\Tasks\Model\Task::model()->find($findParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetEventByURI($uri_path = '') \n {\n if ( ! $uri_path) {\n return false;\n }\n $data = $this->db\n ->join('status', 'status.id_status = event.id_status', 'left')\n ->join('event_detail', 'event_detail.id_event = event.id_event', 'left')\n ->join('localization', 'localization.id_localization = event_detail.id_localization', 'left')\n ->where('is_delete', 0)\n ->where('publish_date <=', $this->date_now)\n ->where(\"(expire_date >= '{$this->date_now}' OR expire_date IS NULL || expire_date = '0000-00-00')\")\n ->where(\"LCASE({$this->db->dbprefix('event')}.uri_path)\", strtolower($uri_path))\n ->where(\"LCASE({$this->db->dbprefix('status')}.status_text)\", \"publish\")\n ->where(\"LCASE({$this->db->dbprefix('localization')}.iso_1)\", $this->lang->get_active_uri_lang())\n ->order_by('event.id_event', 'desc')\n ->limit(1)\n ->get('event')\n ->row_array();\n\n return $data;\n }", "private function getEventByUri($uri, $calendarId){\n\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $uri,'=','d');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t->single()\n\t\t\t->join(DavEvent::model()->tableName(),$joinCriteria, 'd')\n\t\t\t->criteria($whereCriteria);\n\t\t\n\t\treturn \\GO\\Calendar\\Model\\Event::model()->find($findParams);\n\t}", "public function find_client($event_id, $client_id);", "public function getEvent();", "public function getEvent()\n {\n // get event\n $this\n ->get('/event')\n ->assertStatus(200);\n }", "public function calendar_get_item($ews,$event_id){\n\t\t// Form the GetItem request\n\t\t$request = new EWSType_GetItemType();\n\t\t\n\t\t// Define which item properties are returned in the response\n\t\t$itemProperties = new EWSType_ItemResponseShapeType();\n\t\t$itemProperties->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;\n\t\t\n\t\t// Add properties shape to request\n\t\t$request->ItemShape = $itemProperties;\n\t\t\n\t\t// Set the itemID of the desired item to retrieve\n\t\t$id = new EWSType_ItemIdType();\n\t\t$id->Id = $event_id;\n\t\t\n\t\t$request->ItemIds->ItemId = $id;\n\t\t\n\t\t// Send the listing (find) request and get the response\n\t\t$response = $ews->GetItem($request);\n\t\t//create an array to hold response data\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->GetItemResponseMessage->Items->CalendarItem);\n\t\treturn $event_data;\n\t }", "public static function event() {\n return self::service()->get('events');\n }", "public function getEvent($eventUrl)\n\t{\n\t\t// The given $eventUrl could, in legacy code, actually be a token instead\n\t\tif (!$this->connector->isEventUrl($eventUrl))\n\t\t{\n\t\t\t// This is an old-style token. Properly path it.\n\t\t\t$eventUrl = 'events/'. $eventUrl;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The Event is using the new distributed API, and we're given an EventUrl\n\t\t\t$eventUrl = urldecode($eventUrl);\n\n\t\t\t// Verify the OAuth signature of the call\n\t\t\t//\n\t\t\t// Todo: This can be deferred to get the wrapper functional, but MUST be done!\n\t\t\t// Maybe see: OAuthSignatureMethod_HMAC_SHA1::check_signature()?\n\t\t\t// Should be a library call, not a local method implementation\n\t\t\tif (false)\n\t\t\t{\n\t\t\t\t$error = array('error' => 'The request did not validate using AppDirect OAuth signatures');\n\t\t\t\tthrow new AppDirectValidationException('401', $error);\n\t\t\t}\n\t\t}\n\n\t\t// GET the event from the provided $eventUrl using a OAuth-signed request\n\t\treturn new AppDirectEvent($this->connector->get($eventUrl));\n\t}", "public static function get(Client $client, $id) {\n $req = $client->newRequest(\"GET\", \"/{accountname}/events/{id}\");\n $req->addParameter(\"id\", $id);\n\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }", "public function getEvent()\n {\n // Check for a new event on the current connection\n $buffer = '';\n do {\n $buffer .= fgets($this->socket, 512);\n } while (!empty($buffer) && !preg_match('/\\v+$/', $buffer));\n $buffer = trim($buffer);\n\n // If no new event was found, return NULL\n if (empty($buffer)) {\n return null;\n }\n\n // If the event has a prefix, extract it\n $prefix = '';\n if (substr($buffer, 0, 1) == ':') {\n $parts = explode(' ', $buffer, 3);\n $prefix = substr(array_shift($parts), 1);\n $buffer = implode(' ', $parts);\n }\n\n // Parse the command and arguments\n list($cmd, $args) = array_pad(explode(' ', $buffer, 2), 2, null);\n\n // Parse the server name or hostmask\n if (strpos($prefix, '@') === false) {\n $hostmask = new Phergie_Hostmask(\n null, null, $prefix\n );\n } else {\n $hostmask = Phergie_Hostmask::fromString($prefix);\n }\n\n // Parse the event arguments depending on the event type\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'names':\n case 'nick':\n case 'quit':\n case 'ping':\n case 'pong':\n case 'error':\n case 'part':\n $args = array_filter(array(ltrim($args, ':')));\n break;\n\n case 'privmsg':\n case 'notice':\n $args = $this->parseArguments($args, 2);\n list($source, $ctcp) = $args;\n if (substr($ctcp, 0, 1) === \"\\001\" && substr($ctcp, -1) === \"\\001\") {\n $ctcp = substr($ctcp, 1, -1);\n $reply = ($cmd == 'notice');\n list($cmd, $args) = array_pad(explode(' ', $ctcp, 2), 2, array());\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'version':\n case 'time':\n case 'finger':\n case 'ping':\n if ($reply) {\n $args = array($args);\n }\n break;\n case 'action':\n $args = array($source, $args);\n break;\n }\n }\n // This fixes the issue that seems to occur, but why does it?\n if (!is_array($args)) {\n $args = array($args);\n }\n break;\n\n case 'topic':\n case 'invite':\n case 'join':\n $args = $this->parseArguments($args, 2);\n break;\n\n case 'kick':\n case 'mode':\n $args = $this->parseArguments($args, 3);\n break;\n\n // Remove target and colon preceding description from responses\n default:\n $args = substr($args, strpos($args, ' ') + 2);\n break;\n }\n\n // Create, populate, and return an event object\n if (ctype_digit($cmd)) {\n $event = new Phergie_Event_Response;\n $event\n ->setCode($cmd)\n ->setDescription($args);\n } else {\n $event = new Phergie_Event_Request;\n $event\n ->setType($cmd)\n ->setArguments($args);\n $event->setHostmask($hostmask);\n }\n $event->setRawData($buffer);\n return $event;\n }", "public function getEvent()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Event']) ? $headers['X-NE-Event'] : null;\n }", "private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }", "public function getEvent()\n {\n return $this->getProperty(\"Event\",\n new Event($this->getContext(), new ResourcePath(\"Event\", $this->getResourcePath())));\n }", "function url_ical(string $pkey, string $eventid): string\n{\n return $GLOBALS['icaldownload']->url_ical($pkey, $eventid);\n}", "public function getEvent(): EventInterface;", "public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }", "public function getCalendarObject($calendarId, $objectUri) {\n\n\t\t\\GO::debug(\"c:getCalendarObject($calendarId,$objectUri)\");\n\n\t\t/*\n\t\t * When a client adds or updates an event, the server must return the\n\t\t * data identical to what the client sent. That's why we store the\n\t\t * client data in a separate table and if the mtime's match we use that.\n\t\t */\n\n\t\t//select on calendar id is necessary because somehow thunderbird tries\n\t\t//to get an event that's an invitation. It must not return the organizers event.\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t//->single()\n\t\t\t->limit(1)\n\t\t\t->ignoreAcl()\n\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t->criteria($whereCriteria)\n\t\t\t->join(DavEvent::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\n//\t\t$sql = \"SELECT d.uri,e.*, d.mtime AS client_mtime, d.data FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=? AND e.calendar_id=?\";\n//\t\t$this->cal->query($sql, 'si', array($objectUri,$calendarId));\n//\t\t$event = $this->cal->next_record();\n\n\t\t//\\GO::debug($event);\n\t\t\n\t\t$event = \\GO\\Calendar\\Model\\Event::model()->find($findParams)->fetch();\n\t\t\n\t\tif ($event) {\n\n\t\t\t\\GO::debug('Found event');\n\t\t\t\n\t\t\t$data = ($event->mtime==$event->client_mtime && !empty($event->data)) ? $event->data : $this->exportCalendarEvent($event);\n\t\t\t\\GO::debug($event->mtime==$event->client_mtime ? \"Returning client data (mtime)\" : \"Returning server data (mtime)\");\n\t\t\t\n\t\t\t\n//\t\t\t$data = $this->exportCalendarEvent($event);\n\t\t\t\n\t\t\t\\GO::debug($data);\n\n\t\t\t$object = array(\n\t\t\t\t'id' => $event->id,\n\t\t\t\t'uri' => $event->uri,\n\t\t\t\t'calendardata' => $data,\n\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t);\n\t\t\t//\\GO::debug($object);\n\t\t\treturn $object;\n\t\t} \n\t\telse {\n\n\t\t\t//$calendar = $this->cal->get_calendar($calendarId);\n\n//\t\t\t$sql = \"SELECT e.*, d.uri, d.mtime AS client_mtime, d.data FROM ta_tasks e INNER JOIN dav_tasks d ON d.id=e.id WHERE d.uri=?\";// AND e.tasklist_id=?\";\n//\t\t\t$this->tasks->query($sql, 's', array($objectUri));\n//\t\t\t$task = $this->tasks->next_record();\n\t\t\t\n\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t->addModel(DavTask::model(),'d')\n\t\t\t\t//->addCondition('tasklist_id', $calendarId) //Not necessary with the inner join on dav_tasks\n\t\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t\t->addRawCondition('t.id', 'd.id');\n\n\t\t\t$findParams = FindParams::newInstance()\n\t\t\t\t->single()\n\t\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t\t->criteria($whereCriteria)\n\t\t\t\t->join(DavTask::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\t\t\t\n\t\t\t\n\t\t\t$task = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\tif ($task) {\n\n\t\t\t\t\\GO::debug('Found task');\n\n\t\t\t\t$data = ($task->mtime==$task->client_mtime && !empty($task->data)) ? $task->data : $task->toICS();\n\n\t\t\t\t\\GO::debug($data);\n\n\t\t\t\t$object = array(\n\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t'uri' => $task->uri,\n\t\t\t\t\t'calendardata' => $data,\n\t\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t'etag'=>'\"' .date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t);\n\n\n\t\t\t\treturn $object;\n\t\t\t}\n\t\t}\n\t\tthrow new Sabre\\DAV\\Exception\\NotFound('File not found');\n\t}", "public function index($appId)\n {\n return $this->try(function() use ($appId)\n {\n return $this->client->get('v1/apps/'.$appId.'/events');\n });\n }", "public function getEvent() {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "protected function getEvent(string $event) {\n return $this\n ->mailjet_webhook_events()\n ->where('event', $event)\n ->orderBy('created_at', 'desc')\n ->first();\n }", "public function event( $id ) {\n\t\treturn $this->client->getEvent( [ 'id' => $id ] );\n\t}", "public function getEvent()\n {\n return $this->getData('event');\n }", "public function getEvent($event_uri, $verbose = true)\n {\n $params = [];\n if ($verbose) {\n $params['verbose'] = 'yes';\n }\n\n $event_list = (array)json_decode($this->apiGet($event_uri, $params));\n if (isset($event_list['events']) && isset($event_list['events'][0])) {\n $event = new EventEntity($event_list['events'][0]);\n $this->eventDb->save($event);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n $hostsInfo->entity = $this->userApi->getUser($hostsInfo->host_uri);\n }\n }\n return $event;\n }\n\n return false;\n }", "public function getEvent($eventId)\n {\n $url = '/events/' . $eventId;\n\n $response = $this->request($url);\n\n $dataWrapper = $this->contentHandler->getEventDataWrapper($response);\n\n return $dataWrapper->getData()->get(0);\n }", "public function getEventDispatch();", "public function getEventObject(){\n $eventTimeID = $this->getID();\n\n $prepared = self::adhocQuery(function( \\PDO $connection ) use ($eventTimeID){\n $statement = $connection->prepare(\"\n SELECT sev.id FROM SchedulizerEvent sev\n JOIN SchedulizerEventTime sevTime ON sevTime.eventID = sev.id\n WHERE sevTime.id = :eventTimeID\n \");\n $statement->bindValue(\":eventTimeID\", $eventTimeID);\n return $statement;\n });\n\n return Event::getByID($prepared->fetch(\\PDO::FETCH_COLUMN));\n }", "public function getEvent() {\n\t}", "public function getEvent() {\n $request = $this->getRequest();\n\n if (request('type') == 'event_callback') {\n $event = $request['event'];\n } else {\n $event = $request;\n }\n\n return $event;\n }", "public function getEventName() : String;", "public function getEvent($id)\n {\n\n $cached = $this->getFromCache('event_cache_'.$id);\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch, event, checkins and RSVPs (only the latter has pictures)\n $event = $this->client->getEvent(array('id' => $id));\n\n $rsvps = $this->client->getRSVPs(\n array('event_id' => $id, 'rsvp' => 'yes', 'order' => 'name', 'fields' => 'host', 'page' => 300)\n );\n\n $event = $event->toArray();\n $event['checkins'] = array();\n $event['rsvps'] = array();\n foreach ($rsvps as $rsvp) {\n $event['rsvps'][] = array(\n 'id' => $rsvp['member']['member_id'],\n 'name' => $rsvp['member']['name'],\n 'photo' => isset($rsvp['member_photo']) ? $rsvp['member_photo'] : null,\n 'host' => $rsvp['host']\n );\n }\n\n $this->saveInCache('event_cache_'.$id, $event);\n\n return $event;\n }", "public function getEvent($name, $method = HTTP_METH_GET)\n {\n $url = '/events/' . $name . '.json';\n return $this->send($url, $method);\n }", "abstract public function getEventName();", "function GetOneEvents($event_id)\n\t{\n\t\t$sql = \"SELECT * FROM event WHERE event_id = '\".$event_id.\"'\";\n\t\t$data = CDBCon::GetInstance()->GetRow($sql);\n\t\treturn $data;\n\t}", "public function findClient($client);", "function agenda_get_item($event_id)\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n $sql = \"SELECT \tevent.id \t\t\t\t\t\tAS id,\n\t\t\t\t\tevent.title \t\t\t\t\tAS title,\n\t\t\t\t\tevent.description \t\t\t\tAS description,\n\t\t\t\t\tevent.start_date \t\t\t\tAS old_start_date,\n\t\t\t\t\tevent.end_date \t\t\t\t\tAS old_end_date,\n\t\t\t\t\tevent.author_id \t\t\t\tAS author_id,\n\t\t\t\t\trel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\tevent.master_event_id\t\t \tAS master_event_id,\n\t\t\t\t\trel_event_recipient.user_id\t\tAS user_id,\n\t\t\t\t\trel_event_recipient.group_id\tAS group_id\n FROM \" . $tbl . \"\n\n WHERE event.id = \" . (int) $event_id ;\n\n $event = claro_sql_query_get_single_row($sql);\n\n if ($event) return $event;\n else return claro_failure::set_failure('EVENT_ENTRY_UNKNOW');\n\n}", "function getEventById()\n\t{\n\t\t//echo \" From ByID: \" . $this->_id;\n\t\t$eventId = 1;\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%d.%m.%Y')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_time, '%H:%i')\");\n\t\t$query->select(\"DATE_FORMAT(dt_event_end, '%H:%i')\");\n\t\t$query->select($db->nameQuote('t1.s_category'));\n\t\t$query->select($db->nameQuote('t1.s_place'));\n\t\t$query->select($db->nameQuote('t1.s_price'));\n\t\t$query->select($db->nameQuote('t1.idt_drivin_event'));\n\t\t$query->select($db->nameQuote('t1.n_num_part'));\n\t\t$query->select('t1.`n_num_part` - (SELECT COUNT(t2.`idt_drivin_event_apply`) ' .\n\t\t\t' FROM #__jevent_events_apply as t2 ' .\n\t\t\t' WHERE t2.`idt_drivin_event` = t1.`idt_drivin_event` AND t2.dt_cancel is null) as n_num_free');\n\t\t$query->from('#__jevent_events as t1');\n\t\t$query->where($db->nameQuote('idt_drivin_event') . '=' . $this->_id);\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t}\n\t\t//echo \" From ByID: \" . count($link);\n\t\t//echo \" From ByID: \" . $query;\n\t\treturn $link;\n\t}", "public function getEventSubscriber();", "public function getEvent()\r\n {\r\n return $this->Event;\r\n }", "public function getURI();", "public function event(): EventDispatcherInterface;", "function getEventsHostedByCompany()\n{\n\t$companyUserName=validate_input($_GET['companyUserName']);\n\t$companyid=getCompanyIdfromCompanyUserName($companyUserName);\t\n}", "public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }", "public static function get_event($eventid) {\r\n global $uid;\r\n return Database::get()->querySingle(\"SELECT * FROM personal_calendar WHERE id = ?d AND user_id = ?d\", $eventid, $uid);\r\n }", "public static function getlist(Client $client, $params = null) {\n if ($params == null || is_array($params)) {\n $params = new EventQuery($params == null ? array() : $params);\n }\n $req = $client->newRequest(\"GET\", \"/{accountname}/events\");\n\n $req->addQuery(\"context\", $params->context);\n $req->addQuery(\"filter\", $params->filter);\n $req->addQuery(\"lastupdatesince\", $params->lastupdatesince);\n $req->addQuery(\"limit\", $params->limit);\n $req->addQuery(\"offset\", $params->offset);\n $req->addQuery(\"orderby\", $params->orderby);\n $req->addQuery(\"output\", $params->output);\n $req->addQuery(\"searchterm\", $params->searchterm);\n $req->addQuery(\"simplefilter\", $params->simplefilter);\n\n $result = $req->run(\"json\");\n return EventsList::fromJson($result);\n }", "public static function getEvent($event_id)\n\t{\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\t$sql = \"SELECT *, events.id as event_id, fest_type.name as fest_type_name FROM events JOIN fest_type ON fest_type.id = events.fest_type_id WHERE events.id = :event_id\";\n\t\t$query = $database->prepare($sql);\n\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t// fetch() is the PDO method that gets a single result\n\t\treturn $query->fetch();\n\t}", "function getEventID() {\n\t\treturn $this->_EventID;\n\t}", "function getXeroInvoiceCallbackURI() {\r\n $sql = $this->db->prepare(\"SELECT uri FROM CALLBACK_URIS WHERE callback='xero_invoice'\");\r\n $sql->execute();\r\n return $sql->fetch(PDO::FETCH_ASSOC);\r\n }", "public function getByStub($stub)\n {\n $item = $this->eventDb->load('stub', $stub);\n\n if (!$item) {\n return false;\n }\n\n return $this->getEvent($item['uri']);\n }", "public function getEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n $event = $this->model->getEvent($id);\n\n $this->send(200, $event);\n }", "function uri(): string;", "function get_event(){\n\t\tglobal $EM_Event;\n\t\tif( is_object($EM_Event) && $EM_Event->event_id == $this->event_id ){\n\t\t\treturn $EM_Event;\n\t\t}else{\n\t\t\tif( is_numeric($this->event_id) && $this->event_id > 0 ){\n\t\t\t\treturn em_get_event($this->event_id, 'event_id');\n\t\t\t}elseif( is_array($this->bookings) ){\n\t\t\t\tforeach($this->bookings as $EM_Booking){\n\t\t\t\t\t/* @var $EM_Booking EM_Booking */\n\t\t\t\t\treturn em_get_event($EM_Booking->event_id, 'event_id');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn em_get_event($this->event_id, 'event_id');\n\t}", "public function retrieveEventLog($eventLogId)\n {\n return $this->start()->uri(\"/api/system/event-log\")\n ->urlSegment($eventLogId)\n ->get()\n ->go();\n }", "protected function getEvent()\n {\n if (null === $this->event) {\n $this->event = $event = new EntityEvent;\n\n $event->setTarget($this);\n }\n\n return $this->event;\n }", "public function getEventAttachment($event_id, $approved = NULL) {\r\n\t\t\r\n\t\t$query = \"SELECT * FROM $this->att, $this->ev WHERE $this->att.event_id = $this->ev.event_id\";\r\n\t\t\r\n\t\t$query .= \" AND $this->ev.event_id = $event_id\";\r\n\t\t\r\n\t\tif(!is_null($approved)) $query .= \" AND $this->att.file_approved = $approved\";\r\n\t\t\r\n\t\treturn $this->executeQuery($query);\r\n\t\t\r\n\t}", "public function getCalendarEventOrgUnitIdEventId($version, $orgUnitId, $eventId)\n {\n $uri = \"/d2l/api/le/$version/$orgUnitId/calendar/event/$eventId\";\n return new Request('GET', $uri);\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function getOutlook($url, $eventPath) {\n $body = '';\n $headers = array();\n if ($this->oAuthToken) {\n $headers['Authorization'] = 'Bearer ' . $this->oAuthToken;\n }\n\n $response = $this->request('GET', $url, $body, $headers);\n if ($response['statusCode'] === 200) {\n return array(\n 'body' => $response['body'],\n );\n }\n \n return array('body' => '');\n }", "public function getEvent()\n {\n $result = new stdClass;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id, $this->vars->date);\n $event->setTimezone(true);\n $result->event = $event->toJson(null, true, $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i A');\n // If recurring, we need to format the dates of this instance, since\n // Kronolith_Driver#getEvent will return the start/end dates of the\n // original event in the series.\n if ($event->recurs() && $this->vars->rsd) {\n $rs = new Horde_Date($this->vars->rsd);\n $result->event->rsd = $rs->strftime('%x');\n $re = new Horde_Date($this->vars->red);\n $result->event->red = $re->strftime('%x');\n }\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }", "public function getOne($id){\n $repo = $this->om->getRepository(Event::class);\n return $repo->find($id);\n }", "public function get($params=false){\n\t\n\t\t$this->_request['method'] = 'GetEvents';\n\t\n\t\tif($params){\n\t\t\t\n\t\t\tif(array_key_exists('method', $params)){\n\t\t\t\t$this->_request['method'] = $params['method'];\n\t\t\t\tunset($params['method']);\n\t\t\t}else if(array_key_exists('eventID', $params)){\n\t\t\t\t$this->_request['method'] = 'GetEvents';\n\t\t\t}\n\t\t\t\n\t\t\t$this->set($params);\n\t\t\t\n\t\t}\n\t\n\t\treturn $this;\n\t}", "public function getClient()\n {\n return $this->_directory;\n }", "Public function getEvents($id_cliente=1){\n\t\t// Imposto l'azienda di riferimento\n\t\t$id_azienda=$this->session->id_azienda;\n\t\t// Inizio a creare la query\n\t $sql = \"SELECT * FROM eventi\"; // WHERE eventi.inizio\";\n\t\t// Aggiungo il limite per l'azienda\n\t\t$sql.=\" WHERE eventi.id_azienda=$id_azienda \";\n\t\t// Aggiungo l'eventuale limite per il cliente selezionato\n\t\t$sql.=\" AND eventi.id_cliente=$id_cliente \";\n\t\t$sql.=\"AND eventi.inizio BETWEEN ? AND ? ORDER BY eventi.inizio ASC\";\n \treturn $this->db->query($sql, array($_GET['start'], $_GET['end']))->result();\n\t}", "public function get ($eventid) {\n\n $stmt = $this->db->prepare(\"\n SELECT *\n FROM stadium_events\n WHERE eventid = ?;\");\n if ($stmt) {\n\n $params = array($eventid);\n if ($stmt->execute($params)) {\n\n if ($stmt->rowCount() > 0) {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $response = array (\n 'hostid' => $row['hostid'],\n 'title' => $row['title'],\n 'sport' => $row['sport'],\n 'event_desc' => $row['event_desc'],\n 'location' => $row['location'],\n 'eventid' => $row['eventid'],\n 'skill_level' => $row['skill_level'],\n 'longitude' => $row['longitude'],\n 'latitude' => $row['latitude'],\n 'event_start' => $row['event_start'],\n 'event_end' => $row['event_end'],\n 'privacy' => $row['privacy']\n );\n\n $this->json_response_success(\"Event successfully retrieved!\", $response);\n\n } else {\n $this->json_response_error(\"Error getting event! - No rows returned\");\n }\n\n } else {\n $this->json_response_error(\"Error getting event - A Database error occurred while executing the stmt!\");\n }\n } else {\n $this->json_response_error(\"PDO stmt could not be created!\");\n }\n\n $stmt->closeCursor();\n unset($this->db);\n }", "public function getEventDetail()\n {\n // get event detail\n $this\n ->get('/event/detail/'.$this->event->id)\n ->assertStatus(200);\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "protected function _getRecurEvent()\n {\n return new Calendar_Model_Event(array(\n 'summary' => 'Breakfast',\n 'dtstart' => '2010-05-20 06:00:00',\n 'dtend' => '2010-05-20 06:15:00',\n 'description' => 'Breakfast',\n 'rrule' => 'FREQ=DAILY;INTERVAL=1', \n 'container_id' => $this->_testCalendar->getId(),\n Tinebase_Model_Grants::GRANT_EDIT => true,\n ));\n }", "public function getEvents();", "public function getEvents();", "abstract public function getUri();", "public function getEvent()\n {\n return $this->hasOne(Event::class, ['id' => 'event_id']);\n }", "public function getEventById($event_id) {\n\t\t$sql_query = \"SELECT * FROM evento WHERE Id=\".$this->connection->real_escape_string($event_id).\";\";\n\t\t$result = $this->connection->query($sql_query);\n\t\tif($row = $result->fetch_assoc()){\n\t\t\t$event_info = [\n\t\t\t\t\"id\" => $row[\"Id\"],\n\t\t\t\t\"name\" => $row[\"Nombre\"],\n\t\t\t\t\"date\" => $row[\"Fecha\"],\n\t\t\t\t\"time\" => $row[\"Hora\"],\n\t\t\t\t\"dateM\" => $row[\"FechaModificacion\"],\n\t\t\t\t\"timeM\" => $row[\"HoraModificacion\"],\n\t\t\t\t\"author\" => $row[\"Autor\"],\n\t\t\t\t\"description\" => $row[\"Descripcion\"],\n\t\t\t\t\"thumbnail\" => $row[\"Miniatura\"]\n\t\t\t];\n\t\t}\n\t\treturn $event_info;\n\t}", "public function event() : DomainEvent {\n return $this->event;\n }", "function handleEvent( &$socket ) {\n\t$conn = socket_accept( $socket );\n\t$req = readHttpReq( $conn );\n\t$uri = parseGetReq( $req );\n\t$query = array();\n\n\t$status = ( $req && $uri )\n\t\t? '204 No Content'\n\t\t: '501 Not Implemented';\n\n\tif ( array_key_exists( 'query', $uri ) ) {\n\t\tparse_str( $uri[ 'query' ], $query );\n\t}\n\n\tsendHttpResp( $conn, $status );\n\tconsoleLog( \"$req [\\033[1;33m$status\\033[0m]\" );\n\n\treturn $query;\n}", "function getOneEvent($eventid)\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE eventid = '$eventid'\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }", "public function getEvent(): Event\n {\n return $this->mainEvent;\n }", "protected function getClient( $clientId ) {\n\t\t\t$data = [\n\t\t\t\t\"client_id\" => $clientId\n\t\t\t];\n\t\t\t$this->_connection->setTable(\"client\");\n\t\t\treturn $this->_connection->findFirst($data);\n\t\t}", "public function get($uri);", "function getCalendarObject($calendarId, $objectUri) {\n\n $this->mylog(' getCalendarObject '.$calendarId, $objectUri);\n\n $this->base->set_timestamp_return_format('U');\n $evt = $this->base->events_event_get($this->auth->token, $objectUri);\n $calendardata = $this->getCalendarData($evt);\n $ret = [\n\t 'id' => $evt['eve_id'],\n\t 'uri' => $evt['eve_id'].'.ics',\n\t 'lastmodified' => $evt['eve_date_modification'],\n\t 'etag' => '\"' . md5($calendardata) . '\"',\n\t 'calendarid' => $calendarId,\n\t 'size' => (int)strlen($calendardata),\n\t 'calendardata' => $calendardata,\n\t 'component' => 'vevent'\n\t ];\n // $this->mylog(print_r($ret, true));\n // file_put_contents('/tmp/calendarobject-'.$evt['eve_id'].'.txt', $ret);\n return $ret;\n }", "public function getCollection($uri, array $queryParams = [])\n {\n $events = (array)json_decode($this->apiGet($uri, $queryParams));\n $meta = array_pop($events);\n\n $collectionData = [];\n foreach ($events['events'] as $item) {\n $event = new EventEntity($item);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n }\n }\n\n $collectionData['events'][] = $event;\n\n // save the URL so we can look up by it\n $this->eventDb->save($event);\n }\n $collectionData['pagination'] = $meta;\n\n return $collectionData;\n }", "function getEvent() {\t\n\n\t//Get the event from pipe and json_decode it\n\treturn json_decode(file_get_contents('php://input'));\n}", "public function getEventType(): string;", "public function getUri() {}", "public function getUri() {}", "public function getCalendarEventAccessOrgUnitIdEventId($version, $orgUnitId, $eventId, $userId = null, $roleId = null)\n {\n $queryParrams = [\n \"userId\" => $userId, \"roleId\" => $roleId\n\n ];\n $queryString = http_build_query($queryParrams);\n $uri = \"/d2l/api/le/$version/$orgUnitId/calendar/event/$eventId/access/?$queryString\";\n return new Request('GET', $uri);\n }", "public function client($property = null) {\n if ( $property == null ) {\n return $this->client;\n }\n else {\n return @$this->client[$property];\n }\n }", "static public function ctrReadEvents($item=null, $value=null){\n $events = EventsModel::mdlReadEvents($item, $value);\n return $events;\n }", "public function getCliente();", "public function getClient() {\n return $this->_get( 'client' );\n }", "abstract protected function get_event_name();", "public static function get_event_basic_eid($eid) {\n\t\t\t// #1 default value\n\t\t\t$event = array(\n\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t 'image' => DefaultImage::Event. '_small.jpg',\n\t\t\t\t\t\t 'image_large' => DefaultImage::Event.'_large.jpg', \n\t\t\t\t\t\t 'alt' => '', \n\t\t\t\t\t\t 'title' => ''\n\t\t\t\t\t\t );\n\t\t\t\n\t\t\t// #2 get event basic info\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT logo, title FROM event WHERE eid=? LIMIT 1;');\n\t\t\t$stmt->bind_param('i', $eid);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\tif ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\t$event['url'] = 'event?eid='.$eid;\n\t\t\t\tif (!empty($row['logo'])) \n\t\t\t\t{\n\t\t\t\t\t$event['image'] = $row['logo'].'_small.jpg';\n\t\t\t\t\t$event['image_large'] = $row['logo'].'_large.jpg';\n\t\t\t\t}\n\t\t\t\t$event['alt'] = strip_tags($row['title']);\n\t\t\t\t$event['title'] = strip_tags($row['title']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event;\n\t\t}", "public static function getJClientWithEvents($clientId) {\n $client = SchedDao::getJClient($clientId);\n $client->events = SchedDao::getJClientEvents($clientId);\n return $client;\n }", "public function getUserEvents() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/userevent/get_user_events.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "final public function getEventByID(Int $event_id)\n\t\t{\n\n\t\t\t# Validation\n\t\t\tif(!isSizedInt($event_id)) return false;\n\n\t\t\t# Get Event\n\t\t\t$occurences = $this->db->select(\n\t\t\t\t'SELECT * FROM mod_time WHERE event_id = ?', [$event_id]\n\t\t\t);\n\n\t\t\treturn $occurences ?: array();\n\n\t\t}", "protected static function getFacadeAccessor()\n {\n return 'client.events';\n }", "public function getEvents()\n {\n return json_decode((string) $this->response->getBody())->events;\n }" ]
[ "0.602806", "0.5939343", "0.5647948", "0.5531834", "0.53405076", "0.53297037", "0.5203697", "0.5116562", "0.51079565", "0.5086977", "0.50643736", "0.5042135", "0.5005071", "0.5004832", "0.49903888", "0.49476907", "0.4920648", "0.48937073", "0.48807824", "0.48674336", "0.48674336", "0.48674336", "0.48618963", "0.48603818", "0.4856312", "0.48398352", "0.48202905", "0.48200876", "0.48072526", "0.47918305", "0.47769305", "0.47407576", "0.47378263", "0.47209343", "0.47203895", "0.47183087", "0.47159", "0.47075912", "0.4694459", "0.46871307", "0.46864033", "0.4673126", "0.46576592", "0.46539706", "0.46479952", "0.46381652", "0.46242243", "0.4614827", "0.46132964", "0.45998377", "0.4599684", "0.45918235", "0.45847008", "0.4582089", "0.45735782", "0.45713168", "0.45703888", "0.45559296", "0.45498866", "0.45446095", "0.45192447", "0.45101723", "0.4482178", "0.44727594", "0.44612426", "0.44584554", "0.44557303", "0.44494447", "0.4446393", "0.4446393", "0.44447985", "0.44447985", "0.44415238", "0.44370794", "0.4436115", "0.4432505", "0.44241998", "0.44219315", "0.44127563", "0.4398608", "0.43924704", "0.43899244", "0.4386751", "0.43776816", "0.43722484", "0.4362739", "0.43606752", "0.43606752", "0.4360644", "0.43517607", "0.43496713", "0.4340897", "0.43326062", "0.4331323", "0.43286988", "0.43280712", "0.43195286", "0.4318516", "0.43121132", "0.4311274" ]
0.43463764
91